/**
 * Huqouk — Mobile-First responsive layer
 * الهاتف هو الواجهة الأساسية — يُحمّل بعد styles.css
 */

:root {
    --touch-min: 44px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --page-gutter: 16px;
    --sheet-radius: 20px 20px 0 0;
}

@media (max-width: 767px) {
    :root {
        --navbar-height: 60px;
    }
}

@media (min-width: 768px) {
    :root {
        --page-gutter: 24px;
    }
}

/* ── Foundation ── */
html {
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    overflow-x: clip;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

body.mobile-menu-open,
body.sheet-open,
body.dash-drawer-open {
    overflow: hidden;
    touch-action: none;
}

img,
video,
svg,
iframe {
    max-width: 100%;
    height: auto;
}

.container {
    padding-left: max(var(--page-gutter), var(--safe-left));
    padding-right: max(var(--page-gutter), var(--safe-right));
}

.section {
    padding: 48px 0;
}

@media (min-width: 768px) {
    .section {
        padding: 80px 0;
    }
}

.page-bg {
    min-height: calc(100dvh - var(--navbar-height));
    padding-top: calc(var(--navbar-height) + 16px);
    padding-bottom: max(24px, var(--safe-bottom));
}

/* Grids — mobile first */
.grid-2,
.grid-3,
.grid-4 {
    grid-template-columns: 1fr;
    gap: 16px;
}

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

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 32px;
    }

    .grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }
}

/* Touch targets & forms */
.btn,
.filter-btn,
.mobile-menu-btn,
.dash-drawer-toggle,
.cr-tab,
.auth-tab {
    min-height: var(--touch-min);
}

.btn-sm {
    min-height: 40px;
    padding: 10px 14px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-group input,
.form-group select,
.form-group textarea,
#lawyer-search-input,
.lawyers-search-input {
    min-height: var(--touch-min);
    font-size: 16px;
    width: 100%;
    max-width: 100%;
}

textarea {
    min-height: 120px;
}

/* Prevent hover-only UX on touch */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
}

/* Word wrap */
h1, h2, h3, h4, p, li, td, th, .card {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ── Navbar & mobile drawer ── */
@media (max-width: 1023px) {
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    /* RTL: زر القائمة يمين، الشعار يسار */
    .mobile-menu-btn {
        display: inline-flex;
        order: 1;
        width: var(--touch-min);
        height: var(--touch-min);
        min-height: var(--touch-min);
    }

    .logo {
        order: 2;
    }

    .mobile-nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        inset-inline-end: 0;
        inset-inline-start: auto;
        left: auto !important;
        right: 0;
        width: min(300px, 86vw) !important;
        max-width: 86vw;
        height: 100dvh;
        max-height: 100dvh;
        padding: 0;
        margin: 0;
        border: none;
        border-inline-start: 1px solid var(--border-color);
        box-shadow: -12px 0 40px rgba(15, 23, 42, 0.15);
        z-index: 1100;
        transform: translate3d(100%, 0, 0);
        transition: transform 0.28s ease;
        visibility: hidden;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav.open {
        display: flex;
        transform: translate3d(0, 0, 0);
        visibility: visible;
    }

    .mobile-nav__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: max(12px, var(--safe-top)) 16px 12px;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
        background: var(--bg-card);
    }

    .mobile-nav__title {
        font-weight: 800;
        font-size: 18px;
        color: var(--primary);
    }

    .mobile-nav__close {
        width: var(--touch-min);
        height: var(--touch-min);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        color: var(--text-sec);
        font-size: 20px;
    }

    .mobile-nav__close:active {
        background: var(--bg-main);
    }

    .mobile-nav__links {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 8px 0;
        scrollbar-width: thin;
    }

    .mobile-nav__links::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-nav__links::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 4px;
    }

    .mobile-nav__links a {
        padding: 14px 20px;
        min-height: var(--touch-min);
        display: flex;
        align-items: center;
        font-size: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-nav__links a:last-child {
        border-bottom: none;
    }

    .mobile-nav__logout {
        color: #B91C1C;
    }

    .mobile-nav__cta {
        flex-shrink: 0;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        border-top: 1px solid var(--border-color);
        background: var(--bg-card);
        padding-bottom: max(16px, var(--safe-bottom));
    }

    .mobile-nav__cta .btn {
        width: 100%;
    }
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s;
    backdrop-filter: blur(2px);
}

