:root {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #cffafe;
    --secondary: #f97316;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --overlay: rgba(0, 0, 0, 0.5);
    --border-faint: rgba(0, 0, 0, 0.05);
    --stat-orange-bg: #ffedd5;
    --stat-green-bg: #d1fae5;
    --stat-red-bg: #fee2e2;
    --status-confirmed-bg: #d1fae5;
    --status-confirmed-fg: #065f46;
    --status-pending-bg: #fef3c7;
    --status-pending-fg: #92400e;
    --status-cancelled-bg: #fee2e2;
    --status-cancelled-fg: #991b1b;
    --status-finished-bg: rgba(46, 213, 115, 0.1);
    --age-child-bg: #e0f2fe;
    --age-child-fg: #0369a1;
    --age-adult-bg: #dcfce7;
    --age-adult-fg: #15803d;
    --age-elderly-bg: #fdf2f8;
    --age-elderly-fg: #be185d;
    --cancelled-item-bg: #fff5f5;
    --payment-tag-bg: rgba(0, 0, 0, 0.05);
    --btn-danger-hover-bg: #fff5f5;
    --btn-revert-bg: #fff3e0;
    --btn-revert-fg: #e65100;
    --btn-revert-border: #ffb74d;
    --banner-warn-bg: #fff7ed;
    --banner-warn-border: #fdba74;
    --banner-warn-text: #9a3412;
    --banner-warn-link: #c2410c;
    --banner-warn-icon: #ea580c;
    --banner-code-bg: rgba(0, 0, 0, 0.06);
    --toast-success: #2ed573;
    --toast-error: #ff4757;
    --input-bg: #ffffff;

    /* Mobile specific variables */
    --header-height: 64px;
    --mobile-padding: 1rem;

    color-scheme: light;
}

[data-theme="dark"] {
    --primary: #22d3ee;
    --primary-dark: #0891b2;
    --primary-light: rgba(34, 211, 238, 0.14);
    --secondary: #fb923c;
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.35), 0 2px 4px -2px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.45), 0 8px 10px -6px rgb(0 0 0 / 0.35);
    --overlay: rgba(0, 0, 0, 0.65);
    --border-faint: rgba(255, 255, 255, 0.06);
    --stat-orange-bg: rgba(251, 146, 60, 0.18);
    --stat-green-bg: rgba(52, 211, 153, 0.18);
    --stat-red-bg: rgba(248, 113, 113, 0.18);
    --status-confirmed-bg: rgba(52, 211, 153, 0.18);
    --status-confirmed-fg: #6ee7b7;
    --status-pending-bg: rgba(251, 191, 36, 0.18);
    --status-pending-fg: #fcd34d;
    --status-cancelled-bg: rgba(248, 113, 113, 0.18);
    --status-cancelled-fg: #fca5a5;
    --status-finished-bg: rgba(52, 211, 153, 0.18);
    --age-child-bg: rgba(56, 189, 248, 0.18);
    --age-child-fg: #7dd3fc;
    --age-adult-bg: rgba(52, 211, 153, 0.18);
    --age-adult-fg: #6ee7b7;
    --age-elderly-bg: rgba(244, 114, 182, 0.18);
    --age-elderly-fg: #f9a8d4;
    --cancelled-item-bg: rgba(248, 113, 113, 0.08);
    --payment-tag-bg: rgba(255, 255, 255, 0.08);
    --btn-danger-hover-bg: rgba(248, 113, 113, 0.12);
    --btn-revert-bg: rgba(251, 146, 60, 0.15);
    --btn-revert-fg: #fdba74;
    --btn-revert-border: rgba(251, 146, 60, 0.45);
    --banner-warn-bg: rgba(251, 146, 60, 0.12);
    --banner-warn-border: rgba(251, 146, 60, 0.35);
    --banner-warn-text: #fdba74;
    --banner-warn-link: #fb923c;
    --banner-warn-icon: #fb923c;
    --banner-code-bg: rgba(255, 255, 255, 0.08);
    --input-bg: #0f172a;

    color-scheme: dark;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    width: 280px;
    z-index: 100;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
}

