:root {
    --bg: #f4f8fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #697586;
    --primary: #1f9bb4;
    --primary-dark: #116d86;
    --success: #27a36f;
    --info: #4b7bec;
    --warning: #f6b93b;
    --danger: #e55068;
    --border: #dde8ef;
    --shadow: 0 18px 45px rgba(23, 32, 51, .08);
}

body.dark-mode {
    --bg: #111827;
    --panel: #182234;
    --text: #eef5ff;
    --muted: #a8b3c7;
    --border: #26354b;
    --shadow: 0 18px 45px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", Arial, sans-serif;
}

a { text-decoration: none; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    width: 280px;
    height: 100vh;
    padding: 24px 18px;
    background: linear-gradient(180deg, #0c6f86 0%, #12314a 100%);
    color: #fff;
    flex-shrink: 0;
    z-index: 20;
    transition: width .25s ease, padding .25s ease, transform .25s ease;
}

.app-shell.sidebar-collapsed .sidebar {
    width: 86px;
    padding: 24px 12px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 30px;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    font-size: 24px;
}

.brand span {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.brand small {
    color: rgba(255, 255, 255, .72);
}

.brand-copy,
.sidebar .nav-link span,
.sidebar-card strong,
.sidebar-card span {
    transition: opacity .16s ease, visibility .16s ease;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .sidebar .nav-link span,
.app-shell.sidebar-collapsed .sidebar-card strong,
.app-shell.sidebar-collapsed .sidebar-card span {
    opacity: 0;
    visibility: hidden;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 13px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .78);
    font-weight: 500;
    white-space: nowrap;
}

.app-shell.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding-inline: 10px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-card {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 24px;
    padding: 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
}

.app-shell.sidebar-collapsed .sidebar-card {
    left: 12px;
    right: 12px;
    padding: 14px;
    text-align: center;
}

.sidebar-card i {
    font-size: 22px;
    margin-bottom: 10px;
}

.sidebar-card strong,
.sidebar-card span {
    display: block;
}

.sidebar-card span {
    margin-top: 5px;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.sidebar-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 18px 0;
}

.sidebar-metrics div {
    padding: 12px 10px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
}

.sidebar-metrics span,
.sidebar-metrics strong {
    display: block;
}

.sidebar-metrics span {
    color: rgba(255, 255, 255, .68);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-metrics strong {
    margin-top: 4px;
    color: #fff;
    font-size: 22px;
    line-height: 1;
}

.app-shell.sidebar-collapsed .sidebar-metrics {
    grid-template-columns: 1fr;
}

.app-shell.sidebar-collapsed .sidebar-metrics span {
    display: none;
}

.main-content {
    width: 100%;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.page-title,
.topbar h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-soft {
    background: rgba(31, 155, 180, .12);
    color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card,
.panel,
.form-section,
.profile-hero,
.login-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--primary);
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 28px;
}

.stat-card i {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(31, 155, 180, .12);
    color: var(--primary);
    font-size: 21px;
}

.accent-success::before { background: var(--success); }
.accent-info::before { background: var(--info); }
.accent-warning::before { background: var(--warning); }
.accent-danger::before { background: var(--danger); }

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.panel,
.form-section {
    padding: 22px;
}

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

.panel h2,
.form-section h2,
.detail-panel h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.table {
    color: var(--text);
}

.table thead th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 46px;
    border-color: var(--border);
    border-radius: 8px;
}

.input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.form-label {
    color: var(--text);
    font-weight: 600;
}

.patient-form {
    display: grid;
    gap: 20px;
}

.form-section-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 251, 253, .98));
    box-shadow: var(--shadow);
}

.form-section-card h2 {
    margin-bottom: 14px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

body.dark-mode .form-section-card {
    background: linear-gradient(180deg, rgba(24, 34, 52, .98), rgba(17, 24, 39, .98));
}

.general-info-panel {
    border: 1px solid rgba(31, 155, 180, .25) !important;
    background: linear-gradient(145deg, #ffffff, #edf8fb) !important;
    box-shadow: 0 14px 30px rgba(15, 38, 59, .10);
}

body.dark-mode .general-info-panel {
    background: linear-gradient(145deg, rgba(24, 34, 52, .98), rgba(17, 24, 39, .98)) !important;
    border-color: rgba(79, 196, 255, .18) !important;
}

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

.revisit-list {
    display: grid;
    gap: 12px;
}

.revisit-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
}

.revisit-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.revisit-item time {
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 26px;
    margin-bottom: 24px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1f9bb4, #27a36f);
    color: #fff;
    font-size: 34px;
    font-weight: 700;
}

.profile-hero h2 {
    margin: 0 0 6px;
    font-weight: 700;
}

.profile-hero p {
    color: var(--muted);
    margin: 0;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.detail-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row span {
    color: var(--muted);
}

.detail-row strong {
    color: var(--text);
    font-weight: 600;
    white-space: pre-wrap;
}

.history-timeline {
    display: grid;
    gap: 14px;
}

.history-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(31, 155, 180, .04);
}

.history-date {
    color: var(--primary);
    font-weight: 700;
}

.history-item h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.history-note {
    margin: 0;
    color: var(--muted);
    white-space: pre-wrap;
}

.app-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(31, 155, 180, .22), transparent 30%),
        linear-gradient(135deg, #eef9fb 0%, #f8fbff 100%);
}

