/* Base */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #fafafa;
    color: #111;
}

a {
    color: #111;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 900px;
    margin: 26px auto;
    padding: 0 16px;
}

/* Top bar */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.nav {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav .left {
    font-weight: 700;
}

.nav .right a {
    margin-left: 12px;
}

.nav .right a.active {
    font-weight: 700;
}

/* Cards */
.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
}

.muted {
    color: #666;
}

/* Forms */
label {
    display: block;
    font-size: 13px;
    margin: 10px 0 6px;
    color: #444;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
}

button {
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

button.primary {
    background: #5b2bd6;
    border-color: #5b2bd6;
    color: #fff;
}

/* Flash */
.flash {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}

/* Footer */
.footer {
    max-width: 900px;
    margin: 18px auto 24px;
    padding: 0 16px;
    color: #666;
}

.clickable-row td {
    transition: background 0.15s ease;
}

.clickable-row:hover td {
    background: #f3f6fb !important;
}

.clickable-row.is-me td {
    background: #fff6bf;
}

.clickable-row.is-me:hover td {
    background: #fff2a8 !important;
}

/* Modal confirmation */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    padding: 24px;
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    color: #111;
}

.modal-text {
    margin: 0;
    color: #444;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.btn-danger {
    background: #b42318;
    border: 1px solid #b42318;
    color: #fff;
}

.btn-danger:hover {
    background: #912018;
    border-color: #912018;
    text-decoration: none;
}

.btn-light {
    background: #f8f8f8;
    border: 1px solid #d6d6d6;
    color: #222;
}

.btn-light:hover {
    background: #efefef;
    text-decoration: none;
}

/* Planning large layout */
.container-planning {
    max-width: 1700px;
    margin: 26px auto;
    padding: 0 16px;
}

.planning-card {
    overflow-x: auto;
}

.planning-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1600px;
}

.planning-employee {
    min-width: 220px;
    white-space: nowrap;
}

.planning-day {
    min-width: 180px;
}

/* EXACTIMER - LEAVE MODULE */
.leave-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.leave-badge.pending {
    background: #fff7ed;
    color: #c2410c;
}

.leave-badge.approved {
    background: #ecfdf5;
    color: #047857;
}

.leave-badge.rejected {
    background: #fef2f2;
    color: #b91c1c;
}

.leave-muted {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.leave-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    background: white;
}

.leave-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.leave-type {
    font-weight: 600;
    font-size: 14px;
}

.leave-comment {
    font-size: 13px;
    color: #475569;
    margin-top: 6px;
}

@media (max-width: 900px) {
    .leave-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard */
.dashboard-shell {
    max-width: 1100px;
    margin: 0 auto;
}

.dashboard-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px 18px;
    max-width: 760px;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.dashboard-action-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
}

.dashboard-action-card h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.dashboard-action-card p {
    margin: 0 0 14px;
    color: #475569;
    line-height: 1.5;
}

.dashboard-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
}

.dashboard-section h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.dashboard-section p {
    margin: 0 0 12px;
    color: #555;
}

.dashboard-section a {
    display: inline-block;
}

@media (max-width: 700px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Top navigation */
.topnav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e7edf5;
}

.topnav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    color: #0f172a;
    text-decoration: none;
    min-height: 68px;
    flex-shrink: 0;
    transform: translateX(40px);
}

.topnav-logo {
    height: 34px;
    width: auto;
    display: block;
}

.topnav-toggle {
    display: none;
    border: 0;
    background: transparent;
    padding: 8px;
    margin-left: auto;
    cursor: pointer;
    border-radius: 10px;
}

.topnav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #0f172a;
    border-radius: 999px;
}

.topnav-toggle span + span {
    margin-top: 5px;
}

.topnav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.topnav-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.topnav-line-primary {
    min-height: 40px;
}

.topnav-line-secondary {
    min-height: 36px;
}

.topnav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.topnav-link:hover {
    background: #f4f7fb;
    color: #0b57d0;
    text-decoration: none;
}

.topnav-link.is-active {
    background: #eaf2ff;
    color: #0b57d0;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #d7e6ff;
}

@media (max-width: 900px) {
    .topnav-inner {
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 16px;
    }

    .topnav-brand {
        min-height: auto;
    }

    .topnav-logo {
        height: 28px;
    }

    .topnav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topnav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        padding: 8px 0 4px;
    }

    .topnav-menu.is-open {
        display: flex;
    }

    .topnav-line {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .topnav-link {
        display: block;
        width: 100%;
        padding: 12px 14px;
        border: 1px solid #e5e7eb;
        background: #fff;
    }
}