.logo i {
    font-size: 2rem;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link i {
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    grid-column: 2;
    padding: 2rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-light);
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(8, 145, 178, 0.39);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.23);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger-outline:hover {
    background: var(--btn-danger-hover-bg);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.orange {
    background: var(--stat-orange-bg);
    color: var(--secondary);
}

.stat-icon.green {
    background: var(--stat-green-bg);
    color: var(--success);
}

.stat-icon.red {
    background: var(--stat-red-bg);
    color: var(--danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Calendar Section */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
}

.calendar-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.875rem;
    padding: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: var(--surface);
    min-height: 100px;
}

@media (max-width: 768px) {
    .calendar-container {
        padding: 0.75rem;
        overflow-x: hidden;
    }

    .calendar-grid {
        min-width: 0;
        width: 100%;
        gap: 0.35rem;
    }

    .calendar-day {
        min-height: 56px;
        padding: 0.35rem;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .calendar-day-header {
        font-size: 0.65rem;
        padding: 0.35rem 0;
    }

    .calendar-title {
        min-width: auto;
        font-size: 1.1rem;
    }
}

.calendar-day:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.calendar-day.other-month {
    color: var(--text-light);
    background: var(--bg);
}

.calendar-day.today {
    border-color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.day-number {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.day-appointments {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.appointment-dot {
    height: 4px;
    border-radius: 2px;
    margin: 1px 0;
}

.appointment-dot.confirmed {
    background: var(--success);
}

.appointment-dot.pending {
    background: var(--warning);
}

.appointment-dot.cancelled {
    background: var(--danger);
}

/* Side Panel */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.appointment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.appointment-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

@media (max-width: 600px) {
    .appointment-item {
        padding: 1rem;
        gap: 0.75rem;
        flex-direction: column;
        align-items: stretch !important;
    }

    .appointment-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px solid var(--border-faint);
        padding-top: 0.75rem;
        margin-top: 0.25rem;
    }

    .appointment-time {
        min-width: 50px;
    }

    .time-start {
        font-size: 0.9rem;
    }

    .time-end {
        font-size: 0.7rem;
    }

    .patient-name {
        font-size: 0.95rem;
    }

    .appointment-type {
        font-size: 0.8rem;
    }

    .status-badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }
}

.appointment-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.time-start {
    font-weight: 700;
    color: var(--primary);
}

.time-end {
    font-size: 0.75rem;
    color: var(--text-light);
}

.appointment-details {
    flex: 1;
}

.patient-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.appointment-type {
    font-size: 0.875rem;
    color: var(--text-light);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-confirmed {
    background: var(--status-confirmed-bg);
    color: var(--status-confirmed-fg);
}

.status-pending {
    background: var(--status-pending-bg);
    color: var(--status-pending-fg);
}

.status-cancelled {
    background: var(--status-cancelled-bg);
    color: var(--status-cancelled-fg);
}

/* Cancelled appointment item */
/* Age Badges */
.age-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 4px;
}

.age-child {
    background: var(--age-child-bg);
    color: var(--age-child-fg);
}

.age-adult {
    background: var(--age-adult-bg);
    color: var(--age-adult-fg);
}

.age-elderly {
    background: var(--age-elderly-bg);
    color: var(--age-elderly-fg);
}

.cancelled-item {
    opacity: 0.65;
    background: var(--cancelled-item-bg) !important;
    border-left-color: var(--danger) !important;
}

.cancelled-item .patient-name {
    text-decoration: line-through;
    color: var(--text-light);
}

.cancelled-item .appointment-type {
    text-decoration: line-through;
}

/* Appointment Actions & Buttons */
.appointment-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border-faint);
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.btn-appt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 100px;
    font-family: inherit;
}

.btn-appt:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-appt-finish {
    background: var(--success);
    color: #fff;
}

.btn-appt-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-appt-cancel:hover {
    background: var(--danger);
    color: #fff;
}

.btn-appt-icon {
    min-width: 40px;
    padding: 8px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: var(--bg);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
}

/* Responsive */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        display: block;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: all 0.3s ease;
        box-shadow: var(--shadow-lg);
        display: flex;
        /* Override display:none if any */
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--overlay);
        backdrop-filter: blur(4px);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        display: block;
        grid-column: 1;
        margin-left: 0;
        padding: calc(var(--header-height) + 0.75rem) var(--mobile-padding) 2rem;
        padding-left: max(var(--mobile-padding), env(safe-area-inset-left, 0px));
        padding-right: max(var(--mobile-padding), env(safe-area-inset-right, 0px));
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .section,
    .section-card,
    .search-box,
    .patient-list,
    .content-grid,
    .calendar-container,
    .side-panel,
    .stats-grid,
    .stat-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .content-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .page-title h1 {
        font-size: 1.45rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .page-title p {
        font-size: 0.9rem;
        overflow-wrap: anywhere;
    }

    .header .page-title {
        padding-right: 3rem;
        max-width: 100%;
    }

    .calendar-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .calendar-nav {
        justify-content: space-between;
        width: 100%;
    }

    .calendar-header .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        width: 100%;
    }

    .section-header .page-title {
        padding-right: 3rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
        margin: 1rem;
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .form-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header .btn {
        width: 100%;
        justify-content: center;
    }

    .reports-grid-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
}