.mobile-nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Hero mobile ── */
@media (max-width: 767px) {
    .hero,
    .chat-hero {
        min-height: auto;
        padding: calc(var(--navbar-height) + 24px) 0 40px;
    }

    .hero-title {
        font-size: clamp(1.5rem, 7vw, 2rem);
        line-height: 1.25;
        max-width: 18ch;
    }

    .hero-desc {
        font-size: 1rem;
        line-height: 1.65;
        margin-bottom: 20px;
    }

    .hero-status {
        margin-bottom: 20px;
        font-size: 14px;
        padding: 8px 16px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px !important;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-split {
        gap: 24px;
    }

    .chat-app-container {
        border-radius: 16px;
        min-height: 360px;
    }

    .section-title {
        font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    }

    .section-header {
        margin-bottom: 28px;
    }
}

/* ── Dashboard drawer ── */
.dash-drawer-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    justify-content: center;
}

@media (max-width: 899px) {
    .dash-drawer-toggle {
        display: inline-flex;
    }

    .page[data-page="dashboard"] .section,
    .page[data-page="lawyer-dashboard"] .section,
    .page[data-page="admin-dashboard"] .section {
        padding: 20px 0 32px;
    }

    .page[data-page="dashboard"] .dashboard-layout.container,
    .page[data-page="lawyer-dashboard"] .dashboard-layout.container,
    .page[data-page="admin-dashboard"] .dashboard-layout.container {
        padding-left: max(12px, var(--safe-left));
        padding-right: max(12px, var(--safe-right));
        width: 100%;
        max-width: 100%;
    }

    .dashboard-layout {
        gap: 0;
        display: block;
    }

    .dashboard-sidebar {
        position: fixed;
        top: 0;
        inset-inline-end: 0;
        right: 0;
        left: auto !important;
        width: min(300px, 88vw) !important;
        max-width: 88vw;
        height: 100dvh;
        z-index: 1200;
        margin: 0;
        border-radius: 16px 0 0 16px;
        transform: translate3d(100%, 0, 0);
        transition: transform 0.28s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 0;
        background: var(--bg-card);
        border: none;
        border-inline-start: 1px solid var(--border-color);
        box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-sidebar.is-open {
        transform: translate3d(0, 0, 0);
    }

    .dashboard-sidebar .dash-sidebar__mobile-head {
        flex-shrink: 0;
        padding: max(12px, var(--safe-top)) 16px 12px;
        margin-bottom: 0;
    }

    .dashboard-sidebar .sidebar-user {
        flex-shrink: 0;
        margin-bottom: 0;
        padding: 12px 16px 16px;
    }

    .dashboard-sidebar .sidebar-nav {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 4px 12px max(16px, var(--safe-bottom));
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .dashboard-sidebar .sidebar-nav::-webkit-scrollbar {
        display: none;
        width: 0;
    }

    .dashboard-sidebar .sidebar-nav li {
        width: 100%;
        margin-bottom: 4px;
        border-radius: 12px;
        padding: 14px 14px;
        gap: 12px;
        font-size: 15px;
        justify-content: flex-start;
    }

    .dashboard-sidebar .sidebar-nav li i {
        width: 22px;
        font-size: 17px;
        flex-shrink: 0;
        text-align: center;
    }

    .dashboard-sidebar .sidebar-nav li.active {
        background: rgba(26, 95, 122, 0.1);
        color: var(--primary);
        font-weight: 700;
    }

    .dashboard-sidebar .sidebar-nav li#dash-logout {
        margin-top: 8px;
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        color: #B91C1C;
    }

    .dashboard-sidebar .sidebar-nav li#dash-logout:hover,
    .dashboard-sidebar .sidebar-nav li#dash-logout:active {
        background: rgba(185, 28, 28, 0.06);
        color: #B91C1C;
    }

    .dashboard-main {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .dashboard-header h2 {
        font-size: clamp(1.1rem, 4.5vw, 1.45rem);
        line-height: 1.35;
    }

    .dashboard-stats,
    .grid-4.dashboard-stats,
    .grid-3.dashboard-stats {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .dashboard-quick-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .stat-card {
        width: 100%;
    }

    .premium-urgent-card-head {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .sidebar-nav li {
        min-height: var(--touch-min);
        padding: 14px 16px;
    }
}

.dash-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.dash-drawer-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Modals → bottom sheet on mobile ── */
@media (max-width: 767px) {
    .modal.flex {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92dvh;
        overflow-y: auto;
        border-radius: var(--sheet-radius);
        padding: 24px 20px max(24px, var(--safe-bottom));
        margin: 0;
        animation: sheetUp 0.3s ease;
    }

    .close-modal {
        top: 12px;
        left: 16px;
        width: var(--touch-min);
        height: var(--touch-min);
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ── Tables → cards ── */
@media (max-width: 767px) {
    .cr-table-wrap,
    .table-wrap,
    .admin-table-wrap {
        overflow-x: visible;
    }

    .cr-table,
    table.cr-table,
    .admin-table-wrap table,
    #admin-services-tbody,
    .dash-section table {
        display: block;
        width: 100%;
    }

    .cr-table thead,
    .dash-section table thead,
    .admin-table-wrap table thead {
        display: none;
    }

    .cr-table tbody,
    .dash-section table tbody,
    .admin-table-wrap table tbody {
        display: block;
    }

    .cr-table tr,
    .dash-section table tr,
    .admin-table-wrap table tr {
        display: block;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: var(--bg-card);
        box-shadow: var(--shadow-card);
    }

    .cr-table td,
    .cr-table th,
    .dash-section table td,
    .dash-section table th,
    .admin-table-wrap table td,
    .admin-table-wrap table th {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 8px 0;
        border: none;
        text-align: right;
        width: 100%;
    }

    .cr-table td::before,
    .dash-section table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-sec);
        font-size: 12px;
        flex-shrink: 0;
    }

    .cr-table td:empty {
        display: none;
    }
}

/* ── Case room mobile ── */
@media (max-width: 767px) {
    .cr-shell {
        padding: 0;
    }

    .cr-tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .cr-tabs::-webkit-scrollbar {
        display: none;
    }

    .cr-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 13px;
    }

    .cr-meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .cr-header__top {
        flex-direction: column;
        align-items: stretch;
    }

    .cr-header__top .btn {
        width: 100%;
    }

    .cr-msg-compose {
        flex-direction: column;
        gap: 10px;
    }

    .cr-msg-compose input {
        width: 100%;
    }

    .cr-msg-compose .btn {
        width: 100%;
    }
}

/* ── Evidence builder mobile ── */
@media (max-width: 767px) {
    .evb-grid,
    .evb-layout {
        grid-template-columns: 1fr;
    }

    .evb-actions .btn {
        flex: 1 1 100%;
    }
}

/* ── Lawyers filters bottom sheet ── */
.lawyers-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.lawyers-search-input,
#lawyer-search-input.lawyers-search-input {
    width: 100%;
    max-width: none;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 0 !important;
}

.lawyers-filter-toggle {
    width: 100%;
}

.lawyers-filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 1300;
    pointer-events: none;
    visibility: hidden;
}