.login-panel {
    display: grid;
    grid-template-columns: 1fr 430px;
    width: min(980px, 100%);
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-art {
    padding: 56px;
    background: linear-gradient(135deg, #0c6f86, #12314a);
    color: #fff;
}

.login-art i {
    font-size: 56px;
    margin-bottom: 24px;
}

.login-art h1 {
    font-size: 46px;
    font-weight: 700;
}

.login-art p {
    max-width: 430px;
    color: rgba(255, 255, 255, .78);
}

.login-card {
    padding: 40px;
    border-radius: 0;
}

.login-table-card {
    width: min(520px, 100%);
    border-radius: 18px;
}

.login-table th {
    width: 110px;
    color: var(--text);
    font-weight: 600;
}

.dataTables_wrapper .dt-buttons {
    margin-bottom: 12px;
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background: #111827;
    color: var(--text);
    border-color: var(--border);
}

body.dark-mode .table,
body.dark-mode .modal-content {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    background: var(--panel);
    color: var(--text);
}

@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        transform: translateX(-105%);
        width: 280px;
        padding: 24px 18px;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-shell.sidebar-collapsed .sidebar {
        width: 280px;
        padding: 24px 18px;
    }

    .app-shell.sidebar-collapsed .brand-copy,
    .app-shell.sidebar-collapsed .sidebar .nav-link span,
    .app-shell.sidebar-collapsed .sidebar-card strong,
    .app-shell.sidebar-collapsed .sidebar-card span {
        opacity: 1;
        visibility: visible;
    }

    .app-shell.sidebar-collapsed .sidebar .nav-link {
        justify-content: flex-start;
        padding: 13px 14px;
    }

    .main-content {
        padding: 20px;
    }

    .topbar {
        align-items: flex-start;
    }

    .profile-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-actions {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .history-item {
        grid-template-columns: 1fr;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-art {
        display: none;
    }
}

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

    .topbar {
        flex-wrap: wrap;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .btn {
        flex: 1;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .login-card {
        padding: 26px;
    }
}

.input-group {
    box-shadow: 0 1px 0 rgba(21, 34, 56, .02);
}

.input-group-text {
    min-width: 48px;
    justify-content: center;
    background: #f4fafc;
    color: var(--primary);
}

.input-group .form-control {
    border-left: 0;
}

.login-panel {
    border: 1px solid var(--border);
    background: #fff;
}

.login-panel .login-card {
    border-left: 0;
}

body.dark-mode .input-group-text {
    background: #121d2d;
    color: #7fd1df;
}

.mini-detail {
    height: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfdff;
}

.mini-detail span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mini-detail strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

body.dark-mode .mini-detail {
    background: var(--panel);
}

@media print {
    .sidebar,
    .topbar,
    .quick-actions,
    .profile-actions,
    .dataTables_filter,
    .dataTables_length,
    .dt-buttons,
    .dataTables_paginate {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .panel,
    .profile-hero {
        box-shadow: none;
        border: 1px solid #d8dee8;
    }
}

/* Refined medical CRM theme */
:root {
    --bg: #eef5f8;
    --panel: #ffffff;
    --text: #152238;
    --muted: #6f7d90;
    --primary: #168aa3;
    --primary-dark: #0f667d;
    --success: #1f9d78;
    --info: #3772ff;
    --warning: #e6a31f;
    --danger: #db4a61;
    --border: #d9e6ee;
    --shadow: 0 16px 42px rgba(21, 34, 56, .09);
    --shadow-soft: 0 8px 24px rgba(21, 34, 56, .06);
}

body {
    background:
        linear-gradient(180deg, rgba(22, 138, 163, .08) 0, transparent 260px),
        var(--bg);
}

.app-shell {
    align-items: stretch;
}

.sidebar {
    background: #0b3445;
    background-image:
        linear-gradient(180deg, rgba(25, 151, 177, .92), rgba(11, 52, 69, .98)),
        linear-gradient(135deg, rgba(255, 255, 255, .14), transparent 46%);
    border-right: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 12px 0 30px rgba(11, 52, 69, .12);
}

.sidebar-collapse-toggle {
    position: absolute;
    top: 32px;
    right: -14px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    cursor: pointer;
    z-index: 25;
    transition: transform 0.25s ease, background-color 0.2s, color 0.2s;
}

.sidebar-collapse-toggle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.app-shell.sidebar-collapsed .sidebar-collapse-toggle i {
    transform: rotate(180deg);
}

body.dark-mode .sidebar-collapse-toggle {
    background: var(--panel);
    border-color: var(--border);
    color: #7fd1df;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

body.dark-mode .sidebar-collapse-toggle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.brand {
    padding: 4px 4px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.brand-icon {
    width: 46px;
    height: 46px;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.brand span {
    font-size: 21px;
    line-height: 1.1;
}

.sidebar-label {
    margin: 0 10px 12px;
    color: rgba(255, 255, 255, .55);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar .nav-link {
    min-height: 48px;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, .82);
}

.sidebar .nav-link i {
    font-size: 17px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 3px 0 0 #fff;
}

.sidebar-card {
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .11);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .1);
}

.app-shell.sidebar-collapsed .brand {
    justify-content: center;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .sidebar-label,
.app-shell.sidebar-collapsed .sidebar .nav-link span,
.app-shell.sidebar-collapsed .sidebar-card strong,
.app-shell.sidebar-collapsed .sidebar-card span {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-card i {
    margin-bottom: 0;
}

.main-content {
    min-width: 0;
    padding: 24px 28px 34px;
}

.topbar {
    position: sticky;
    top: 16px;
    z-index: 12;
    padding: 14px 16px;
    border: 1px solid rgba(217, 230, 238, .86);
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.topbar-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 14px;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary);
}

.icon-btn:hover {
    border-color: rgba(22, 138, 163, .35);
    background: rgba(22, 138, 163, .08);
    color: var(--primary-dark);
}

.page-title,
.topbar h1 {
    font-size: clamp(22px, 2.2vw, 30px);
    letter-spacing: 0;
}

.topbar-actions .btn-primary {
    min-height: 42px;
    padding-inline: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 16px;
}

.stat-card,
.panel,
.form-section,
.profile-hero,
.login-card {
    border-color: rgba(217, 230, 238, .92);
    box-shadow: var(--shadow-soft);
}

.stat-card {
    min-height: 126px;
    padding: 22px;
}

.stat-card::before {
    width: 5px;
    height: auto;
    inset: 18px auto 18px 0;
    border-radius: 0 8px 8px 0;
}

.stat-card span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stat-card strong {
    font-size: 31px;
    line-height: 1.1;
}

.stat-card i {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(22, 138, 163, .16), rgba(31, 157, 120, .12));
}

.quick-actions {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .62);
}

.panel,
.form-section {
    padding: 24px;
}

.panel-heading {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.panel h2,
.form-section h2,
.detail-panel h2 {
    font-size: 17px;
}

.table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 14px 12px;
    border-bottom-color: var(--border);
}

.table thead th {
    background: #f7fbfd;
    color: #566476;
    font-size: 11px;
}

.table-hover tbody tr:hover {
    --bs-table-hover-bg: rgba(22, 138, 163, .06);
}

.form-control,
.form-select,
.input-group-text {
    min-height: 44px;
    background-color: #fbfdff;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(22, 138, 163, .55);
    box-shadow: 0 0 0 .22rem rgba(22, 138, 163, .12);
}

.form-section {
    position: relative;
}

.form-section h2 {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    color: #12314a;
}

.revisit-item {
    align-items: center;
    background: #fbfdff;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.revisit-item:hover {
    transform: translateY(-1px);
    border-color: rgba(22, 138, 163, .3);
    box-shadow: var(--shadow-soft);
}

.profile-hero {
    background:
        linear-gradient(135deg, rgba(22, 138, 163, .12), rgba(31, 157, 120, .08)),
        var(--panel);
}

.avatar {
    box-shadow: 0 12px 28px rgba(22, 138, 163, .25);
}

.detail-row {
    grid-template-columns: minmax(130px, 170px) 1fr;
}

.history-item {
    background: #fbfdff;
}

.badge {
    border-radius: 8px;
    font-weight: 700;
}

.dataTables_wrapper .dt-buttons .btn {
    margin-right: 6px;
}

.dataTables_filter input,
.dataTables_length select {
    border: 1px solid var(--border);
    border-radius: 8px;
}

body.dark-mode {
    background:
        linear-gradient(180deg, rgba(22, 138, 163, .12) 0, transparent 260px),
        var(--bg);
}

body.dark-mode .topbar,
body.dark-mode .quick-actions,
body.dark-mode .icon-btn,
body.dark-mode .table thead th,
body.dark-mode .revisit-item,
body.dark-mode .history-item {
    background: var(--panel);
}

body.dark-mode .topbar,
body.dark-mode .quick-actions {
    border-color: var(--border);
}

body.dark-mode .form-section h2 {
    color: var(--text);
}

@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(190px, 1fr));
    }
}

@media (max-width: 991px) {
    .sidebar-collapse-toggle {
        display: none !important;
    }

    .main-content {
        padding: 16px;
    }

    .topbar {
        top: 10px;
    }

    .topbar-title {
        width: 100%;
    }

    .app-shell.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 18;
        background: rgba(8, 25, 38, .45);
    }

    .app-shell.sidebar-open .sidebar {
        z-index: 19;
    }

    .app-shell.sidebar-collapsed .sidebar-label {
        display: block;
    }
}

@media (max-width: 575px) {
    .main-content {
        padding: 12px;
    }

    .topbar {
        position: relative;
        top: 0;
        padding: 12px;
    }

    .page-title,
    .topbar h1 {
        font-size: 22px;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: 42px 1fr;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card,
    .panel,
    .form-section,
    .profile-hero {
        padding: 18px;
    }
}