.reports-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.5s ease forwards;
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.time-slot {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    background: var(--surface);
    color: var(--text);
    transition: all 0.2s ease;
}

.time-slot:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.time-slot.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}

.time-slot.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg);
}

/* Search */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
    display: block;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--bg);
    transition: all 0.2s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Patient List */
.patient-list {
    max-height: 500px;
    overflow-y: auto;
}

.patient-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.35rem;
    border-radius: 8px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    flex-wrap: nowrap;
}

.patient-item:last-child {
    border-bottom: none;
}

.patient-item:hover {
    background: var(--primary-light);
}

.patient-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.patient-name-text {
    font-weight: 600;
    color: var(--text);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 42%;
}

.patient-phone-text {
    color: var(--text-light);
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.patient-meta-dot {
    color: var(--text-light);
    font-size: 0.75rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.patient-age-inline {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    flex-shrink: 0;
}

.patient-main .age-badge {
    flex-shrink: 0;
    padding: 0.1rem 0.35rem;
    font-size: 0.62rem;
}

.patient-actions {
    display: flex;
    gap: 0.35rem;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.patient-actions--compact .btn-icon {
    min-height: 34px;
    width: 34px;
    padding: 0;
    justify-content: center;
    font-size: 0.85rem;
}

.patient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.patient-avatar--sm {
    width: 30px;
    height: 30px;
    font-size: 0.72rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 2000;
    border-left: 4px solid var(--success);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(46, 213, 115, 0.15);
    color: var(--toast-success);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.toast--error,
.toast.toast--cancelled {
    border-left-color: var(--toast-error);
}

.toast.toast--error .toast-icon,
.toast.toast--cancelled .toast-icon {
    background: rgba(255, 71, 87, 0.15);
    color: var(--toast-error);
}

/* Utilitários */
.hidden {
    display: none !important;
}

.section.hidden {
    display: none;
}

#reports-section {
    width: 100%;
}

.user-logout {
    border: 0;
    background: transparent;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-light);
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border: none;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-title--spaced {
    margin-bottom: 1.5rem;
}

.report-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.report-row__group {
    display: flex;
    flex-direction: column;
}

.report-row__label {
    font-weight: 500;
}

.report-row__meta {
    color: var(--text-light);
    font-size: 0.75rem;
}

.report-row__value {
    font-weight: 700;
}

.report-row__value--success {
    color: var(--success);
}

.report-row__value--primary {
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state-hint {
    font-size: 0.9rem !important;
    color: var(--warning) !important;
    max-width: 280px;
    margin: 0 auto 1rem !important;
}

.empty-state-cta {
    margin-top: 1rem;
    width: 100%;
    max-width: 320px;
    justify-content: center;
}

.appointment-item--stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
}

.appointment-item__row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.status-badge--inline {
    margin-right: auto;
    padding: 4px 12px;
    font-size: 0.75rem;
}

.status-finished {
    background: var(--status-finished-bg);
    color: var(--success);
}

.payment-tag {
    background: var(--payment-tag-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 4px;
}

.appointment-value {
    color: var(--success);
    font-weight: 700;
}

.btn-appt-edit {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    min-width: 80px;
}

.btn-appt-revert {
    background: var(--btn-revert-bg);
    color: var(--btn-revert-fg);
    border: 1px solid var(--btn-revert-border);
    min-width: 90px;
}

.age-badge--inline {
    margin-left: 8px;
    vertical-align: middle;
    display: inline-block !important;
}

.gender-icon {
    margin-left: 5px;
    font-size: 0.9em;
}

.patient-avatar--male {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.patient-avatar--female {
    background: rgba(255, 107, 129, 0.1);
    color: #ff6b81;
}

.patient-list {
    width: 100%;
}

.search-box--compact {
    margin-bottom: 0.5rem;
}

.search-input--with-icon {
    padding-left: 2.5rem;
    width: 100%;
}

.age-preview {
    margin-left: 8px;
    font-weight: 700;
}

.age-preview.age-child { color: #0369a1; }
.age-preview.age-adult { color: #15803d; }
.age-preview.age-elderly { color: #be185d; }

.gender-options {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--text);
}

.gender-option input[type="radio"] {
    accent-color: #3498db;
}

.gender-option--female input[type="radio"] {
    accent-color: #ff6b81;
}

.modal-footer--split {
    gap: 12px;
}

.modal-footer--split .btn {
    flex: 1;
}

.modal--sm { max-width: 420px; }
.modal--xs { max-width: 400px; }

.modal-header--danger {
    background: linear-gradient(135deg, #ff4757, #c0392b);
    border-radius: 16px 16px 0 0;
}

.modal-header--danger .modal-title {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header--danger .modal-close {
    color: #fff;
}

.modal-header--danger .modal-close {
    opacity: 0.8;
}

.modal-body--center {
    text-align: center;
    padding: 2rem 1.5rem;
}

.cancel-icon-wrap {
    width: 70px;
    height: 70px;
    background: rgba(255, 71, 87, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
}

.cancel-icon-wrap i {
    font-size: 2rem;
    color: #ff4757;
}

.cancel-text {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.cancel-patient-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.cancel-detail {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.cancel-detail i {
    margin-right: 5px;
    color: #ff4757;
}

.cancel-warning {
    margin-top: 1.2rem;
    font-size: 0.82rem;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.08);
    padding: 10px 14px;
    border-radius: 8px;
}

.btn-danger-fill {
    background: linear-gradient(135deg, #ff4757, #c0392b);
    color: #fff;
    border: none;
}

.btn-delete {
    color: var(--danger);
    border: 1px solid var(--danger);
    background: transparent;
}

.modal-footer .btn-cancel-left {
    margin-right: auto;
}

/* Alternância Mês / Semana */
.view-toggle .btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
    min-height: 420px;
}

.week-day {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 380px;
    overflow: hidden;
}

.week-day.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.week-day-header {
    padding: 0.65rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.week-day-name {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

.week-day-number {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.15rem;
}

.week-day.today .week-day-number {
    color: var(--primary);
}

.week-day-slots {
    flex: 1;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
}

.week-slot {
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    background: var(--bg);
    cursor: pointer;
    transition: transform 0.15s ease;
    font-size: 0.78rem;
}

.week-slot:hover {
    transform: translateX(2px);
    background: var(--primary-light);
}

.week-slot-time {
    display: block;
    font-weight: 700;
    color: var(--primary);
}

.week-slot-name {
    display: block;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-slot.status-finished {
    border-left-color: var(--success);
    opacity: 0.85;
}

.week-slot.status-cancelled {
    border-left-color: var(--danger);
    opacity: 0.6;
}

.week-slot--empty {
    margin-top: auto;
    margin-bottom: auto;
    text-align: center;
    color: var(--text-light);
    border-left-color: var(--border);
    font-weight: 500;
}

@media (max-width: 1200px) {
    .week-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .week-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .week-day {
        min-height: 200px;
    }
}

/* Múltiplas datas no agendamento */
.form-hint {
    font-weight: 400;
    color: var(--text-light);
    margin-left: 0.35rem;
}

.date-multi-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.date-multi-row .form-input {
    flex: 1;
}

.date-multi-row .btn {
    white-space: nowrap;
}

.date-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    min-height: 2rem;
}

.date-chips-empty {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem 0.35rem 0.65rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-chip--active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.date-chip-time {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .date-chip-time {
    background: rgba(0, 0, 0, 0.22);
}

.date-chip-remove {
    border: none;
    background: var(--payment-tag-bg);
    color: inherit;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.date-chip-remove:hover {
    background: var(--danger);
    color: #fff;
}

.modal--lg {
    max-width: 680px;
}

.modal-picker {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    background: var(--bg);
}

.modal-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.modal-picker-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.modal-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.modal-picker-day-header {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-light);
    padding: 0.25rem 0;
}

.modal-picker-day {
    aspect-ratio: 1;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-picker-day:hover:not(:disabled):not(.modal-picker-day--pad) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.modal-picker-day.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.modal-picker-day.today:not(.selected) {
    border-color: var(--primary);
    color: var(--primary);
}

.modal-picker-day.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.modal-picker-day--pad {
    border: none;
    background: transparent;
    cursor: default;
}

.modal-picker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
}

.selected-dates-count {
    margin: 0.65rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.date-count-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-light);
}

.date-count-input {
    width: 4.5rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.date-times-section.hidden {
    display: none;
}

.date-times-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.date-times-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.form-select--compact {
    min-width: 11rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.date-time-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.date-time-row {
    display: grid;
    grid-template-columns: 1fr minmax(7rem, 9rem);
    gap: 0.65rem;
    align-items: center;
    padding: 0.5rem 0.65rem;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.date-time-row__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.date-time-row__select {
    min-height: 2.5rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .date-time-row {
        grid-template-columns: 1fr;
    }

    .date-times-bulk {
        width: 100%;
    }

    .form-select--compact {
        flex: 1;
        min-width: 0;
    }

    .date-count-quick {
        flex-direction: column;
        align-items: stretch;
    }

    .date-count-input {
        width: 100%;
    }
}

.api-offline-banner {
    position: sticky;
    top: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--banner-warn-bg);
    border-bottom: 1px solid var(--banner-warn-border);
    color: var(--banner-warn-text);
    font-size: 0.85rem;
    line-height: 1.4;
}

.api-offline-banner a {
    color: var(--banner-warn-link);
    font-weight: 700;
}

/* Mobile: sem zoom indesejado + botões grandes */
@media (max-width: 768px) {
    html,
    body {
        touch-action: manipulation;
        overflow-x: hidden;
    }

    .form-input,
    .form-select,
    .form-textarea,
    .search-input,
    select.form-select {
        font-size: 16px;
        min-height: 48px;
    }

    .btn {
        min-height: 52px;
        font-size: 1.05rem;
        padding: 0.9rem 1.35rem;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions.view-toggle {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 0.75rem;
    }

    .header-actions.view-toggle .btn-primary {
        grid-column: 1 / -1;
        min-height: 54px;
        font-size: 1.08rem;
        padding: 0.95rem 1.25rem;
    }

    .header-actions.view-toggle .btn-secondary {
        min-height: 52px;
        font-size: 1rem;
        justify-content: center;
        width: 100%;
    }

    .header .btn {
        min-height: 52px;
    }

    .section-header .btn-primary {
        width: 100%;
        min-height: 54px;
        font-size: 1.08rem;
        justify-content: center;
        box-sizing: border-box;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .empty-state-cta {
        max-width: none;
        min-height: 54px;
        font-size: 1.05rem;
    }

    .section-card {
        padding: 1rem;
    }

    .calendar-nav .nav-btn {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        font-size: 1.1rem;
    }

    .calendar-nav .btn-secondary {
        min-height: 52px;
        padding: 0.75rem 1.15rem;
        font-size: 1rem;
    }

    .filter-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .filter-btn {
        min-height: 52px;
        padding: 0.85rem 1rem;
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }

    .patient-item {
        padding: 0.5rem 0.25rem;
    }

    .patient-name-text {
        max-width: 36%;
        font-size: 0.85rem;
    }

    .patient-phone-text {
        font-size: 0.72rem;
    }

    .patient-actions--compact .btn-icon {
        min-height: 38px;
        width: 38px;
    }

    .appointment-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 0.65rem;
    }

    .appointment-actions .status-badge--inline {
        grid-column: 1 / -1;
    }

    .btn-appt {
        width: 100%;
        min-height: 52px;
        padding: 0.85rem 1rem;
        font-size: 1.05rem;
        min-width: 0;
    }

    .btn-appt-icon {
        min-width: 0;
        min-height: 52px;
        width: 100%;
        font-size: 1.15rem;
    }

    .nav-link {
        min-height: 52px;
        padding: 1rem 1.15rem;
        font-size: 1.05rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 1rem;
        gap: 0.75rem;
    }

    .modal-footer .btn,
    .modal-footer--split .btn {
        width: 100%;
        min-height: 54px;
        font-size: 1.05rem;
        justify-content: center;
    }

    .modal-footer .btn-cancel-left {
        margin-right: 0;
    }

    .modal-close {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 1.25rem;
    }

    .modal-picker-actions {
        flex-direction: column;
    }

    .modal-picker-actions .btn {
        width: 100%;
        min-height: 52px;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 52px;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .time-slot {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }

    .modal-picker-day {
        min-height: 44px;
        font-size: 0.95rem;
    }

    .menu-toggle {
        width: 52px;
        height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
    }

    .date-chip-remove {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}

.api-offline-banner i {
    margin-top: 0.15rem;
    color: var(--banner-warn-icon);
}

.api-offline-banner code {
    background: var(--banner-code-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.theme-toggle i {
    width: 1.25rem;
    text-align: center;
    color: var(--primary);
}

.theme-fab {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 4100;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.theme-fab:hover {
    border-color: var(--primary);
    transform: scale(1.04);
}

@media (max-width: 768px) {
    .theme-fab {
        top: auto;
        bottom: 1.25rem;
        right: 1.25rem;
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }
}

.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg);
}

.auth-card {
    width: min(100%, 380px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.auth-card h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

.auth-card p {
    color: var(--text-light);
    font-size: 0.92rem;
}

.auth-card .btn {
    margin-top: 0.35rem;
}

.auth-pin-input {
    text-align: center;
    letter-spacing: 0.35em;
    font-size: 1.25rem;
}