/* =====================================================
   Planning & Opdrachten CSS
   ===================================================== */

/* --- Kalender wrapper --- */
.planning_container {
    padding: 40px 1rem 0;
}

/* ── Week label in header ───────────────────────────────────────────── */
.planning_week_label {
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 0.15rem;
}

/* ── Weekgrid ───────────────────────────────────────────────────────── */
.weekgrid_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 2rem;
}

.weekgrid {
    display: grid;
    /* 1 naam-kolom + 7 dag-kolommen */
    grid-template-columns: 160px repeat(7, minmax(130px, 1fr));
    min-width: 1050px;
}

/* Hoek */
.weekgrid_hoek {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Dag headers */
.weekgrid_dag_header {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.weekgrid_dag_header--vandaag {
    background: #eff6ff;
    border-bottom-color: var(--primary, #001b5e);
}

.weekgrid_dag_naam {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
}

.weekgrid_dag_num {
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}

.weekgrid_dag_num--vandaag {
    background: var(--primary, #001b5e);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

/* Naam-cel (sticky links) */
.weekgrid_naam_cel {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 1;
}

.weekgrid_naam_tekst {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.weekgrid_naam {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weekgrid_uur_badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary, #001b5e);
    border-radius: 99px;
    padding: 1px 7px;
    white-space: nowrap;
    align-self: flex-start;
}

/* Grid cel */
.weekgrid_cel {
    padding: 0.45rem;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 72px;
    background: #fff;
}

.weekgrid_cel--vandaag {
    background: #eff6ff;
}

/* Planning kaart */
.planning_kaart {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #3b5ba8;
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    position: relative;
}

.planning_kaart:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.planning_kaart_uren {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
    margin-bottom: 1px;
}

.planning_kaart_titel {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    word-break: break-word;
}

.planning_kaart_sub {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Cel klikbaar */
.weekgrid_cel {
    cursor: pointer;
}

.weekgrid_cel:hover {
    background: #f8fafc;
}

.weekgrid_cel--vandaag:hover {
    background: #dbeafe;
}

/* Drag & Drop */
.planning_kaart--dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.planning_kaart[draggable="true"] {
    cursor: grab;
}

.planning_kaart[draggable="true"]:active {
    cursor: grabbing;
}

.weekgrid_cel--droptarget {
    background: #dbeafe !important;
    outline: 2px dashed #3b82f6;
    outline-offset: -2px;
}

/* Kaarten wrapper zodat "+" altijd onderaan blijft */
.weekgrid_cel_kaarten {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* "+" knop onderaan elke cel */
.weekgrid_plus_knop {
    align-self: flex-start;
    margin-top: auto;
    background: none;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    padding: 1px 6px;
    cursor: pointer;
    visibility: hidden;
}
.weekgrid_cel:hover .weekgrid_plus_knop,
.weekgrid_cel--vandaag:hover .weekgrid_plus_knop {
    visibility: visible;
}

/* Snelkeuze uren */
.uren_snelkeuze {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.uren_knop {
    padding: 0.3rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.uren_knop:hover { background: #f1f5f9; border-color: #cbd5e1; }

.uren_knop--actief {
    background: var(--primary, #001b5e);
    border-color: var(--primary, #001b5e);
    color: #fff;
}

/* Statische waarde-weergave in modal */
.form_statisch {
    font-size: 0.88rem;
    color: #1e293b;
    font-weight: 500;
    padding: 0.5rem 0;
}

/* ────────────────────────────────────────────────────────────────── */

.kalender_wrapper {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, #e2e8f0);
    padding: 1.25rem;
    margin: 0 0 2rem;
    overflow: hidden;
}

/* FullCalendar overrides */
.fc .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary, #001b5e);
}

.fc .fc-button {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    box-shadow: none;
    transition: background 0.15s;
}

.fc .fc-button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--primary, #001b5e);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--primary, #001b5e);
    border-color: var(--primary, #001b5e);
    color: #fff;
}

.fc .fc-today-button {
    background: var(--primary, #001b5e);
    border-color: var(--primary, #001b5e);
    color: #fff;
}

.fc .fc-today-button:hover {
    background: #002d9c;
    border-color: #002d9c;
    color: #fff;
}

.fc-day-today {
    background: rgba(0, 27, 94, 0.03) !important;
}

.fc-timegrid-now-indicator-line {
    border-color: #e11d48;
}

.fc-timegrid-now-indicator-arrow {
    border-top-color: #e11d48;
    border-bottom-color: #e11d48;
}

.fc .fc-event {
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.fc .fc-timegrid-event {
    padding: 2px 4px;
}

.fc .fc-daygrid-event {
    border-radius: 4px;
}

.fc-week-number {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* --- Modal --- */
.modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal_overlay[hidden] {
    display: none !important;
}

.modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 48px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0.6; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal_titel {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary, #001b5e);
    margin: 0;
}

.modal_sluiten {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s;
}

.modal_sluiten:hover { color: #334155; }

#planning_form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.modal_acties {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

.modal_acties_rechts {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* [hidden] mag nooit overruled worden door display van andere classes */
.modal_overlay [hidden],
.modal [hidden] {
    display: none !important;
}

/* Buttons in modal nooit full-width */
.modal .btn,
.modal_acties .btn,
.modal_acties_rechts .btn {
    width: auto !important;
    flex-shrink: 0 !important;
    flex: none !important;
}

/* ── Speciale modal-knop styling ─────────────────────────────────── */
.modal_btn_del {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.modal_btn_del:hover { background: #fee2e2; }
.modal_btn_del .material-symbols-outlined { font-size: 1rem; }

.modal_btn_annuleer {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1.5px solid #cbd5e1;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    transition: border-color 0.15s, color 0.15s;
}
.modal_btn_annuleer:hover { border-color: #94a3b8; color: #334155; }

.modal_btn_voltooid {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1.5px solid #16a34a;
    color: #16a34a;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.modal_btn_voltooid:hover { background: #f0fdf4; }
.modal_btn_voltooid .material-symbols-outlined { font-size: 1rem; }

.modal_btn_opslaan {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--primary, #001b5e);
    color: #fff;
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1.3rem;
    border-radius: 8px;
    transition: background 0.15s;
}
.modal_btn_opslaan:hover { background: #002da0; }
.modal_btn_opslaan:disabled { opacity: 0.6; cursor: not-allowed; }
.modal_btn_opslaan .material-symbols-outlined { font-size: 1rem; }

/* --- Form helpers --- */
.form_group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form_label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.01em;
}

.form_label .required {
    color: #e11d48;
    margin-left: 2px;
}

.form_input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}

.form_input:focus {
    border-color: var(--primary, #001b5e);
    box-shadow: 0 0 0 3px rgba(0, 27, 94, 0.08);
}

.form_input::placeholder { color: #94a3b8; }

.form_rij {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form_input--kleur {
    height: 2.6rem;
    padding: 0.2rem 0.3rem;
    cursor: pointer;
    border-radius: 8px;
}

.form_input--textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Acties in formulieren (buiten modal) */
.form_kaart {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin: 0 0 2rem;
    overflow: hidden;
}

.form_sectie {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form_sectie_titel {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 0 0 .25rem;
}

.form_acties {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

/* --- Opdrachten index --- */
.opdracht_cel {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.opdracht_kleur_dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* --- Opdracht detail / bekijken --- */
.overzicht_kaart {
    background: #fff;
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 0 1.5rem;
}

.overzicht_sectie_titel {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary, #001b5e);
    margin: 0 1.5rem .75rem;
}

.opdracht_meta_rij {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.opdracht_meta_item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta_label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.meta_waarde {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
}

.opdracht_omschrijving {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 1rem;
    white-space: pre-wrap;
}

/* --- Jaaroverzicht --- */
.maand_bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 140px;
    padding: 0 0 0.5rem;
    margin-bottom: 1rem;
}

.maand_bar_item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.maand_bar_outer {
    width: 100%;
    background: #f1f5f9;
    border-radius: 4px 4px 0 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.maand_bar_inner {
    width: 100%;
    background: var(--primary, #001b5e);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}

.maand_bar_label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

.maand_bar_uren {
    font-size: 0.7rem;
    color: #94a3b8;
}

.overzicht_totaal {
    font-size: 0.9rem;
    color: #475569;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.jaar_form { display: flex; align-items: center; }

.table_row--totaal {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    font-weight: 600;
}

/* --- Planningsheet detail --- */
.sheet_sectie_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 1.5rem .75rem;
}

.koppel_form {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .planning_container { padding: 1rem 0 0; }

    /* Weekgrid mobiel: toon 3 dag-kolommen (scrollable) */
    .weekgrid {
        grid-template-columns: 110px repeat(7, minmax(115px, 1fr));
        min-width: 0;
    }
    .weekgrid_naam_cel { padding: 0.5rem; }
    .weekgrid_naam { font-size: 0.78rem; }
    .weekgrid_cel { padding: 0.35rem; min-height: 60px; }
    .planning_kaart { padding: 0.35rem 0.45rem; }
    .planning_kaart_titel { font-size: 0.75rem; }
    .uren_snelkeuze { gap: 0.3rem; }
    .uren_knop { padding: 0.28rem 0.5rem; font-size: 0.75rem; }

    .kalender_wrapper {
        margin: 0 0 1.5rem;
        padding: 0.5rem 0.25rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .overzicht_kaart  { margin: 0 0 1.5rem; }
    .overzicht_sectie_titel { margin: 0 0 .75rem; }
    .form_rij { grid-template-columns: 1fr; }
    .form_kaart { margin: 0 0 2rem; }
    .form_acties { flex-wrap: wrap; gap: 0.75rem; }
    .form_acties .btn { flex-shrink: 0; }

    /* Modal mobiel: volledige breedte */
    .modal { max-width: 100% !important; max-height: 88vh; }
    #planning_form { padding: 1rem 1rem 0.5rem; }
    .maand_bars { height: 100px; }

    /* FullCalendar mobiel */
    .fc .fc-toolbar { flex-direction: row; gap: 0.5rem; flex-wrap: wrap; }
    .fc .fc-toolbar-title { font-size: 1rem; }
    .fc .fc-button { font-size: 0.78rem; padding: 0.28rem 0.6rem; }

    /* Dag-view tijdkolom smaller */
    .fc .fc-timegrid-axis { width: 44px !important; }
    .fc .fc-timegrid-axis-cushion { font-size: 0.7rem; padding: 0 4px 0 0; }

    /* Event tekst groter op mobiel voor tap */
    .fc .fc-event { font-size: 0.82rem; min-height: 28px; }
    .fc .fc-timegrid-event .fc-event-main { padding: 3px 5px; }

    /* Footer toolbar (maand/week/dag tabs onderaan) */
    .fc .fc-footer-toolbar {
        margin-top: 0.5rem;
        border-top: 1px solid #e2e8f0;
        padding-top: 0.5rem;
        justify-content: center;
    }
    .fc .fc-footer-toolbar .fc-button {
        flex: 1;
        border-radius: 8px;
        font-size: 0.8rem;
        padding: 0.45rem 0.5rem;
    }
    .fc .fc-footer-toolbar .fc-button-group {
        display: flex;
        width: 100%;
        gap: 0.35rem;
    }

    /* Dag header compact */
    .fc .fc-col-header-cell-cushion { font-size: 0.75rem; padding: 4px 2px; }
    .fc .fc-daygrid-day-number { font-size: 0.78rem; }

    /* Huidige dag markering prominent */
    .fc-day-today .fc-col-header-cell-cushion {
        background: var(--primary, #001b5e);
        color: #fff;
        border-radius: 99px;
        padding: 3px 8px;
    }
}