.lawyers-filter-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
}

.lawyers-filter-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lawyers-filter-sheet.is-open .lawyers-filter-sheet__backdrop {
    opacity: 1;
}

.lawyers-filter-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-radius: var(--sheet-radius);
    padding: 20px max(20px, var(--safe-right)) max(24px, var(--safe-bottom)) max(20px, var(--safe-left));
    max-height: 80dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.lawyers-filter-sheet.is-open .lawyers-filter-sheet__panel {
    transform: translateY(0);
}

.lawyers-filter-sheet__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lawyers-filter-sheet__head h3 {
    margin: 0;
    font-size: 17px;
    color: var(--primary);
}

.lawyers-filter-sheet__close {
    width: var(--touch-min);
    height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-sec);
}

.lawyers-filter-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lawyers-filter-groups .filters-container {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.lawyers-filter-groups .filter-btn {
    width: 100%;
    text-align: center;
}

@media (min-width: 768px) {
    .lawyers-toolbar {
        flex-direction: row;
        align-items: center;
    }

    .lawyers-search-input {
        flex: 1;
    }

    .lawyers-filter-toggle {
        display: none;
    }

    .lawyers-filter-sheet {
        position: static;
        visibility: visible;
        pointer-events: auto;
        z-index: auto;
    }

    .lawyers-filter-sheet__backdrop,
    .lawyers-filter-sheet__head {
        display: none;
    }

    .lawyers-filter-sheet__panel {
        position: static;
        transform: none;
        padding: 0;
        max-height: none;
        background: transparent;
        overflow: visible;
    }

    .lawyers-filter-groups .filters-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .lawyers-filter-groups .filter-btn {
        width: auto;
    }
}

/* ── Lawyer cards ── */
@media (max-width: 767px) {
    .lts-card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .lts-card__actions {
        width: 100%;
    }

    .lts-card__actions .btn {
        flex: 1;
    }
}

/* ── Toast safe area ── */
.toast {
    bottom: max(18px, var(--safe-bottom));
    left: max(18px, var(--safe-left));
    right: max(18px, var(--safe-right));
    width: auto;
}

/* ── Auth pages ── */
@media (max-width: 767px) {
    .auth-premium-page {
        padding-top: calc(var(--navbar-height) + var(--safe-top) + 12px);
    }

    .auth-premium-shell {
        margin: 0;
    }
}

/* ── Admin cards ── */
@media (max-width: 767px) {
    .admin-lawyer-card-footer,
    .admin-lawyer-card-footer .btn {
        flex-direction: column;
        width: 100%;
    }

    .admin-lawyer-card-footer .btn {
        width: 100%;
    }

    #admin-lawyers-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Conversations chat ── */
@media (max-width: 767px) {
    .chat-layout {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: calc(100dvh - var(--navbar-height) - 40px);
    }

    .chat-sidebar {
        max-height: 40vh;
    }

    .chat-main {
        min-height: 50vh;
    }
}

/* ── Utility: kill horizontal scroll ── */
[style*="width: 500px"],
[style*="width: 600px"],
[style*="width: 700px"],
[style*="width: 800px"] {
    max-width: 100% !important;
}

.flex-center {
    flex-wrap: wrap;
}

/* Notification dropdown mobile */
@media (max-width: 767px) {
    #notification-dropdown {
        position: fixed !important;
        top: calc(var(--navbar-height) + 8px) !important;
        left: max(12px, var(--safe-left)) !important;
        right: max(12px, var(--safe-right)) !important;
        width: auto !important;
        max-height: 60dvh;
    }
}

/* ==========================================================================
   Dashboard mobile shell (لوحة العميل)
   ========================================================================== */
.dash-mobile-topbar,
.dash-bottom-nav,
.dash-sidebar__mobile-head {
    display: none;
}

.dash-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.dash-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 88px;
    padding: 14px 10px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    line-height: 1.35;
}