/* Events */
.day-event-box {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
}

.day-event-title {
    font-weight: 800;
    margin-bottom: 6px;
}

.day-event-text {
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.day-event-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.event-orange { background: #fff7ed; color: #c2410c; }
.event-red { background: #fef2f2; color: #b91c1c; }
.event-blue { background: #eff6ff; color: #1d4ed8; }
.event-green { background: #ecfdf5; color: #047857; }
.event-purple { background: #f5f3ff; color: #7c3aed; }

.events-grid,
.planning-events-editor {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.event-editor-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.event-editor-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #0f172a;
}

.event-editor-card input,
.event-editor-card textarea,
.event-editor-card select {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.my-sticky-left {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
}

@media (max-width: 1200px) {
    .events-grid,
    .planning-events-editor {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .events-grid,
    .planning-events-editor {
        grid-template-columns: 1fr;
    }
}

/* Mobile helpers */
.mobile-hidden {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Leave review */
.leave-review-header-card {
    margin-bottom: 18px;
}

.leave-review-page-title {
    margin: 0 0 8px;
}

.leave-review-flash {
    margin-top: 14px;
}

.leave-review-flash-error {
    background: #ffecec;
    border-color: #ffb3b3;
}

.leave-review-section-card {
    margin-bottom: 18px;
}

.leave-review-section-title {
    margin-top: 0;
}

.leave-review-list {
    display: grid;
    gap: 16px;
}

.leave-review-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    background: #fff;
}

.leave-review-card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.leave-review-meta {
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

.leave-review-period {
    text-align: right;
}

.leave-review-comment-block {
    margin-top: 10px;
}

.leave-review-form {
    margin-top: 14px;
}

.leave-review-field {
    margin-bottom: 10px;
}

.leave-review-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.leave-review-textarea {
    width: 100%;
    box-sizing: border-box;
}

.leave-review-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.leave-review-history {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.leave-review-history th,
.leave-review-history td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.leave-table {
    width: 100%;
    border-collapse: collapse;
}

.leave-table th,
.leave-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

@media (max-width: 700px) {
    .leave-review-card {
        padding: 14px;
    }

    .leave-review-period {
        text-align: left;
        width: 100%;
    }

    .leave-review-actions {
        flex-direction: column;
    }

    .leave-review-actions .btn {
        width: 100%;
    }
}

/* End of day modal */
.eod-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
}

.eod-modal.is-open {
    display: flex;
}

.eod-modal-box {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.eod-modal-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 800;
}

.eod-modal-text {
    margin: 0 0 10px;
    color: #334155;
    line-height: 1.5;
}

.eod-modal-meta {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 14px;
}

.eod-reason-wrap {
    margin: 14px 0;
}

.eod-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.eod-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    resize: vertical;
}

.eod-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.eod-hidden {
    display: none;
}

@media (max-width: 700px) {
    .eod-modal-box {
        padding: 18px;
    }

    .eod-actions {
        flex-direction: column;
    }

    .eod-actions .btn {
        width: 100%;
    }
}

/* My planning */
.my-planning-header-card {
    margin-bottom: 18px;
}

.my-planning-header-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.my-planning-page-title {
    margin: 0 0 8px;
}

.my-planning-subtitle {
    color: #666;
}

.my-planning-today {
    margin-top: 8px;
    color: #0f172a;
    font-weight: 700;
}

.my-planning-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.my-planning-empty {
    color: #666;
}

.ts-mini-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ts-confirmed-date {
    margin-top: 6px;
}

.ts-approved-wrap {
    margin-top: 8px;
}

.ts-approved-details {
    margin-top: 6px;
}

.my-planning-confirm-wrap {
    display: flex;
    align-items: center;
}

/* My planning mobile */
.mobile-planning-shell {
    max-width: 760px;
    margin: 0 auto;
}

.mobile-week-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.mobile-day-pill {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 10px 6px;
    text-align: center;
}

.mobile-day-pill strong {
    display: block;
    font-size: 22px;
    line-height: 1;
    margin-top: 4px;
}

.mobile-day-pill span {
    display: block;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.mobile-day-pill-today {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.mobile-day-pill-today span {
    color: #ccfbf1;
}

.day-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.day-card-today {
    border: 2px solid #14b8a6;
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.10);
}

.day-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.day-card-title {
    margin: 0;
    font-size: 24px;
}

.day-card-date {
    color: #64748b;
    font-size: 14px;
}

.today-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 800;
}

.schedule-pill {
    display: inline-block;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 10px;
}

.meta-line {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 4px;
}

.day-empty {
    color: #94a3b8;
    font-style: italic;
}

.ts-mini {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.ts-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.ts-pending {
    background: #fff7ed;
    color: #c2410c;
}

.ts-confirmed {
    background: #ecfdf5;
    color: #047857;
}

.ts-approved {
    background: #eff6ff;
    color: #1d4ed8;
}

.ts-muted {
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 640px) {
    .day-card-title {
        font-size: 22px;
    }

    .schedule-pill {
        font-size: 20px;
    }
}

/* Quick assign */
.quick-assign-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.quick-assign-card-premium {
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.08);
}

.quick-assign-header {
    margin-bottom: 22px;
}

.quick-assign-header h2 {
    margin: 0 0 6px;
    font-size: 2rem;
    line-height: 1.1;
    color: #0f172a;
}

.quick-assign-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.98rem;
}

.quick-assign-header-side {
    display: flex;
    align-items: flex-start;
}

.quick-assign-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

.qa-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
}

.qa-panel-full {
    grid-column: 1 / -1;
}

.qa-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.qa-panel-head h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.qa-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
}

.qa-help,
.qa-help-inline {
    color: #64748b;
    font-size: 0.85rem;
}

.qa-help {
    margin-top: 10px;
}

.qa-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.qa-top-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.qa-multiselect {
    width: 100%;
    min-height: 210px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px;
    background: #ffffff;
    font-size: 0.95rem;
    color: #0f172a;
    outline: none;
}

.qa-multiselect:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.qa-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 16px;
}

.qa-field {
    display: flex;
    flex-direction: column;
}

.qa-input {
    width: 100%;
    height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 14px;
    background: #ffffff;
    font-size: 0.95rem;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
}

.qa-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.qa-field-checkbox {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding-top: 6px;
}

.qa-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 30px;
    flex: 0 0 auto;
}

.qa-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.qa-switch-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: 0.25s;
    cursor: pointer;
}

.qa-switch-slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 4px;
    top: 4px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.qa-switch input:checked + .qa-switch-slider {
    background: #2563eb;
}

.qa-switch input:checked + .qa-switch-slider::before {
    transform: translateX(24px);
}

.qa-switch-text {
    display: flex;
    flex-direction: column;
}

.qa-switch-text strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.qa-switch-text small {
    color: #64748b;
    font-size: 0.82rem;
}

.qa-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    gap: 12px;
}

.qa-day {
    position: relative;
    display: block;
    cursor: pointer;
}

.qa-day input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qa-day-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 86px;
    padding: 12px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #ffffff;
    transition: all 0.18s ease;
    text-align: center;
}

