@import url("./typography.css?v=dr-clock");

/* =========================================================
   GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    --dashboard-brand-gradient: linear-gradient(135deg, #fb7185, #8b5cf6);
    --action-background: linear-gradient(135deg, #6155dc, #8b5cf6);
    --dashboard-max-width: 1280px;
    --dashboard-gutter: 28px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--dr-clock-font);
    background: #f4f7fb;
    color: #172033;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

/* =========================================================
   HEADER
   ========================================================= */

.header {
    background: #ffffff;
    border-bottom: 1px solid #e6eaf0;
}

.header-inner {
    width: 100%;
    max-width: 1280px;
    min-height: 82px;

    margin: 0 auto;
    padding: 18px 28px;
    gap: 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    margin: 0;

    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;

    color: #172033;
}

.header p {
    margin: 3px 0 0;

    font-size: 14px;
    color: #718096;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.header-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 140px; height: 70px; object-fit: contain; flex: 0 0 auto; border-radius: 15px; }
.brand-copy { min-width: 0; }
.brand-copy h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: relative; }
.account-menu summary, .navigation-toggle, .navigation-close {
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid #e4e8f2;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    cursor: pointer;
}
.account-menu summary { display: grid; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu form {
    position: absolute;
    z-index: 2;
    inset: calc(100% + 6px) 0 auto auto;
    min-width: 140px;
    padding: 5px;
    border: 1px solid #e4e8f2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px #17203320;
}
.account-menu-name {
    width: min(180px, 45vw);
    padding: 8px 10px;
    color: #172033;
    font-size: 14px;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.account-menu button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: #f4f7fb;
    cursor: pointer;
}

.payment-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.payment-settings-header h1 {
    margin: 0;
}

.payment-settings-form {
    display: block;
}

.settings-panel h2 {
    margin: 0 0 16px;
    color: #172033;
    font-size: 19px;
}

.admin-page { max-width: 1320px; }
.admin-page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 4px 0 22px; }
.admin-page-heading h2 { margin: 3px 0 4px; color: #172033; font-size: 28px; letter-spacing: -.6px; }
.admin-page-heading p { margin: 0; color: #667085; }
.eyebrow, .panel-kicker { color: #7254d8; font-size: 10px; font-weight: 800; letter-spacing: 1.15px; }
.admin-panel { padding: 24px; border-color: #e6e8f2; border-radius: 16px; box-shadow: 0 8px 24px rgba(37, 41, 86, .055); }
.admin-panel h3 { margin: 3px 0 0; color: #182230; font-size: 18px; letter-spacing: -.2px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.panel-heading p { margin: 5px 0 0; color: #7b8496; font-size: 13px; }
.report-date-form { display: flex; align-items: flex-end; flex-wrap: wrap; }
.report-date-form .filter-group { min-width: 170px; }
.report-date-form .filter-button { border-radius: 9px; box-shadow: 0 5px 12px rgba(99, 83, 214, .18); }
.range-note { margin: 12px 0 0; color: #8992a3; font-size: 12px; }
.report-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 22px; }
.super-admin-mobile { display: none; }
.payment-attempts-cards { display: none; }
.panel-heading.invoice-heading { align-items: center; margin: 0 0 16px; }
.invoice-heading h3 { margin: 0; }
.invoice-summary { margin: 0 0 18px; }
.invoice-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}
.invoice-summary dd { margin: 0; font-weight: 650; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice-summary .invoice-balance {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #e4e8f2;
    font-weight: 700;
}
.invoice-payment-form { display: grid; gap: 12px; }
.invoice-payment-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.invoice-payment-form legend { margin-bottom: 8px; padding: 0; font-weight: 650; }
.invoice-methods, .invoice-payment-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invoice-methods label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid #e4e8f2;
    border-radius: 8px;
    cursor: pointer;
}
.invoice-methods input { margin: 0; accent-color: #2563eb; }
.invoice-payment-form .settings-description { margin: 0; }
.invoice-create-form .invoice-summary {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eef4ff;
}
.invoice-create-method {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-bottom: 7px;
    padding: 0 12px;
    border: 1px solid #d6dfed;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.invoice-create-method:last-child { margin-bottom: 0; }
.invoice-create-method:has(input:checked) { border-color: #87aaff; background: #eaf2ff; }
.invoice-payment-form .nav-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.invoice-create-method input { margin: 0; accent-color: #2563eb; }
.invoice-history-title { margin: 20px 0 10px; }
.invoice-history-cards { display: none; }
@media (max-width: 700px) {
    .invoice-history-table { display: none; }
    .invoice-history-cards { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
    .invoice-history-cards li { padding: 12px; border: 1px solid #e4e8f2; border-radius: 10px; }
    .invoice-history-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
    .invoice-history-row + .invoice-history-row { margin-top: 4px; color: #526078; font-size: 13px; }
    .invoice-history-row a { color: #2563eb; padding: 8px 0; text-underline-offset: 3px; }
}
.form-submission-error {
    flex: 0 0 100%;
    grid-column: 1 / -1;
    margin: 6px 0 0;
    color: #a32121;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.invoice-refund { margin-top: 16px; }
.invoice-refund summary { padding: 10px 0; cursor: pointer; color: #2563eb; font-weight: 600; }
.invoice-refund form { margin-top: 8px; }
.invoice-history-empty { margin: 0; padding: 12px; border: 1px solid #edf0f5; border-radius: 11px; }
.mobile-disclosure > summary { display: none; }

@media (max-width: 700px) {
    .panel-heading.invoice-heading { flex-direction: row; flex-wrap: wrap; }
    .invoice-heading .clear-button { min-height: 44px; }
    .invoice-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .invoice-methods label { padding: 0 6px; }
    .invoice-payment-actions > button { flex: 1 1 135px; min-height: 44px; }
    .walkin-checkin-form > .filter-button { width: 100%; min-height: 44px; }
    #manual-medicine { width: 100%; min-height: 44px; }
    .settings-inline-form.payment-attempts-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .payment-attempts-filters > .filter-group { grid-column: 1 / -1; }
    .payment-attempts-table { display: none; }
    .payment-attempts-cards { display: block; }
    .payment-attempts-cards .payment-attempt-card h3 { margin: 0; }
    .payment-attempt-card .status-chip { flex: 0 1 auto; white-space: normal; overflow-wrap: anywhere; }
    .payment-attempt-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
    .payment-attempts-cards .payment-attempt-card dl > div { display: block; min-width: 0; }
    .payment-attempts-cards .payment-attempt-card dd { text-align: left; overflow-wrap: anywhere; }
    .payment-attempt-card .payment-attempt-wide {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px solid #e4e8f2;
    }
    .super-admin-home > .super-admin-desktop { display: none; }
    .super-admin-home > .super-admin-mobile { display: grid; gap: 22px; }
    .clinic-management > .super-admin-desktop { display: none; }
    .clinic-management > .clinic-management-mobile { display: block; }
    .clinic-management > .admin-page-heading { display: none; }
    .clinic-management .clinic-create { margin-bottom: 16px; padding: 0 14px; }
    .filters.appointment-filters { margin-bottom: 16px; padding: 0 14px; }
    .mobile-disclosure > summary {
        display: list-item;
        padding: 12px 0;
        color: #6d28d9;
        font-weight: 700;
        cursor: pointer;
    }
    .clinic-create > .panel-heading { display: none; }
    .mobile-disclosure > form { padding-bottom: 14px; }
    .mobile-disclosure :is(.settings-grid, .filters-grid) { gap: 12px; }
    .clinic-card-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
    .clinic-card-actions a,
    .clinic-card-actions button {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        color: #6d28d9;
        font-size: 13px;
        font-weight: 650;
    }
    .clinic-card-actions a { text-underline-offset: 3px; }
    .super-admin-mobile h2 { margin: 0; font-size: 18px; }
    .super-admin-mobile-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 12px 0 0;
    }
    .super-admin-mobile-metric,
    .super-admin-mobile-clinic {
        border: 1px solid #e4e8f2;
        border-radius: 12px;
        background: #fff;
    }
    .super-admin-mobile-metric {
        display: grid;
        justify-items: start;
        gap: 2px;
        padding: 11px 12px;
    }
    .super-admin-mobile-metric .nav-icon { width: 17px; height: 17px; color: #6d28d9; }
    .super-admin-mobile-metric dt { order: 1; color: #526078; font-size: 12px; }
    .super-admin-mobile-metric dd { margin: 0; font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
    .super-admin-mobile-section-heading,
    .super-admin-mobile-clinic-meta,
    .super-admin-mobile-clinic dl > div {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 8px;
    }
    .super-admin-mobile-section-heading a { color: #6d28d9; font-size: 13px; font-weight: 650; }
    .super-admin-mobile-clinic { margin-top: 10px; padding: 13px; }
    .super-admin-mobile-clinic h3 { margin: 0 0 8px; font-size: 15px; overflow-wrap: anywhere; }
    .super-admin-mobile-clinic h3 a { text-decoration-color: #a78bfa; text-underline-offset: 3px; }
    .super-admin-mobile-clinic-meta,
    .super-admin-mobile-clinic dt { color: #526078; font-size: 12px; }
    .super-admin-mobile-clinic dl { display: grid; gap: 8px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid #e4e8f2; }
    .super-admin-mobile-clinic dd { margin: 0; font-size: 13px; text-align: right; }
}
.report-summary-card { position: relative; overflow: hidden; min-height: 120px; padding: 20px 22px; border: 1px solid #e7e9f1; border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(37, 41, 86, .04); }
.report-summary-card::after { position: absolute; top: -25px; right: -15px; width: 95px; height: 95px; border-radius: 50%; content: ""; opacity: .09; background: currentColor; }
.report-summary-card span { display: block; color: #667085; font-size: 13px; font-weight: 600; }
.report-summary-card strong { display: block; margin-top: 7px; color: #172033; font-size: 26px; letter-spacing: -.5px; }
.report-summary-card small { color: #8992a3; font-size: 11px; }
.summary-blue { color: #4f6bed; }.summary-green { color: #079878; }.summary-rose { color: #e04f7d; }
.revenue-chart-layout { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; align-items: center; gap: 24px; }
.revenue-chart-wrap { position: relative; width: 100%; min-height: 300px; overflow-x: auto; overflow-y: hidden; }
.daily-revenue-canvas { display: block; min-width: 720px; }
.revenue-heading { align-items: center; }
.chart-total { min-width: 150px; padding: 10px 15px; border: 1px solid #e5e7f3; border-radius: 11px; background: linear-gradient(135deg, #f7f5ff, #eff9ff); text-align: right; }
.chart-total span { display: block; color: #81899a; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.chart-total strong { color: #4e45bf; font-size: 19px; }
.chart-empty, .empty-state { padding: 22px; color: #8b93a3; text-align: center; }
.grid-heading { align-items: flex-end; }
.grid-search { display: flex; align-items: center; gap: 9px; width: min(380px, 100%); min-height: 43px; padding: 0 11px; border: 1px solid #d9dce7; border-radius: 10px; background: #fff; color: #7d8597; }
.grid-search:focus-within { border-color: #7965e8; box-shadow: 0 0 0 3px rgba(121, 101, 232, .12); }
.grid-search input { flex: 1; min-width: 40px; border: 0; outline: 0; color: #344054; font-size: 13px; }
.search-icon { position: relative; width: 15px; height: 15px; flex: 0 0 15px; }
.search-icon::before { position: absolute; top: 1px; left: 1px; width: 8px; height: 8px; border: 1.7px solid #8992a3; border-radius: 50%; content: ""; }
.search-icon::after { position: absolute; top: 10px; left: 10px; width: 5px; height: 1.7px; border-radius: 2px; background: #8992a3; content: ""; transform: rotate(45deg); transform-origin: left center; }
.grid-result-note { margin: -8px 0 10px; color: #8992a3; font-size: 12px; }
.grid-no-results { padding: 22px; color: #8b93a3; text-align: center; }
.status-chip { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #f0edff; color: #6247c5; font-size: 11px; font-weight: 700; white-space: nowrap; }
.report-table-wrap { overflow: auto; border: 1px solid #edf0f5; border-radius: 11px; }
.report-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.report-table th, .report-table td { padding: 12px 14px; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: middle; }
.report-table th { position: sticky; top: 0; z-index: 1; background: #f8f9fc; color: #626c7e; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; }
.report-table td { color: #3c4657; font-size: 13px; }
.report-table tbody tr:last-child td { border-bottom: 0; }
.report-table tbody tr:hover { background: #fafaff; }
.report-table tbody tr[hidden] { display: none; }
.payment-settings-form .settings-panel { padding: 26px; border-radius: 16px; box-shadow: 0 8px 24px rgba(37, 41, 86, .055); }
.payment-settings-form .settings-panel h2 { padding-bottom: 13px; border-bottom: 1px solid #edf0f5; font-size: 20px; }
.payment-settings-form .settings-panel h3 { color: #253047; font-size: 16px; }
.payment-settings-form .settings-panel hr { height: 1px; margin: 24px 0; border: 0; background: #edf0f5; }
.payment-settings-form code { padding: 3px 6px; border-radius: 5px; background: #f3f0ff; color: #654cc4; }
.audit-count { padding: 7px 12px; border: 1px solid #e8e5fa; border-radius: 999px; background: #f7f5ff; color: #654cc4; font-size: 12px; font-weight: 700; }
.appointment-id { color: #6554c0; font-weight: 700; }
.audit-actor { color: #202a3b !important; font-weight: 600; }
.role-chip { display: inline-block; padding: 4px 8px; border-radius: 6px; background: #eff6ff; color: #3563a9; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-arrow { margin: 0 3px; color: #98a2b3; }
.table-subline { display: block; margin-top: 3px; color: #8b93a3; font-size: 11px; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.table-action-link { color: #6155c9; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.table-action-link:hover { color: #4539a5; text-decoration: underline; }
.table-action-button { padding: 5px 9px; border: 1px solid #e5e7eb; border-radius: 7px; background: #fff; color: #475467; font-size: 11px; font-weight: 700; cursor: pointer; }
.table-action-button:hover { border-color: #c5bdf5; color: #5c4bc5; }
.clinic-active-chip { background: #eafaf4; color: #078568; }
.clinic-paused-chip { background: #fff4e8; color: #b45309; }
.admin-create-form .settings-grid { margin-bottom: 12px; }
.admin-cta-link { display: inline-flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; }
.admin-cta-link:hover { color: #fff; text-decoration: none; }
.staff-list { display: grid; gap: 14px; }
.staff-edit-card { padding: 18px; border: 1px solid #eaecf3; border-radius: 13px; background: #fff; }
.staff-edit-heading, .staff-edit-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.staff-edit-heading { margin-bottom: 15px; }
.staff-edit-heading > div { min-width: 0; overflow-wrap: anywhere; }
.staff-edit-heading > .role-chip { flex-shrink: 0; }
.staff-edit-heading strong, .staff-edit-heading span { display: block; }
.staff-edit-heading strong { color: #273144; font-size: 14px; }
.staff-edit-heading div > span { margin-top: 2px; color: #7b8496; font-size: 12px; }
.staff-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 14px 18px; }
.staff-fields .filter-group { min-width: 0; }
.staff-fields + .settings-description { margin: 12px 0; }
.staff-create-actions { display: flex; justify-content: flex-end; }
.staff-edit-footer { flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid #eaecf3; }
.staff-edit-footer > button { margin-inline-start: auto; }
.staff-edit-footer .settings-checkbox { margin: 0; font-size: 12px; }
.settings-notice-error { border: 1px solid #fecdca; background: #fff4f3; color: #b42318; }
.billing-summary-grid .report-summary-card { min-height: 138px; }
.billing-breakdown { margin-bottom: 22px; }
.billing-total-row td { border-top: 2px solid #e6e8f2; color: #172033; font-weight: 800; }
.billing-total-row td:last-child { color: #4e45bf; font-size: 16px; }
.billing-email-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #edf0f5; }
.billing-email-actions p { margin: 0; color: #667085; font-size: 13px; }
.billing-email-actions form { margin: 0; }
.billing-email-actions button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 700px) { .billing-email-actions { align-items: stretch; flex-direction: column; } }

.settings-description {
    margin: 0 0 16px;
    color: #667085;
    font-size: 14px;
}

.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    color: #344054;
    font-weight: 600;
}

.settings-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 16px;
}

.settings-inline-form,
.settings-actions {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.settings-inline-form .filter-group {
    flex: 1;
}

.settings-actions {
    align-items: center;
}

.settings-actions .clear-button {
    margin-top: 0;
}

.settings-notice {
    margin-bottom: 20px;
    padding: 13px 16px;
    border-radius: 10px;
    font-weight: 600;
}

.settings-notice-success {
    border: 1px solid #abefc6;
    background: #ecfdf3;
    color: #067647;
}

@media (max-width: 700px) {
    .report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 16px;
    }
    .report-summary-grid .report-summary-card { min-height: 0; padding: 10px 12px; }
    .report-summary-card strong { margin-top: 3px; font-size: 21px; overflow-wrap: anywhere; }
    .revenue-heading { align-items: flex-start; flex-direction: column; }
    .grid-heading { align-items: stretch; flex-direction: column; }
    .grid-search { width: 100%; }
    .header-inner { min-height: 56px; gap: 8px; padding: 6px 12px; }
    .brand-logo { width: 82px; height: 41px; }
    .header-right { flex: 0 0 auto; gap: 8px; }
}

@media (max-width: 560px) {
    .payment-settings-header {
        align-items: flex-start;
        flex-direction: column-reverse;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-inline-form,
    .settings-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.header-date {
    color: #172033;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.navigation-bar,
.navigation-drawer {
    --navigation-background: #025752;
    color: #fff;
}

.navigation-container,
.navigation-drawer {
    background: var(--navigation-background);
}

.dashboard-footer-page > :is(.navigation-bar, .page-scroll) {
    scrollbar-gutter: stable both-edges;
}

.dashboard-footer-page > .navigation-bar {
    overflow: hidden;
}

.navigation-toggle {
    display: none;
}

.navigation-container {
    width: calc(min(100%, var(--dashboard-max-width)) - 2 * var(--dashboard-gutter));

    margin: 0 auto;

    padding: 0 10px;

    display: flex;
    align-items: center;

    flex-wrap: wrap;
    gap: 3px;
}

.nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;

    min-height: 50px;
    padding: 0 7px;
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 8px;

    color: #fff;
    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

}

.nav-link > span { min-width: 0; overflow-wrap: anywhere; }
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; }

.navigation-bar .nav-link:is(.active, :hover, :focus-visible, :active) {
    background: var(--action-background);
    color: #fff;
}

.nav-link.active::after {
    content: "";

    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;

    height: 3px;

    background: currentColor;
    border-radius: 3px 3px 0 0;
}

.nav-link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

.navigation-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    max-height: none;
    height: 100%;
    margin: 0;
    padding: 12px;
    border: 0;
    overflow: auto;
    overscroll-behavior: contain;
}
.navigation-drawer::backdrop { background: rgb(23 32 51 / 45%); }
.navigation-drawer-controls { display: flex; justify-content: flex-end; }
.navigation-close {
    display: grid;
    font-size: 24px;
    background: transparent;
    color: inherit;
}
.navigation-close:is(:hover, :focus-visible, :active) {
    background: var(--action-background);
    color: #fff;
}
.navigation-drawer .navigation-bar { margin-top: 8px; border: 0; }
.navigation-drawer .navigation-container {
    display: grid;
    width: 100%;
    padding: 0;
    background: transparent;
}
.navigation-drawer .nav-link { min-height: 44px; padding: 0 10px; white-space: normal; }
.navigation-drawer .nav-link.active::after {
    inset: 10px auto 10px 0;
    width: 3px;
    height: auto;
    border-radius: 0 3px 3px 0;
}

@media (max-width: 700px) {
    .has-navigation-drawer .navigation-toggle { display: grid; flex: 0 0 44px; }
    .has-navigation-drawer > .navigation-bar { display: none; }
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.container {
    width: 100%;
    max-width: var(--dashboard-max-width);

    margin: 0 auto;
    padding: 32px var(--dashboard-gutter) 50px;
}




/* =========================================================
   BACK LINK
   ========================================================= */

.back-link {
    display: inline-flex;
    align-items: center;

    margin-bottom: 20px;

    color: #2563eb;
    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition: color 0.2s ease;
}

.back-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}


/* =========================================================
   DOCTOR PROFILE CARD
   ========================================================= */

.doctor-card {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 26px 30px;

    margin-bottom: 28px;

    background: #ffffff;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    box-shadow:
        0 2px 5px rgba(16, 24, 40, 0.04),
        0 8px 24px rgba(16, 24, 40, 0.04);
}

.doctor-card::before {
    content: "";

    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;

    width: 4px;

    background: #2563eb;

    border-radius: 0 4px 4px 0;
}

.doctor-name {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 6px;

    font-size: 23px;
    font-weight: 700;

    color: #172033;
}


/* =========================================================
   STATUS
   ========================================================= */

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.status::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;
}

/* Confirmed appointments whose scheduled time has elapsed need a clear staff follow-up cue. */
.passed-slot-row { background: #fff8ed; }
.passed-slot-row td { border-top-color: #f4c98b; border-bottom-color: #f4c98b; }
.passed-slot-warning { display: inline-block; margin: 5px 0 0 6px; padding: 4px 8px; border-radius: 999px; background: #fff0d2; color: #995700; font-size: 10px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.token-time-label { color: #6247c5; font-weight: 700; }

.active {
    color: #067647;
    background: #ecfdf3;
}

.active::before {
    background: #12b76a;
}

.inactive {
    color: #b42318;
    background: #fef3f2;
}

.inactive::before {
    background: #f04438;
}

.confirmed {
    color: #067647;
    background: #ecfdf3;
}

.confirmed::before {
    background: #12b76a;
}

.arrived {
    color: #1d4ed8;
    background: #eff6ff;
}

.arrived::before {
    background: #2563eb;
}

.no_show {
    color: #b45309;
    background: #fffbeb;
}

.no_show::before {
    background: #f59e0b;
}

.completed {
    color: #15803d;
    background: #f0fdf4;
}

.completed::before {
    background: #16a34a;
}

.cancelled {
    color: #b42318;
    background: #fef3f2;
}

.cancelled::before {
    background: #f04438;
}

.unknown {
    color: #475467;
    background: #f2f4f7;
}

.unknown::before {
    background: #98a2b3;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.section {
    margin-bottom: 28px;

    background: #ffffff;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    overflow: hidden;

    box-shadow:
        0 2px 5px rgba(16, 24, 40, 0.03),
        0 8px 24px rgba(16, 24, 40, 0.035);
}

.section-header {
    min-height: 68px;

    padding: 18px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #ffffff;

    border-bottom: 1px solid #edf0f4;
}

.section-header h2 {
    margin: 0;

    font-size: 18px;
    font-weight: 700;

    color: #172033;
}

.schedule-manage-card,
.availability-intro,
.availability-day-card {
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .045);
}

.schedule-manage-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    margin: 0 0 28px;
}

.schedule-manage-card h2 { margin: 0 0 6px; color: #172033; font-size: 18px; }
.schedule-manage-card p { margin: 0; color: #667085; }
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 5px 12px rgba(37, 99, 235, .2);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.primary-button:hover { color: #fff; filter: brightness(1.06); }
.container.availability-page {
    --availability-padding: clamp(14px, 3vw, 24px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    max-width: 1100px;
    padding-top: 28px;
    padding-bottom: 40px;
}
.availability-page > .back-link { justify-self: start; margin: 0; }
.availability-intro { padding: var(--availability-padding); background: linear-gradient(120deg, #eff6ff, #f7f5ff); }
.availability-intro h1 { margin: 8px 0; color: #172033; font-size: 27px; }
.availability-intro p { margin: 0; color: #667085; }
.eyebrow { color: #4f46e5; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.availability-form { display: grid; gap: 14px; }
.availability-day-card { min-width: 0; padding: var(--availability-padding); }
.availability-day-card .availability-copy-monday {
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid #a5b4fc;
    border-radius: 10px;
    background: #eef2ff;
    color: #312e81;
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}
.availability-copy-monday input { flex-shrink: 0; margin: 0; accent-color: #4338ca; }
.availability-day-card .availability-copy-monday:hover,
.availability-day-card .availability-copy-monday:has(input:checked) {
    background: #e0e7ff;
    border-color: #818cf8;
}
.availability-copy-monday:focus-within { outline: 2px solid #4338ca; outline-offset: 2px; }
.availability-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.availability-toggle { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.availability-toggle input { position: absolute; inset-inline-start: 0; width: 38px; margin: 0; opacity: 0; }
.toggle-track { flex: 0 0 38px; width: 38px; height: 22px; border-radius: 99px; background: #d0d5dd; position: relative; transition: .15s ease; }
.toggle-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0002; transition: .15s ease; }
.availability-toggle input:checked + .toggle-track { background: #2563eb; }
.availability-toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.availability-day-name { color: #172033; font-weight: 750; font-size: 16px; }
.availability-day-state { color: #667085; font-size: 13px; }
.availability-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 12px 14px; }
.availability-fields > label:not(.availability-toggle) { display: grid; min-width: 0; gap: 7px; color: #475467; font-size: 13px; font-weight: 650; }
.availability-fields :is(input:not([type="checkbox"]):not([type="hidden"]), select) {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: 16px;
}
.availability-fields input::-webkit-date-and-time-value { text-align: left; }
.availability-evening { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e4e9f1; }
.availability-evening > .availability-toggle { grid-column: 1 / -1; justify-self: start; }
.availability-toggle input:focus-visible + .toggle-track { outline: 2px solid #2563eb; outline-offset: 3px; }
.field-optional { color: #98a2b3; font-weight: 400; }
.availability-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 2px; color: #667085; font-size: 13px; }
.availability-success { padding: 13px 16px; border-radius: 10px; color: #067647; background: #ecfdf3; border: 1px solid #abefc6; }
.availability-error { padding: 13px 16px; border-radius: 10px; color: #b42318; background: #fff1f0; border: 1px solid #fecdca; }
.availability-page .availability-input-error { border-color: #d92d20 !important; background-color: #fff6f5 !important; box-shadow: 0 0 0 3px rgba(217, 45, 32, .14) !important; }
.availability-date-panel { min-width: 0; padding: var(--availability-padding); border: 1px solid #e4e9f1; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(20, 34, 66, .06); }
.availability-date-panel h2 { margin: 8px 0; color: #172033; font-size: 20px; }
.availability-date-panel > p { color: #667085; }
.booking-window-form { grid-template-columns: minmax(0, 240px) max-content; }
.date-override-form > .primary-button { grid-column: 1 / -1; justify-self: end; }
.date-override-table { margin-top: 18px; }
.date-override-table form { margin: 0; }
@media (max-width: 760px) {
    .container.availability-page { gap: 14px; padding-top: 18px; padding-bottom: 28px; }
    .availability-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-manage-card, .availability-actions { align-items: stretch; flex-direction: column; }
    .availability-fields > .primary-button { grid-column: 1 / -1; justify-self: stretch; }
    .date-override-table .report-table { table-layout: fixed; }
    .date-override-table :is(th, td) { padding: 8px 5px; white-space: normal; overflow-wrap: anywhere; }
    .date-override-table .dashboard-actions > .clear-button { padding-inline: 5px; font-size: 12px; }
}
@media (max-width: 400px) {
    .availability-fields { grid-template-columns: minmax(0, 1fr); }
    .availability-intro h1 { font-size: 23px; }
}


/* =========================================================
   TABLE
   ========================================================= */

.table-container {
    width: 100%;

    background: #ffffff;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    overflow-x: auto;

    box-shadow:
        0 2px 5px rgba(16, 24, 40, 0.03),
        0 8px 24px rgba(16, 24, 40, 0.035);
}

.section .table-container {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 14px 20px;

    background: #f8fafc;

    border-bottom: 1px solid #e5eaf1;

    color: #667085;

    font-size: 11px;
    font-weight: 700;

    text-align: left;
    text-transform: uppercase;

    letter-spacing: 0.7px;

    white-space: nowrap;
}

tbody td {
    padding: 17px 20px;

    border-bottom: 1px solid #edf0f4;

    color: #344054;

    font-size: 14px;

    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #fafcff;
}


/* =========================================================
   SCHEDULE TABLE
   ========================================================= */

.section:first-of-type tbody td {
    font-size: 14px;
}

.section:first-of-type tbody td:first-child {
    font-weight: 600;
    color: #172033;
}

.section:first-of-type tbody td:nth-child(2),
.section:first-of-type tbody td:nth-child(3) {
    font-weight: 600;
    color: #344054;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty {
    padding: 44px 20px !important;

    text-align: center;

    color: #98a2b3 !important;

    font-size: 14px;
}


/* =========================================================
   FILTERS
   ========================================================= */

.filters {
    padding: 22px;

    margin-bottom: 24px;

    background: #ffffff;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    box-shadow:
        0 2px 5px rgba(16, 24, 40, 0.03),
        0 8px 24px rgba(16, 24, 40, 0.035);
}

.filters-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 14px;

    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-group label {
    color: #475467;

    font-size: 12px;
    font-weight: 600;
}

.filter-group input,
.filter-group select {
    width: 100%;

    min-height: 42px;

    padding: 9px 12px;

    background: #ffffff;

    border: 1px solid #d0d5dd;
    border-radius: 8px;

    color: #344054;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

.filter-button {
    min-height: 42px;

    padding: 0 20px;

    border: none;
    border-radius: 8px;

    background: #2563eb;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

.filter-button:hover {
    background: #1d4ed8;
}

.filter-button:active {
    transform: translateY(1px);
}

.clear-button {
    display: inline-block;

    margin-top: 12px;

    color: #667085;

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;
}

.clear-button:hover {
    color: #2563eb;
    text-decoration: underline;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.container.doctors-page { max-width: 960px; }
.doctors-page h2 {
    margin: 0 0 14px;
    color: #172033;
    font-size: 24px;
    line-height: 1.25;
}
.doctors-table { table-layout: fixed; }
.doctors-table .doctor-list-status { width: 20%; }
.doctors-table th.doctor-list-actions { width: 38%; }
.doctors-table td { vertical-align: middle; padding-top: 12px; padding-bottom: 12px; }
.doctors-table .visit-card-patient,
.doctors-table td[colspan] { white-space: normal; overflow-wrap: anywhere; }
.doctors-table .visit-card-patient { font-weight: 650; }
.doctors-table .dashboard-actions > a { white-space: normal; }

:is(.admin-page-heading, .panel-heading, .settings-inline-form, .dashboard-actions) > :is(.filter-button, .clear-button),
:is(.prescription-editor, .prescription-actions, .prescription-prints p, .prescription-table td) > :is(.filter-button, .clear-button),
:is(.admin-page-heading, .panel-heading) > .table-actions > :is(.filter-button, .clear-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0;
    padding: 7px 16px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
}

:is(.admin-page-heading, .panel-heading, .settings-inline-form, .dashboard-actions) > .clear-button,
:is(.prescription-editor, .prescription-actions, .prescription-prints p, .prescription-table td) > .clear-button,
:is(.admin-page-heading, .panel-heading) > .table-actions > .clear-button {
    border: 1px solid #dbe2ed;
    background: #fff;
    color: #344054;
    font-size: 14px;
    font-weight: 600;
}

:is(.admin-page-heading, .panel-heading, .settings-inline-form, .dashboard-actions) > .clear-button:hover,
:is(.prescription-editor, .prescription-actions, .prescription-prints p, .prescription-table td) > .clear-button:hover,
:is(.admin-page-heading, .panel-heading) > .table-actions > .clear-button:hover {
    border-color: #a9bde1;
    color: #2563eb;
}


/* =========================================================
   STATISTICS
   ========================================================= */

.stats {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 18px;

    margin-bottom: 26px;
}

.card {
    position: relative;

    padding: 22px;

    background: #ffffff;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    box-shadow:
        0 2px 5px rgba(16, 24, 40, 0.03),
        0 8px 24px rgba(16, 24, 40, 0.035);
}

.card-title {
    margin-bottom: 7px;

    color: #667085;

    font-size: 13px;
    font-weight: 500;
}

.card-value {
    color: #172033;

    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}


/* =========================================================
   DOCTOR SUMMARY
   ========================================================= */

.doctor-summary {
    margin-bottom: 28px;
}

.doctor-summary-title {
    margin-bottom: 15px;

    color: #172033;

    font-size: 18px;
    font-weight: 700;
}

.doctor-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(250px, 1fr));

    gap: 18px;
}

.doctor-summary-card {
    padding: 20px;

    background: #ffffff;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    box-shadow:
        0 2px 5px rgba(16, 24, 40, 0.03),
        0 8px 24px rgba(16, 24, 40, 0.035);
}

.doctor-summary-name {
    margin-bottom: 18px;

    color: #172033;

    font-size: 16px;
    font-weight: 700;
}

.doctor-summary-stats {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 10px;
}

.doctor-summary-stats div {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.doctor-summary-stats span {
    color: #98a2b3;

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;
}

.doctor-summary-stats strong {
    color: #172033;

    font-size: 20px;
    font-weight: 700;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.cancel-button {
    min-height: 32px;

    padding: 0 12px;

    border: none;
    border-radius: 7px;

    background: #dc2626;
    color: #ffffff;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

.cancel-button:hover {
    background: #b91c1c;
}

.cancel-button:active {
    transform: translateY(1px);
}

.no-action {
    color: #98a2b3;
}


/* =========================================================
   DOCTOR DETAIL
   ========================================================= */

.doctor-detail-meta {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #667085;

    font-size: 13px;
}


/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats {
        grid-template-columns: repeat(3, 1fr);
    }

    html {
        --dashboard-gutter: 20px;
    }

}


/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media (max-width: 700px) {

    html {
        --dashboard-gutter: 14px;
    }

    .dashboard-footer-page {
        --mobile-page-title-size: 18px;
        --mobile-page-title-line-height: 1.3;
    }

    .header {
        padding: 0;
    }

    .header h1 {
        font-size: var(--mobile-page-title-size);
        line-height: var(--mobile-page-title-line-height);
    }

    .dashboard-footer-page :is(.admin-page-heading h2, .availability-intro h1, .super-admin-mobile h2) {
        font-size: var(--mobile-page-title-size);
        line-height: var(--mobile-page-title-line-height);
        letter-spacing: normal;
        overflow-wrap: anywhere;
    }

    .admin-page-heading { margin: 0 0 16px; }
    .dashboard-footer-page :is(.admin-page-heading, .availability-intro) p {
        font-size: 14px;
        line-height: 1.5;
    }

    .header p { font-size: 11px; }
    .header-brand { gap: 6px; }
    .container {
        padding:
            22px
            var(--dashboard-gutter)
            40px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 16px;
    }
    .stats .card { padding: 10px; }
    .stats .card-title { font-size: 12px; overflow-wrap: anywhere; }
    .stats .card-value { font-size: 22px; }

    .doctor-card {
        align-items: flex-start;
        flex-direction: column;

        padding: 22px;
    }

    .doctor-name {
        font-size: 20px;
    }

    .section-header {
        padding: 16px 18px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    thead th,
    tbody td {
        padding-left: 14px;
        padding-right: 14px;
    }

}


/* =========================================================
   RESPONSIVE - SMALL MOBILE
   ========================================================= */

@media (max-width: 450px) {

    .header {
        display: block;
    }

    .header p {
        margin-top: 4px;
    }

    .doctor-summary-grid {
        grid-template-columns: 1fr;
    }

    .doctor-summary-stats {
        grid-template-columns: repeat(3, 1fr);
    }

}

/* ============================================================
   APPOINTMENT ACTION BUTTONS
   ============================================================ */

.appointment-actions {
    white-space: nowrap;
    vertical-align: middle;
}

/*
   The forms are DIRECT children of .appointment-actions.
   Therefore target .appointment-actions form,
   NOT .action-buttons form.
*/

.appointment-actions > form,
.appointment-action-group > form {
    display: inline-block !important;

    width: auto !important;
    min-width: 0 !important;

    margin: 0 4px 0 0 !important;
    padding: 0 !important;

    vertical-align: middle;
}


/* ============================================================
   ACTION BUTTONS
   ============================================================ */

.appointment-actions .action-button,
.appointment-actions .cancel-button,
.appointment-actions .visit-action-link {

    display: inline-flex !important;

    align-items: center;
    justify-content: center;

    width: auto !important;
    min-width: 78px;

    height: 36px;

    padding: 0 12px;

    border: none;
    border-radius: 6px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    box-sizing: border-box;
}

.appointment-actions .visit-action-link {
    border: 1px solid #dbe2ed;
    background: #fff;
    color: #344054;
    vertical-align: middle;
    text-align: center;
    text-decoration: none;
}

.appointment-actions .visit-action-link:hover {
    border-color: #a9bde1;
    color: #2563eb;
}

/* ============================================================
   ARRIVED
   ============================================================ */

.appointment-actions .arrived-button {
    background: #2563eb;
    color: #ffffff;
}

.appointment-actions .arrived-button:hover {
    background: #1d4ed8;
}


/* ============================================================
   NO SHOW
   ============================================================ */

.appointment-actions .no-show-button {
    background: #f59e0b;
    color: #ffffff;
}

.appointment-actions .no-show-button:hover {
    background: #d97706;
}


/* ============================================================
   CANCEL
   ============================================================ */

.appointment-actions .cancel-button {
    background: #dc2626;
    color: #ffffff;
}

.appointment-actions .cancel-button:hover {
    background: #b91c1c;
}


/* ============================================================
   COMPLETED
   ============================================================ */

.appointment-actions .completed-button {
    background: #16a34a;
    color: #ffffff;
}

.appointment-actions .completed-button:hover {
    background: #15803d;
}

.appointment-action-group { display: contents; }

@media (min-width: 701px) {
    .appointments-table { table-layout: fixed; }
    .appointments-table :is(th, td) {
        padding: 12px clamp(6px, .8vw, 12px);
        white-space: normal;
    }
    .appointments-table th { overflow-wrap: anywhere; }
    .appointments-table td { overflow-wrap: break-word; }
    .appointments-table .walk-in-label { white-space: nowrap; }
    .appointments-table th:nth-child(1) { width: 5%; }
    .appointments-table th:nth-child(2) { width: 15%; }
    .appointments-table th:nth-child(3) { width: 60px; white-space: nowrap; }
    .appointments-table th:nth-child(4) { width: 10%; }
    .appointments-table th:nth-child(6) { width: 11%; }
    .appointments-table th.appointment-attendance { width: 120px; }
    .appointments-table .appointment-attendance { white-space: nowrap; }
    .appointments-table th:nth-child(8) { width: 9%; }
    .appointments-table th:last-child { width: 26%; }
    .appointments-table .status { gap: 4px; padding: 4px 7px; max-width: 100%; }
    .appointments-table .status::before { flex: 0 0 6px; }
    .appointments-table .passed-slot-warning { max-width: 100%; margin-inline-start: 0; white-space: normal; }
    .appointment-action-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .appointment-action-group > form { margin: 0 !important; }
    .appointment-action-group :is(.action-button, .cancel-button, .visit-action-link) {
        width: 100% !important;
        min-width: 0;
        padding-inline: 5px;
        font-size: 12px;
        white-space: normal;
    }
}

@media (min-width: 1180px) {
    .appointments-table th:first-child { width: 7%; }
    .appointments-table th:last-child { width: 22%; }
    .appointment-action-group { display: flex; flex-wrap: wrap; align-items: center; }
    .appointment-action-group :is(.action-button, .cancel-button, .visit-action-link) {
        width: auto !important;
        padding-inline: 8px;
        white-space: nowrap;
    }
}

@media (701px <= width < 1180px) {
    .appointments-table th:first-child { width: 64px; }
    .appointments-table th:nth-child(2) { width: 13%; }
    .appointments-table th:nth-child(3) { width: 53px; }
    .appointments-table th:last-child { width: 20%; }
}

@media (701px <= width <= 900px) {
    .appointments-table .status { padding-inline: 4px; font-size: 11px; }
    .appointments-table .status::before { display: none; }
}

/* Admin report, audit and settings surfaces */
.filters.admin-panel {
    padding: 24px;
    border: 1px solid #e6e8f2;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(37, 41, 86, .055);
}

@media (max-width: 700px) {
    .filters.admin-panel { padding: 18px; }
    .report-date-form { align-items: stretch; flex-direction: column; }
    .report-date-form .filter-group { min-width: 0; }

    .admin-page-heading, .panel-heading, .settings-inline-form {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    :is(.admin-page-heading, .panel-heading) > .table-actions {
        align-items: stretch;
        gap: 8px;
    }

    :is(.admin-page-heading, .panel-heading) > .table-actions > :is(.filter-button, .clear-button) {
        flex: 1 1 125px;
        min-height: 44px;
    }

    .dashboard-actions > :is(.filter-button, .clear-button) {
        flex: 1 1 125px;
        min-height: 44px;
    }

    :is(.admin-page-heading, .panel-heading, .settings-inline-form) > :is(.filter-button, .clear-button) {
        min-height: 44px;
    }

    .filters-grid, .settings-grid, .staff-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-grid.clinic-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .clinic-details-grid > .clinic-details-wide { grid-column: 1 / -1; }

    .filter-group { min-width: 0; }
    .filter-group :is(input, select, textarea) { max-width: 100%; min-width: 0; }

    .staff-edit-card { padding: 14px; }
    .staff-edit-footer { align-items: stretch; flex-direction: column; gap: 12px; }
    :is(.staff-create-actions, .staff-edit-footer) > button { width: 100%; min-height: 44px; }

    .mobile-table {
        display: block;
        position: relative;
        background: transparent;
    }

    .mobile-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .mobile-table tbody { display: block; }

    .mobile-table tbody tr:not([hidden]) {
        display: block;
        margin: 8px;
        border: 1px solid #e5eaf1;
        border-radius: 10px;
        background: #fff;
    }

    .mobile-table tbody td {
        display: block;
        padding: 9px 10px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .mobile-table tbody td[data-column-label] {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
        border-bottom: 1px solid #edf0f4;
    }

    .mobile-table tbody td[data-column-label]::before {
        content: attr(data-column-label);
        content: attr(data-column-label) / "";
        color: #526078;
        font-size: 11px;
        font-weight: 700;
    }

    .mobile-table tbody td[data-column-label]:last-child { border-bottom: 0; }
    .mobile-table tbody td.appointment-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .mobile-table .appointment-actions::before { flex-basis: 100%; }
    .mobile-table .appointment-actions :is(.action-button, .cancel-button, .visit-action-link) {
        min-height: 44px;
        white-space: normal;
    }
    .mobile-table .table-action-link { white-space: normal; }

    .table-container:has(> .visit-card-table.mobile-table) {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .visit-card-table.mobile-table tbody tr:not([hidden]) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        column-gap: 14px;
        margin: 0 0 12px;
        padding: 12px;
        border-radius: 12px;
    }

    .visit-card-table.mobile-table tbody td {
        min-width: 0;
        padding: 5px 0;
        border: 0;
    }

    .visit-card-table.mobile-table tbody td[data-column-label] {
        gap: 1px;
        border: 0;
    }

    .visit-card-table.mobile-table tbody td:is(.visit-card-patient, .visit-card-status)::before,
    .visit-card-table.mobile-table tbody td.appointment-actions::before {
        display: none;
    }

    .visit-card-patient {
        grid-row: 1;
        grid-column: 1;
        color: #172033;
        font-weight: 700;
    }

    .visit-card-status {
        grid-row: 1;
        grid-column: 2;
        justify-items: end;
        text-align: right;
    }

    .visit-card-status .status,
    .visit-card-status .passed-slot-warning {
        white-space: normal;
        max-width: 100%;
    }

    .visit-card-status .passed-slot-warning { margin-left: 0; }

    .visit-card-time { grid-row: 2; grid-column: 1; }

    .visit-card-table.mobile-table tbody td.visit-card-empty { display: none; }

    .visit-card-table.mobile-table tbody td:is(.appointment-actions, [colspan]) {
        grid-column: 1 / -1;
    }

    .doctors-table.mobile-table tbody td.doctor-list-actions {
        grid-column: 1 / -1;
        margin-top: 6px;
        padding-top: 10px;
        border-top: 1px solid #edf0f4;
    }

    .doctors-page h2 { font-size: 21px; }

    .doctors-table.mobile-table td.doctor-list-actions::before { display: none; }

    .doctors-table .dashboard-actions > :is(.filter-button, .clear-button) {
        flex-basis: 0;
        min-width: max-content;
    }

    .visit-card-table.mobile-table tbody td.appointment-actions {
        padding-top: 10px;
        margin-top: 6px;
        border-top: 1px solid #edf0f4;
    }

    .visit-card-table :is(.appointment-actions, .appointment-action-group) > :is(form, .visit-action-link) {
        flex: 1 1 calc(50% - 8px);
        margin: 0 !important;
    }

    .visit-card-table :is(.appointment-actions, .appointment-action-group) > form > :is(.action-button, .cancel-button) {
        width: 100% !important;
    }

}

/* Dr.Clock sign-in */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    background:
        radial-gradient(ellipse at 12% 15%, rgba(244, 114, 182, .13), transparent 34%),
        radial-gradient(ellipse at 90% 82%, rgba(99, 102, 241, .14), transparent 36%),
        #f5f6ff;
}
.login-shell { width: min(100%, 440px); }
.login-card {
    padding: 38px 40px 30px;
    border: 1px solid rgba(226, 228, 240, .9);
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 22px 65px rgba(33, 39, 86, .12), 0 3px 10px rgba(33, 39, 86, .04);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 20px; }
.login-brand img { display: block; width: 272px; max-width: 100%; height: 136px; object-fit: contain; }
.login-eyebrow { color: #7457d8; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.login-card h1 { margin: 0; color: #182033; text-align: center; font-size: 29px; font-weight: 750; letter-spacing: -.8px; }
.login-subtitle { margin: 8px 0 26px; color: #798195; text-align: center; font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field label { color: #344054; font-size: 13px; font-weight: 650; }
.login-field input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #dfe2eb; border-radius: 10px; outline: none; background: #fff; color: #182033; font-size: 14px; transition: border-color .18s, box-shadow .18s; }
.login-field input::placeholder { color: #a1a8b7; }
.login-field input:focus { border-color: #7862e8; box-shadow: 0 0 0 4px rgba(120, 98, 232, .12); }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 49px; margin-top: 4px; border: 0; border-radius: 10px; background: linear-gradient(110deg, #5f54d9, #8b5cf6); box-shadow: 0 8px 18px rgba(106, 85, 220, .23); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .16s, box-shadow .16s; }
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(106, 85, 220, .3); }
.login-submit span { font-size: 19px; line-height: 1; }
.login-error { margin: 0 0 18px; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; background: #fff4f3; color: #b42318; font-size: 13px; }
.login-copyright { margin: 16px 0 0; color: #8b91a1; text-align: center; font-size: 11px; }
@media (max-width: 480px) { .login-card { padding: 30px 24px 25px; border-radius: 18px; } .login-brand img { width: 232px; height: 116px; } }

.settings-toggle{display:flex;align-items:center;gap:10px;margin:14px 0 18px;color:#34425b;font-size:14px;font-weight:600}
.settings-toggle input{width:17px;height:17px;accent-color:#5548e8}

.consultation-form { display: grid; gap: 16px; }
.consultation-form .settings-panel,
.consultation-history { margin-bottom: 0; }
.consultation-form .filter-group + .filter-group { margin-top: 0; }
.consultation-form #notes { width: 100%; resize: vertical; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.consultation-form label[for="correction_reason"] { margin-top: 12px; }
.consultation-history details { margin-top: 8px; border-top: 1px solid #e7eaf1; padding-top: 8px; }
.consultation-history summary { cursor: pointer; font-weight: 600; }
.clinical-history-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.prescription-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e4e9f2;
    border-radius: 12px;
    background: #f8faff;
}
.prescription-editor[hidden] { display: none; }
.medicine-details, #medicine-feedback { grid-column: 1 / -1; }
#medicine-feedback { margin: 0; }
#medicine-feedback:empty { display: none; }
.prescription-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.medicine-details .prescription-actions { margin-top: 12px; }
.prescription-table input {
    width: 100%;
    min-width: 6ch;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #172033;
    font: inherit;
}
.prescription-table td:first-child input,
.prescription-table td:nth-child(6) input { min-width: 16ch; }
.prescription-table td { vertical-align: middle; }
.consultation-page button.clear-button { cursor: pointer; }
.prescription-prints { margin-top: 14px; }
.prescription-prints p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

@media (max-width: 700px) {
    .prescription-editor { grid-template-columns: minmax(0, 1fr); }
    .prescription-editor > button { justify-self: start; }
    .prescription-actions > button { flex: 1 1 140px; }
    .consultation-page :is(.filter-button, .clear-button) { min-height: 44px; }
    .prescription-table .report-table,
    .prescription-table tbody { display: block; }
    .prescription-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .prescription-table tr { display: grid; gap: 6px; padding: 12px; }
    .prescription-table tr + tr { border-top: 1px solid #e4e9f2; }
    .prescription-table td { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 2fr); align-items: center; padding: 0; border: 0; }
    .prescription-table td[data-label]::before { content: attr(data-label); font-weight: 600; }
    .prescription-table td:last-child { display: flex; justify-content: flex-end; }
    .prescription-table td input { min-width: 0; }
}

.family-visit-panel[hidden] { display: none !important; }

.family-visit-details {
    display: grid;
    gap: 10px;
    width: 100%;
}

.family-visit-member {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr);
    gap: 12px 24px;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.family-visit-member-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    overflow-wrap: anywhere;
}

.family-visit-member-heading strong { flex-basis: 100%; }
.family-visit-member-heading :is(span, small) { color: #475569; }
.family-payment-summary { display: block; }

.family-visit-member .appointment-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.family-visit-member .appointment-action-group > form { margin: 0; }

@media (max-width: 760px) {
    .family-visit-member { grid-template-columns: minmax(0, 1fr); }
}
.family-visit-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 4px;
}

.family-visit-toolbar > form { margin: 0; }

/* Dashboard actions and clinic booking settings */
:is(.dashboard-footer-page, .login-page) :is(
    button:not(.navigation-toggle, .navigation-close),
    .filter-button, .clear-button, .primary-button, .print-button
),
:is(.dashboard-footer-page, .login-page) :is(
    button:not(.navigation-toggle, .navigation-close),
    .filter-button, .clear-button, .primary-button, .print-button
):is(:hover, :focus-visible) {
    background: var(--action-background);
    border-color: transparent;
    color: #fff;
}

.clinic-booking-qr,
.clinic-settings-footer {
    display: grid;
    justify-items: start;
    gap: 12px;
    margin-top: 18px;
}

.clinic-booking-qr img {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    padding: 10px;
}

.clinic-settings-footer {
    border-top: 1px solid #e5eaf2;
    padding-top: 16px;
}

.clinic-settings-footer .settings-description { margin: 0; }
.clinic-booking-qr .filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