.dash-action-tile i {
    font-size: 22px;
    color: var(--primary);
}

.dash-action-tile--primary {
    background: rgba(26, 95, 122, 0.06);
    border-color: rgba(26, 95, 122, 0.15);
}

.dash-action-tile--urgent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.12));
    border-color: rgba(245, 158, 11, 0.35);
    color: #B45309;
}

.dash-action-tile--urgent i {
    color: #EA580C;
}

.dash-home-welcome h2 {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    line-height: 1.35;
    margin-bottom: 6px;
}

.dash-compliance-note {
    padding: 12px 14px;
    margin-bottom: 16px;
}

@media (max-width: 899px) {
    .page[data-page="dashboard"] {
        padding-bottom: calc(72px + var(--safe-bottom));
    }

    .page[data-page="dashboard"] .dashboard-layout.section {
        padding-top: 12px;
        padding-bottom: 16px;
    }

    .dash-mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        margin: 0 0 16px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 14px;
        box-shadow: var(--shadow-card);
        position: sticky;
        top: calc(var(--navbar-height) + 8px);
        z-index: 50;
    }

    .dash-mobile-topbar__menu {
        width: var(--touch-min);
        height: var(--touch-min);
        min-height: var(--touch-min);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: var(--bg-main);
        border: 1px solid var(--border-color);
        color: var(--primary);
        font-size: 18px;
        flex-shrink: 0;
    }

    .dash-mobile-topbar__center {
        flex: 1;
        min-width: 0;
        text-align: center;
    }

    .dash-mobile-topbar__eyebrow {
        margin: 0;
        font-size: 11px;
        color: var(--text-sec);
        font-weight: 600;
    }

    .dash-mobile-topbar__title {
        margin: 0;
        font-size: 16px;
        font-weight: 800;
        color: var(--primary);
        line-height: 1.3;
    }

    .dash-mobile-topbar__avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
        flex-shrink: 0;
    }

    .dash-sidebar__mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-card);
    }

    .dash-sidebar__mobile-head strong {
        color: var(--primary);
        font-size: 16px;
    }

    .dash-sidebar__close {
        width: var(--touch-min);
        height: var(--touch-min);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        color: var(--text-sec);
        font-size: 20px;
    }

    .dash-sidebar__close:active {
        background: var(--bg-main);
    }

    .dash-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border-color);
        padding: 6px max(6px, var(--safe-left)) max(6px, var(--safe-bottom)) max(6px, var(--safe-right));
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    }

    .dash-bottom-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 52px;
        padding: 6px 4px;
        border-radius: 10px;
        color: var(--text-sec);
        font-size: 10px;
        font-weight: 700;
        line-height: 1.2;
    }

    .dash-bottom-nav__item i {
        font-size: 18px;
    }

    .dash-bottom-nav__item.is-active {
        color: var(--primary);
        background: rgba(26, 95, 122, 0.08);
    }

    /* إخفاء عناوين الأقسام المكررة داخل المحتوى */
    .page[data-page="dashboard"] .dash-section:not(#user-home) > .dashboard-header h2 {
        font-size: 1.15rem;
    }

    .page[data-page="dashboard"] #user-home > .dashboard-header.dash-home-welcome {
        margin-bottom: 12px;
    }
}

@media (min-width: 900px) {
    .dash-action-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
