html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #F7F5F0; /* crem WebID (UIX-01) */
    font-family: ui-sans-serif, system-ui, sans-serif;
}

.fc-daygrid-day-top { padding-right: 12px !important; }
.fc-scroller { overflow-y: auto !important; overflow-x: hidden !important; }
header { 
    background: #fff; 
    border-bottom: 1px solid #e2e8f0; 
    padding: 0.5rem 1rem; 
    display: flex; 
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 40;
}
main { 
    min-height: calc(100vh - 120px); 
    height: 100%; 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    padding: 8px; /* Padding restaurat */
}
#calendar { 
    flex: 1; 
    background: #fff; 
    padding: 10px; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
    border: 1px solid #f1f5f9; 
    width: 100% !important; 
    min-height: 0;
}
.fc-header-toolbar { display: none !important; }
.custom-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.fc .fc-col-header-cell-cushion { display: block !important; width: 100% !important; padding: 10px 0 !important; }

@media (max-width: 768px) {
    header h1 { font-size: 1.1rem !important; }
    /* Shell fix pe mobil: doar grila calendarului scrollează pe verticală,
       restul ecranului rămâne pe loc. min-height:0 lasă flex-ul să mărginească
       înălțimea indiferent de câte rânduri are toolbar-ul. */
    /* padding-bottom lasă loc barei de jos fixe (MOB-02, ~52px + safe-area) */
    main { padding: 8px 8px calc(60px + env(safe-area-inset-bottom)); min-height: 0 !important; }
    .fc-daygrid-dot-event { justify-content: flex-start !important; }
    .fc-daygrid-event .fc-event-title { text-align: left !important; }

    html, body {
        height: 100% !important;
        overflow: hidden !important;
        position: relative !important;
    }
    .fc-scroller {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    /* Capetele de zi (rândul cu zilele) rămân fixe deasupra grilei care scrollează */
    .fc .fc-col-header {
        position: sticky;
        top: 0;
        z-index: 6;
        background: #fff;
    }
}

.fc-theme-standard .fc-scrollgrid { border-right: 1px solid #e2e8f0 !important; }
.fc .fc-daygrid-day-number { margin-right: 8px !important; position: relative; z-index: 5; }
/* Corectură tăiere cifre în dreapta la calendarul lunar */
.fc .fc-daygrid-day-number { margin-right: 4px !important; }
.fc-daygrid-day-frame { overflow: hidden !important; }

/* Săptămână/Lună: fundal galben și pe header și pe zi */
.fc .fc-col-header-cell.fc-day-today { background-color: rgba(253, 224, 71, 0.4) !important; }
.fc .fc-daygrid-day.fc-day-today,
.fc .fc-timegrid-col.fc-day-today { background-color: rgba(253, 224, 71, 0.15) !important; }

/* Zi: Ascunde complet background-ul galben */
.fc-timeGridDay-view .fc-col-header-cell.fc-day-today,
.fc-timeGridDay-view .fc-timegrid-col.fc-day-today,
.fc-timeGridDay-view .fc-daygrid-day.fc-day-today { background-color: transparent !important; }

/* Protejează numerele de pe marginea dreaptă în view-ul de Lună */
.fc-daygrid-day-top {
    padding-right: 12px !important;
}
/* Forțează containerul de scroll al FullCalendar să nu ascundă elemente */
.fc-scroller {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}

/* LOG-03 · „De confirmat urgent": puls amber pe programările În așteptare cu start <20h,
   plus pe butonul „Noi" când există urgente. */
@keyframes apptUrgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45); }
    50%      { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.20); }
}
.fc-event.appt-urgent {
    animation: apptUrgentPulse 1.6s ease-in-out infinite;
    border-width: 2px !important;
    border-color: #f59e0b !important;
}
@keyframes pendingBtnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
    50%      { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.00); }
}
.pending-has-urgent { animation: pendingBtnPulse 1.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
    .fc-event.appt-urgent, .pending-has-urgent { animation: none; }
    .fc-event.appt-urgent { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5); }
}
