/* ========================================
   Modern Healthcare Management System Styles
   Active Layout File - Referenced in index.html
   
   Note: This is the production layout file.
   Previously had a "modern-layout.clean.css" variant
   that was removed to avoid confusion (2025-11-02).
   ======================================== */

/* Bootstrap Icons */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css');

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 56px; /* Reduced from 64px */
    --topbar-border-width: 1px; /* Keep in sync with theme navbar border */
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #212529;
    
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Font family and size inherited from app.css - do not override here */
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* ========================================
   Skip to Content Link (Accessibility)
   ======================================== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-weight: 600;
    border-radius: 0 0 4px 0;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--warning-color);
    outline-offset: 2px;
}

/* ========================================
   App Container
   ======================================== */

.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-secondary);
}

/* ========================================
   Sidebar
   ======================================== */

/* Remove all focus outlines from sidebar and interactive elements */
.sidebar *:focus,
.sidebar *:focus-visible,
.sidebar *:active,
.logo:focus,
.logo:focus-visible,
.logo:active,
img:focus,
img:focus-visible,
button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible,
[role="button"]:active,
.sidebar-toggle:focus,
.sidebar-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    position: fixed;
    left: 0;
    /* Sidebar occupies full height from very top; navbar sits to its right */
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar footer pinned to bottom */
.sidebar-footer {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.12) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-collapse-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.sidebar-collapse-btn:active {
    transform: translateY(0);
}

.sidebar-collapse-btn i {
    font-size: 1rem;
    color: inherit;
}

/* Compact control when sidebar is collapsed */
aside.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-footer {
    padding: 0.5rem 0.5rem !important;
}

aside.sidebar.collapsed .sidebar-collapse-btn,
.sidebar.collapsed .sidebar-collapse-btn {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    padding: 0;
}

aside.sidebar.collapsed .sidebar-collapse-btn .collapse-label,
.sidebar.collapsed .sidebar-collapse-btn .collapse-label {
    display: none;
}

/* Rotate chevron so it points to the content side when collapsed */
/* Icon shouldn't rotate; keep consistent for the table-columns glyph */
aside.sidebar.collapsed .sidebar-collapse-btn i,
.sidebar.collapsed .sidebar-collapse-btn i {
    transform: none;
}

/* Collapsed sidebar - FORCE HIDE TEXT AND SHRINK WIDTH */
aside.sidebar.collapsed,
.sidebar.collapsed {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
}

aside.sidebar.collapsed .logo span,
.sidebar.collapsed .logo span {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

aside.sidebar.collapsed .nav-menu-item span,
.sidebar.collapsed .nav-menu-item span {
    /* CRITICAL: Ensure text and extra width are fully hidden when collapsed */
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    font-size: 0 !important;
}

aside.sidebar.collapsed .nav-section-header,
.sidebar.collapsed .nav-section-header {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

aside.sidebar.collapsed .nav-language-switcher,
.sidebar.collapsed .nav-language-switcher {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.sidebar.collapsed .nav-section-divider {
    margin: 0.5rem 0.75rem !important;
}

.sidebar-header {
    padding: 1.25rem 1rem; /* Reduced from 1.5rem */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: padding var(--transition-normal);
}

/* Reduce header padding when collapsed */
aside.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem !important;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 1.125rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    width: 100%;
    transition: all var(--transition-normal);
}

/* Center logo when collapsed */
aside.sidebar.collapsed .logo,
.sidebar.collapsed .logo {
    justify-content: center !important;
    gap: 0 !important;
}

.logo i {
    font-size: 1.75rem; /* Reduced from 2rem */
    color: #60a5fa;
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
    transition: font-size var(--transition-normal);
}

/* Shrink logo icon when collapsed */
aside.sidebar.collapsed .logo i,
.sidebar.collapsed .logo i {
    font-size: 1.5rem !important;
}

.logo span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    line-height: 1.1;
    letter-spacing: 0.2px;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem; /* Reduced from 0.875rem 1.5rem */
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    font-size: 0.875rem; /* Reduced from 0.9375rem */
    white-space: nowrap;
}

.sidebar.collapsed .nav-menu-item {
    padding: 0.875rem 0;
    justify-content: center;
    gap: 0;
}

.nav-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-menu-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: #60a5fa;
    color: #ffffff;
}