.qa-day-box strong {
    color: #0f172a;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.qa-day-box small {
    color: #64748b;
    font-size: 0.84rem;
}

.qa-day:hover .qa-day-box {
    transform: translateY(-1px);
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.10);
}

.qa-day input:checked + .qa-day-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.18);
}

.qa-day input:checked + .qa-day-box strong,
.qa-day input:checked + .qa-day-box small {
    color: #0f172a;
}

.quick-assign-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.qa-submit-btn {
    appearance: none;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    height: 50px;
    padding: 0 22px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.qa-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
}

.qa-reset-btn {
    appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    height: 50px;
    padding: 0 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qa-reset-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

@media (max-width: 1100px) {
    .quick-assign-grid {
        grid-template-columns: 1fr;
    }

    .qa-fields {
        grid-template-columns: 1fr;
    }

    .qa-days {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .quick-assign-card {
        padding: 18px;
        border-radius: 16px;
    }

    .quick-assign-header h2 {
        font-size: 1.5rem;
    }

    .qa-days {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-assign-footer {
        flex-direction: column;
    }

    .qa-submit-btn,
    .qa-reset-btn {
        width: 100%;
    }
}

/* Planning sections */
.planning-block-nav {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.planning-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.planning-section-head h2 {
    margin: 0;
}

.planning-page {
    display: grid;
    gap: 18px;
}

.planning-card-section {
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.planning-hero {
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.planning-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.planning-page-title {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.05;
    color: #0f172a;
}

.planning-week-range {
    color: #475569;
    font-size: 1rem;
    margin-bottom: 10px;
}

.planning-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.planning-status-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.planning-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.planning-status-badge.is-published {
    background: #dcfce7;
    color: #166534;
}

.planning-status-badge.is-draft {
    background: #fef3c7;
    color: #92400e;
}

.planning-week-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.planning-nav-btn {
    min-height: 46px;
    border-radius: 14px;
    font-weight: 700;
    padding: 0 16px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.section-heading-center {
    justify-content: center;
    text-align: center;
}

.section-title {
    margin: 0 0 6px;
    font-size: 1.35rem;
    color: #0f172a;
    line-height: 1.15;
}

.section-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.planning-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.planning-inline-form {
    display: inline;
}

.section-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.section-actions-right {
    justify-content: flex-end;
}

/* Planning équipe moderne */
.planning-team-card {
    overflow: hidden;
}

.planning-team-table-wrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    padding: 10px;
}

.planning-table-modern {
    width: 100%;
    min-width: 1380px;
    border-collapse: separate;
    border-spacing: 10px;
}

.planning-th-employee,
.planning-th-day {
    background: transparent;
    border: none;
    padding: 0;
    vertical-align: top;
}

.planning-day-head {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    padding: 14px;
    min-height: 96px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.planning-day-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.planning-day-date {
    font-size: 0.86rem;
    color: #64748b;
    margin-bottom: 10px;
}

.planning-day-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.planning-row-modern td {
    vertical-align: top;
    border: none;
    padding: 0;
    background: transparent;
}

.planning-employee-cell {
    min-width: 240px;
}

.planning-employee-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    padding: 16px;
    min-height: 210px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.planning-employee-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.planning-employee-site {
    color: #64748b;
    font-size: 0.86rem;
    margin-top: 8px;
}

.planning-cell-modern {
    min-width: 190px;
}

.planning-slot-card {
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    padding: 14px;
    min-height: 210px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    display: grid;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.planning-slot-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
    border-color: #bfd3e6;
}

.planning-slot-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.planning-slot-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
}

.planning-table-modern input[type="time"],
.planning-table-modern input[type="number"] {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    min-height: 42px;
    padding: 0 12px;
    box-sizing: border-box;
    background: #fff;
    color: #0f172a;
    font-size: 0.94rem;
}

.planning-table-modern input[type="time"]:focus,
.planning-table-modern input[type="number"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
    outline: none;
}

.planning-validate-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
}

.planning-validate-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.planning-empty-state {
    padding: 20px;
    color: #64748b;
    text-align: center;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}

/* Couverture horaire premium */
.coverage-card-premium {
    overflow: hidden;
}

.coverage-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.coverage-legend-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.coverage-legend-item.is-empty {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.coverage-legend-item.is-medium {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.coverage-legend-item.is-strong {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.coverage-table-wrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 10px;
}

.coverage-table-premium {
    width: 100%;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 10px;
}

.coverage-table-premium th,
.coverage-table-premium td {
    border: none;
    padding: 0;
    background: transparent;
}

.coverage-hour-head,
.coverage-day-head {
    vertical-align: top;
}

.coverage-hour-head {
    min-width: 90px;
}

.coverage-day-head-box {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.coverage-day-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.coverage-day-date {
    font-size: 0.84rem;
    color: #64748b;
}

.coverage-hour-cell {
    min-width: 90px;
    vertical-align: middle;
}

.coverage-hour-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    width: 100%;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.coverage-cell {
    min-width: 120px;
}

.coverage-chip {
    min-height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.coverage-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}

.coverage-chip.is-zero {
    background: #ffffff;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.coverage-chip.is-low {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: #475569;
    border-color: #dbe4ee;
}

.coverage-chip.is-medium {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.coverage-chip.is-high {
    background: linear-gradient(180deg, #ecfdf5 0%, #dcfce7 100%);
    color: #166534;
    border-color: #bbf7d0;
}

.coverage-value {
    line-height: 1;
}

.coverage-summary-row {
    display: grid;
    grid-template-columns: 120px repeat(7, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    align-items: stretch;
}

.coverage-summary-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe4ee;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    padding: 12px;
}

.coverage-summary-card {
    min-height: 92px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe4ee;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.coverage-summary-day {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.coverage-summary-metric {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.coverage-summary-value {
    font-size: 1rem;
    font-weight: 800;
    color: #1d4ed8;
    line-height: 1;
}

.coverage-summary-text {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .coverage-summary-row {
        min-width: 1100px;
    }
}

@media (max-width: 900px) {
    .planning-page-title {
        font-size: 1.6rem;
    }

    .planning-week-nav {
        width: 100%;
    }

    .planning-nav-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

.driver-pointage-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.driver-pointage-error {
    background: #ffecec;
    border: 1px solid #ffb3b3;
}

.driver-pointage-gps-box {
    margin-top: 14px;
}

.driver-pointage-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    resize: vertical;
    min-height: 110px;
    font: inherit;
}

.driver-pointage-preview-note {
    margin-top: 8px;
}

@media (max-width: 700px) {
    .driver-pointage-actions {
        flex-direction: column;
    }

    .driver-pointage-actions button {
        width: 100%;
    }
}