.sidebar.collapsed .nav-menu-item.active {
    border-left-color: transparent;
    border-right: 3px solid #60a5fa;
}

.nav-menu-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-menu-item span {
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.nav-section-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 1.5rem;
}

/* Language Section in Sidebar */
.nav-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 0.5rem;
    transition: opacity var(--transition-normal);
}

.nav-section-header i {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-section-header {
    opacity: 0;
    visibility: hidden;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.nav-language-switcher {
    padding: 0.5rem 1.5rem 1rem 1.5rem;
    transition: all var(--transition-normal);
}

.sidebar.collapsed .nav-language-switcher {
    opacity: 0;
    visibility: hidden;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.nav-language-switcher .language-switcher {
    width: 100%;
}

.nav-language-switcher .btn {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    transition: all var(--transition-fast);
}

.nav-language-switcher .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-language-switcher .btn:active {
    transform: translateY(0);
}

/* ========================================
   Main Content Area
   ======================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
    display: flex;
    flex-direction: column;
    /* Offset fixed top navbar height + its border */
    padding-top: calc(var(--topbar-height) + var(--topbar-border-width));
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* RTL collapsed support moved to css/rtl.css */
/* See wwwroot/css/rtl.css for RTL layout specifics */

/* ========================================
   Top Navigation Bar
   ======================================== */

/* Remove focus outlines from top navbar elements */
.top-navbar *:focus,
.top-navbar button:focus,
.top-navbar a:focus,
.nav-icon-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.top-navbar {
    height: var(--topbar-height);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    width: calc(100vw - var(--sidebar-width));
    z-index: 1100; /* above sidebar */
    box-shadow: var(--shadow-sm);
}

/* When sidebar is collapsed, shift navbar to align with collapsed width */
.main-content.collapsed .top-navbar {
    left: var(--sidebar-collapsed-width);
    width: calc(100vw - var(--sidebar-collapsed-width));
}

/* RTL: navbar anchors from the right side */
/* RTL top-navbar rules moved to css/rtl.css */

/* Improve navbar spacing on large screens */
@media (min-width: 992px) {
    .top-navbar { padding: 0 2rem 0 9px; }
}

/* ========================================
   Focus handling for page content and headings
   - Prevents grey focus border that may appear after navigation
   - We keep focus styles for interactive controls (links, buttons, inputs)
   ======================================== */

.page-content:focus,
.page-content:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

h1:focus, h1:focus-visible,
h2:focus, h2:focus-visible,
.dashboard-title:focus, .dashboard-title:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

/* Group all topbar icons and enforce equal spacing */
.nav-icon-group {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem; /* single source of truth for icon spacing */
}

/* Make LanguageSwitcher wrapper transparent to layout so its buttons join the group evenly */
.nav-icons-inline { 
    display: contents; /* children participate directly in parent flex */
}

/* Simple icon button in the navbar */
.nav-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; /* Reduced from 36px */
    height: 32px; /* Reduced from 36px */
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-icon-button:hover {
    background-color: var(--bg-secondary);
}

.nav-icon-button:active,
.nav-icon-button:focus {
    color: #0d6efd;
}

.nav-icon-button i {
    font-size: 1.1rem; /* Reduced from 1.25rem */
}

/* Compact language code button in top bar */
.nav-lang-button {
    transform: translateY(0px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.nav-lang-button:hover {
    background: var(--bg-secondary);
}

/* Modern User Profile Button */
.user-profile-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* Reduced from 0.625rem */
    padding: 0.3rem 0.65rem 0.3rem 0.3rem; /* Reduced from 0.375rem 0.75rem */
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    font-size: 0.8125rem; /* Added smaller font */
}

.user-profile-button:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    transform: translateY(0px);
}

/* Avatar-only variant: tighter footprint and hide name/chevron */
.user-profile-button.avatar-only {
    padding: 2px;
    border-radius: 9999px;
    width: 40px;
    height: 40px;
    justify-content: center;
}

.user-profile-button.avatar-only .user-avatar {
    width: 32px;
    height: 32px;
}

/* Screen-reader only helper */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.user-avatar {
    width: 28px; /* Reduced from 32px */
    height: 28px; /* Reduced from 32px */
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    min-width: 0;
}

.user-info .user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-arrow {
    font-size: 0.625rem;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.user-profile-button[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Logout text button styling in navbar */
.nav-logout-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 36px;
    padding: 0 0.75rem;
}

.sidebar-toggle {
    background: transparent !important;
    border: none !important;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    margin: 0;
    border-radius: 0.375rem;
    transition: color var(--transition-fast) !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: transparent !important;
    transform: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sidebar-toggle:active,
.sidebar-toggle:focus {
    background: transparent !important;
    transform: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #0d6efd !important;
}

/* ========================================
   User Profile - Bootstrap Dropdown Style
   ======================================== */

.dropdown {
    position: relative;
    display: inline-block;
    /* padding-left: 12px; */
}

.dropdown .btn {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
}

.dropdown .btn span {
    display: inline !important;
    margin-top: 0.5rem !important;
}

/* Dropdown Menu Base Styles */
.dropdown-menu {
    min-width: 180px;
    width: max-content;
    max-width: 240px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0.625rem;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 
                0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
    z-index: 1050;
}

/* make dropdown scroll if it exceeds viewport height */
.dropdown-menu {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Ensure dropdown container has relative positioning */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu.show {
    display: block;
}

/* Navbar user dropdown positioning */
.navbar-right .user-dropdown { position: relative;     padding-left: 20px;}
.navbar-right .user-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
}
.navbar-right .user-dropdown .dropdown-menu { margin-top: 6px; }
.navbar-right .user-dropdown .dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Language and Mode Switcher (in sidebar footer) */
.language-mode-switcher { width: 100%; }
.language-mode-switcher .switcher-item button {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    transition: all var(--transition-fast);
    border-radius: 0.375rem;
}
.language-mode-switcher .switcher-item button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.language-mode-switcher .divider {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown RTL adjustments moved to css/rtl.css */
/* See wwwroot/css/rtl.css for dropdown and navbar RTL helpers */

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 0.875rem 0.875rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.06));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.dropdown-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    flex-shrink: 0;
}

.user-avatar-icon,
.dropdown-user-avatar .user-avatar-icon {
    font-size: 1.25rem;
    color: #fff;
    line-height: 1;
}

.dropdown-user-details {
    overflow: hidden;
    flex: 1;
}

.dropdown-user-details h6 {
    margin: 0 0 0.125rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.dropdown-user-details p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.dropdown-divider {
    margin: 0;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.dropdown-item:hover::before {
    transform: scaleX(1);
}

.dropdown-item:hover {
    background: linear-gradient(to right, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.04));
    color: var(--primary-color);
}

.dropdown-item:active {
    background: linear-gradient(to right, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.dropdown-item:hover i {
    color: var(--primary-color);
    transform: translateX(2px);
}

.dropdown-item span {
    flex: 1;
}

/* ========================================
   Page Content
   ======================================== */

.page-content {
    flex: 1;
    padding: 1.5rem; /* Reduced from 2rem */
    overflow-y: auto;
}

/* ========================================
   RTL Support
   ======================================== */
/* RTL support moved to css/rtl.css to centralize RTL rules and avoid duplication. */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    /* Mobile RTL sidebar behavior moved to css/rtl.css */
    /* See wwwroot/css/rtl.css for RTL mobile sidebar rules */

    .main-content,
    .main-content.collapsed {
        margin-left: 0;
        width: 100%;
    }

    /* On mobile, navbar spans full width (sidebar is hidden off-canvas) */
    .top-navbar {
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        /* No seam border on mobile when navbar is full-width */
        border-left: none !important;
        border-right: none !important;
    }

    /* Mobile RTL adjustments for main-content moved to css/rtl.css */

    .user-info {
        display: none;
    }
    
    /* Mobile overlay when sidebar is open */
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: var(--sidebar-width);
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Loading progress bar removed from UI; keyframes and rules deleted. */
