@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-deep: #141410;
    --bg-dark: #191916;
    --text-light: #f7f7f2;
    --text-muted: #A3A39F;
    --navy-primary: #283469;
    --yellow-highlight: #FBE066;
    --burgundy-sold: #6B2D32;
    
    --glass-bg: rgba(20, 20, 16, 0.74);
    --glass-border: rgba(163, 163, 159, 0.18);
    --glass-glow: rgba(40, 52, 105, 0.2);
    
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 10px;
    
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s var(--ease-out);
    --transition-slow: all 0.6s var(--ease-out);
}

html {
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 12% 18%, rgba(251, 224, 102, 0.12), transparent 24%),
        radial-gradient(circle at 82% 10%, rgba(40, 52, 105, 0.28), transparent 28%),
        radial-gradient(circle at 78% 86%, rgba(107, 45, 50, 0.2), transparent 30%),
        linear-gradient(135deg, #141410 0%, #191916 48%, #10100e 100%);
    background-attachment: fixed;
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow: hidden;
}

html.theme-light {
    color-scheme: light;
    --bg-deep: #e7e7e3;
    --bg-dark: #f7f6ef;
    --text-light: #141410;
    --text-muted: #666862;
    --glass-bg: rgba(255, 255, 250, 0.78);
    --glass-border: rgba(20, 20, 16, 0.13);
    --glass-glow: rgba(40, 52, 105, 0.12);
    --mp-bg: #e7e7e3;
    --mp-panel: rgba(255, 255, 250, 0.84);
    --mp-ink: #141410;
    --mp-muted: #666862;
    --mp-line: rgba(20, 20, 16, 0.13);
    --mp-line-strong: rgba(40, 52, 105, 0.24);
    --editor-panel: rgba(255, 255, 250, 0.84);
    --editor-line: rgba(20, 20, 16, 0.13);
    --editor-ink: #141410;
    --editor-muted: #666862;
    --editor-accent: #283469;
}

html.theme-light body:not(.is-display-view) {
    background-color: #e7e7e3;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(251, 224, 102, 0.26), transparent 24%),
        radial-gradient(circle at 82% 10%, rgba(40, 52, 105, 0.13), transparent 28%),
        radial-gradient(circle at 78% 86%, rgba(107, 45, 50, 0.11), transparent 30%),
        linear-gradient(135deg, #eeeeea 0%, #f7f6ef 48%, #deded9 100%);
    color: var(--text-light);
}

.login-screen {
    position: absolute;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at 15% 16%, rgba(251, 224, 102, 0.16), transparent 24%),
        radial-gradient(circle at 85% 18%, rgba(40, 52, 105, 0.36), transparent 28%),
        radial-gradient(circle at 76% 86%, rgba(107, 45, 50, 0.24), transparent 30%),
        #141410;
}

.login-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 440px);
    gap: 34px;
    align-items: center;
}

.login-brand {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-wordmark {
    color: var(--text-light);
    font-size: clamp(76px, 12vw, 156px);
    line-height: 0.82;
    letter-spacing: -0.1em;
    font-weight: 800;
}

.login-tagline {
    max-width: 280px;
    margin-top: 22px;
    margin-left: clamp(4px, 22vw, 350px);
    color: var(--text-light);
    font-size: 18px;
    line-height: 0.95;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.login-card {
    padding: 42px 38px;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    margin-bottom: 22px;
    border-radius: 999px;
    background: rgba(251, 224, 102, 0.1);
    border: 1px solid rgba(251, 224, 102, 0.22);
    color: var(--yellow-highlight);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 0 0 10px;
    font-size: 34px;
    letter-spacing: -0.04em;
}

.login-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

.login-form {
    text-align: left;
}

.login-form .btn {
    width: 100%;
    margin-top: 8px;
    padding: 18px;
    font-size: 16px;
}

.login-error {
    background: rgba(107, 45, 50, 0.22);
    color: #ffd9dc;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    border: 1px solid rgba(107, 45, 50, 0.5);
    font-size: 14px;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 15px rgba(251, 224, 102, 0.1); }
    50% { box-shadow: 0 0 25px rgba(251, 224, 102, 0.3); }
    100% { box-shadow: 0 0 15px rgba(251, 224, 102, 0.1); }
}

.animate-in {
    animation: fadeInUp 0.8s var(--ease-out) forwards;
    opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Layout Shell */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

body.is-display-view {
    overflow: hidden;
}

body.is-display-view .app-wrapper {
    height: 100vh;
}

body.is-display-view .main-content {
    height: 100vh;
    padding: 0;
    overflow: hidden;
}

/* Premium Top Navbar */
.top-navbar {
    min-height: 75px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    gap: 16px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.navbar-brand-link {
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    max-width: 100%;
}

.navbar-logo strong {
    font-weight: 800;
    color: var(--text-light);
    font-size: 34px;
    letter-spacing: -2px;
    line-height: 1;
    white-space: nowrap;
}

.navbar-logo span {
    max-width: 132px;
    font-size: 10px;
    line-height: 1.15;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 800;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}
.nav-item:hover, .nav-item.active {
    background: rgba(163, 163, 159, 0.08);
    color: var(--text-light);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(40, 52, 105, 0.58) 0%, rgba(40, 52, 105, 0.18) 100%);
    border: 1px solid rgba(251, 224, 102, 0.22);
    color: var(--yellow-highlight);
}

.nav-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.nav-dropdown-toggle {
    border: 0;
    font-family: inherit;
}

.nav-dropdown-caret {
    margin-left: 4px;
    color: var(--yellow-highlight);
    font-size: 12px;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 500;
    min-width: 230px;
    padding: 8px;
    display: none;
    background: rgba(17, 17, 15, 0.98);
    border: 1px solid rgba(163, 163, 159, 0.18);
    border-radius: 16px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: grid;
    gap: 6px;
}

.nav-dropdown-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition-fast);
}

.nav-dropdown-item span {
    font-size: 14px;
    font-weight: 800;
}

.nav-dropdown-item small {
    color: var(--text-muted);
    font-size: 11px;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
    background: rgba(40, 52, 105, 0.42);
    color: var(--yellow-highlight);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(163, 163, 159, 0.16);
    border-radius: 999px;
    background: rgba(20, 20, 16, 0.56);
    color: var(--yellow-highlight);
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: inset 0 0 0 1px rgba(251, 224, 102, 0.04);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    background: rgba(40, 52, 105, 0.3);
    border-color: rgba(251, 224, 102, 0.3);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.theme-toggle-icon {
    display: block;
    transition: var(--transition-fast);
}

.theme-toggle-sun {
    display: none;
}

html.theme-light .theme-toggle-moon {
    display: none;
}

html.theme-light .theme-toggle-sun {
    display: block;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-primary), var(--burgundy-sold));
    border: 1px solid rgba(251, 224, 102, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.profile-menu {
    position: relative;
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid rgba(163, 163, 159, 0.14);
    border-radius: 999px;
    background: rgba(20, 20, 16, 0.56);
    color: var(--text-light);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-toggle:hover,
.profile-menu:focus-within .profile-toggle {
    background: rgba(40, 52, 105, 0.26);
    border-color: rgba(251, 224, 102, 0.24);
}

.profile-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.profile-summary span {
    font-size: 13px;
    font-weight: 700;
}

.profile-summary small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-caret {
    color: var(--yellow-highlight);
    font-size: 11px;
}

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 520;
    min-width: 245px;
    display: none;
    padding: 8px;
    border: 1px solid rgba(163, 163, 159, 0.18);
    border-radius: 16px;
    background: rgba(17, 17, 15, 0.98);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.profile-menu:hover .profile-dropdown-menu,
.profile-menu:focus-within .profile-dropdown-menu {
    display: grid;
    gap: 8px;
}

.profile-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.profile-dropdown-head strong,
.profile-dropdown-head small {
    display: block;
}

.profile-dropdown-head strong {
    color: var(--text-light);
    font-size: 14px;
}

.profile-dropdown-head small {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.profile-dropdown-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

.profile-dropdown-link span {
    font-size: 14px;
    font-weight: 800;
}

.profile-dropdown-link small {
    color: var(--text-muted);
    font-size: 11px;
}

.profile-dropdown-link:hover {
    background: rgba(107, 45, 50, 0.32);
}

.profile-dropdown-link.is-danger span {
    color: #ffd9dc;
}

.logout-btn {
    color: #ffd9dc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(107, 45, 50, 0.2);
    border: 1px solid rgba(107, 45, 50, 0.4);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}
.logout-btn:hover {
    background: rgba(107, 45, 50, 0.52);
    color: #fff;
}

html.theme-light .top-navbar {
    background: rgba(247, 246, 239, 0.84);
    border-bottom-color: rgba(20, 20, 16, 0.12);
    box-shadow: 0 12px 35px rgba(20, 20, 16, 0.08);
}

html.theme-light .nav-item:hover {
    background: rgba(40, 52, 105, 0.08);
    color: var(--navy-primary);
}

html.theme-light .nav-item.active {
    background: linear-gradient(135deg, rgba(40, 52, 105, 0.16) 0%, rgba(251, 224, 102, 0.14) 100%);
    border-color: rgba(40, 52, 105, 0.16);
    color: var(--navy-primary);
}

html.theme-light .nav-dropdown-menu,
html.theme-light .profile-dropdown-menu {
    background: rgba(247, 246, 239, 0.98);
    border-color: rgba(20, 20, 16, 0.12);
    box-shadow: 0 18px 46px rgba(20, 20, 16, 0.16);
}

html.theme-light .nav-dropdown-item:hover,
html.theme-light .nav-dropdown-item.active {
    background: rgba(40, 52, 105, 0.11);
    color: var(--navy-primary);
}

html.theme-light .theme-toggle,
html.theme-light .profile-toggle {
    background: rgba(255, 255, 250, 0.76);
    border-color: rgba(20, 20, 16, 0.13);
    color: var(--navy-primary);
}

html.theme-light .theme-toggle:hover,
html.theme-light .profile-toggle:hover,
html.theme-light .profile-menu:focus-within .profile-toggle {
    background: rgba(251, 224, 102, 0.22);
    border-color: rgba(40, 52, 105, 0.18);
}

html.theme-light .profile-dropdown-link:hover {
    background: rgba(107, 45, 50, 0.1);
}

html.theme-light .profile-dropdown-link.is-danger span {
    color: var(--burgundy-sold);
}

/* ==========================================================================
   Mobile Navigation Menu & Drawer
   ========================================================================== */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: rgba(20, 20, 16, 0.56);
    border: 1px solid rgba(163, 163, 159, 0.16);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    transition: var(--transition-fast);
}
.mobile-nav-toggle:hover {
    background: rgba(40, 52, 105, 0.3);
    border-color: rgba(251, 224, 102, 0.3);
}
.hamburger-bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 86vw);
    background: rgba(18, 18, 15, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid var(--glass-border);
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.mobile-nav-drawer.is-open {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.mobile-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mobile-user-info {
    display: flex;
    flex-direction: column;
}
.mobile-user-info strong {
    font-size: 15px;
    color: var(--text-light);
}
.mobile-user-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.mobile-role-badge {
    background: rgba(251, 224, 102, 0.12);
    color: var(--yellow-highlight);
    border: 1px solid rgba(251, 224, 102, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mobile-emp-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-family: monospace;
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.mobile-nav-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

.mobile-nav-group-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    margin-bottom: 10px;
    padding-left: 6px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-light);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: var(--transition-fast);
}
.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}
.mobile-nav-item.active {
    background: linear-gradient(135deg, rgba(40, 52, 105, 0.6) 0%, rgba(40, 52, 105, 0.2) 100%);
    border-color: rgba(251, 224, 102, 0.35);
    color: var(--yellow-highlight);
}
.mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
.mobile-nav-label {
    display: flex;
    flex-direction: column;
}
.mobile-nav-label span {
    font-size: 14px;
    font-weight: 700;
}
.mobile-nav-label small {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.mobile-nav-item.active .mobile-nav-label small {
    color: rgba(251, 224, 102, 0.7);
}

.mobile-nav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}
.mobile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: rgba(107, 45, 50, 0.25);
    border: 1px solid rgba(107, 45, 50, 0.5);
    border-radius: var(--radius-md);
    color: #ffd9dc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition-fast);
}
.mobile-logout-btn:hover {
    background: rgba(107, 45, 50, 0.55);
    color: #fff;
}

/* Light Mode Styles for Mobile Nav */
html.theme-light .mobile-nav-drawer {
    background: rgba(247, 246, 239, 0.98);
    border-left-color: rgba(20, 20, 16, 0.12);
}
html.theme-light .mobile-nav-header {
    background: rgba(20, 20, 16, 0.03);
    border-bottom-color: rgba(20, 20, 16, 0.1);
}
html.theme-light .mobile-nav-toggle {
    background: rgba(255, 255, 250, 0.76);
    border-color: rgba(20, 20, 16, 0.13);
}
html.theme-light .hamburger-bar {
    background-color: var(--navy-primary);
}
html.theme-light .mobile-nav-item {
    background: rgba(20, 20, 16, 0.03);
}
html.theme-light .mobile-nav-item:hover {
    background: rgba(40, 52, 105, 0.08);
}
html.theme-light .mobile-nav-item.active {
    background: linear-gradient(135deg, rgba(40, 52, 105, 0.16) 0%, rgba(251, 224, 102, 0.18) 100%);
    border-color: rgba(40, 52, 105, 0.22);
    color: var(--navy-primary);
}
html.theme-light .mobile-nav-item.active .mobile-nav-label small {
    color: var(--navy-primary);
}
html.theme-light .mobile-nav-footer {
    background: rgba(20, 20, 16, 0.03);
    border-top-color: rgba(20, 20, 16, 0.1);
}

/* Responsive Breakpoints for Mobile Navigation */
@media (max-width: 991px) {
    .desktop-nav,
    .desktop-profile {
        display: none !important;
    }
    .top-navbar {
        padding: 0 16px;
        min-height: 64px;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px;
    }
    .navbar-logo {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
    }
    .navbar-brand-link {
        gap: 8px;
        align-items: baseline;
    }
    .navbar-logo strong {
        font-size: 26px;
        letter-spacing: -1.5px;
        line-height: 1;
    }
    .navbar-logo span {
        font-size: 8.5px;
        max-width: 110px;
        line-height: 1.1;
        letter-spacing: 0.8px;
        display: inline-block;
    }
    .navbar-right {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }
    .theme-toggle {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        margin: 0;
    }
    .mobile-nav-toggle {
        display: inline-flex;
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        margin: 0;
    }
    .main-content {
        padding: 16px 14px;
    }
}

@media (max-width: 480px) {
    .top-navbar {
        padding: 0 12px;
        min-height: 58px;
    }
    .navbar-logo strong {
        font-size: 23px;
    }
    .navbar-logo span {
        font-size: 7.5px;
        max-width: 85px;
        line-height: 1.05;
    }
    .theme-toggle,
    .mobile-nav-toggle {
        width: 36px;
        height: 36px;
    }
}

/* Main Content Area (Full Width) */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 35px 50px;
    position: relative;
    width: 100%;
}
.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.34);
}

/* Top Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    background: linear-gradient(145deg, rgba(20,20,16,0.78) 0%, rgba(20,20,16,0.92) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-slow);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 224, 102, 0.24);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
}
.stat-card.total::before { background: var(--text-muted); }
.stat-card.available::before { background: rgba(22, 163, 74, 0.9); }
.stat-card.reserved::before { background: var(--yellow-highlight); }
.stat-card.hold::before { background: rgba(249, 115, 22, 0.95); }
.stat-card.under-contracted::before { background: rgba(127, 29, 29, 0.95); }
.stat-card.sold::before,
.stat-card.contracted::before { background: rgba(220, 38, 38, 0.9); }
.stat-card.closed::before { background: rgba(107, 114, 128, 0.95); }

.stat-card h4 {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 10px;
}
.stat-card .value {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

/* Premium Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.unit-card {
    background: rgba(20, 20, 16, 0.72);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    position: relative;
    transition: var(--transition-slow);
    cursor: pointer;
    overflow: hidden;
}
.unit-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: var(--transition-slow);
    z-index: -1;
}

.unit-card:hover {
    transform: translateY(-6px);
    border-color: rgba(251, 224, 102, 0.22);
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.44);
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.unit-code {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}
.unit-type {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 400;
}

.status-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.pill-available {
    background: rgba(22, 163, 74, 0.24);
    color: #bbf7d0;
    border: 1px solid rgba(22, 163, 74, 0.5);
}
.pill-reserved {
    background: rgba(251, 224, 102, 0.1);
    color: var(--yellow-highlight);
    border: 1px solid rgba(251, 224, 102, 0.3);
}
.pill-hold {
    background: rgba(249, 115, 22, 0.18);
    color: #fed7aa;
    border: 1px solid rgba(249, 115, 22, 0.45);
}
.pill-sold,
.pill-contracted {
    background: rgba(220, 38, 38, 0.22);
    color: #fecaca;
    border: 1px solid rgba(220, 38, 38, 0.5);
}
.pill-under-contract,
.pill-under-contracted {
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
    border: 1px solid rgba(127, 29, 29, 0.55);
}
.pill-closed {
    background: rgba(107, 114, 128, 0.24);
    color: #e5e7eb;
    border: 1px solid rgba(156, 163, 175, 0.48);
}

.unit-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}
.detail-item {
    font-size: 13px;
    color: var(--text-muted);
}
.detail-item strong {
    display: block;
    color: var(--text-light);
    font-size: 15px;
    margin-top: 3px;
    font-weight: 600;
}

.unit-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 5px;
}
.unit-currency {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
}
.unit-plan {
    font-size: 13px;
    color: var(--yellow-highlight);
    background: rgba(251, 224, 102, 0.05);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    display: inline-block;
    margin-top: 15px;
    border: 1px solid rgba(251, 224, 102, 0.1);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 25px;
}
.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.form-control {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition-fast);
}
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    color-scheme: dark;
    padding-right: 46px;
    background-color: #11110f;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--yellow-highlight) 50%),
        linear-gradient(135deg, var(--yellow-highlight) 50%, transparent 50%),
        linear-gradient(135deg, rgba(163, 163, 159, 0.16), rgba(163, 163, 159, 0.08));
    background-position:
        calc(100% - 22px) 50%,
        calc(100% - 16px) 50%,
        calc(100% - 44px) 50%;
    background-size:
        6px 6px,
        6px 6px,
        1px 28px;
    background-repeat: no-repeat;
}
select.form-control:hover {
    border-color: rgba(251, 224, 102, 0.28);
    background-color: #141410;
}
select.form-control option {
    background-color: #141410;
    color: #f7f7f2;
    padding: 12px 16px;
}
select.form-control option:checked {
    background-color: #283469;
    color: #ffffff;
}
select.form-control option:hover {
    background-color: #22221d;
    color: #ffffff;
}
select.form-control option:disabled {
    background-color: #141410;
    color: #777772;
}
select.form-control::-ms-expand {
    display: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--navy-primary);
    background-color: rgba(40, 52, 105, 0.14);
    box-shadow: 0 0 0 4px rgba(40, 52, 105, 0.24);
}
select.form-control:focus {
    border-color: rgba(251, 224, 102, 0.44);
    background-color: #11110f;
    box-shadow: 0 0 0 4px rgba(251, 224, 102, 0.1);
}

.btn {
    padding: 16px 28px;
    border-radius: var(--radius-md);
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    letter-spacing: 1px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--navy-primary) 0%, #1d254f 100%);
    color: white;
    border: 1px solid rgba(251, 224, 102, 0.16);
    box-shadow: 0 10px 24px rgba(40, 52, 105, 0.34);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(40, 52, 105, 0.52);
}

/* Premium Table View */
.table-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.inventory-table th {
    background: rgba(20, 20, 16, 0.92);
    padding: 18px 20px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
}

.inventory-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    vertical-align: middle;
    transition: var(--transition-fast);
}

.inventory-table tbody tr {
    transition: var(--transition-fast);
}

.inventory-table tbody tr:hover {
    background: rgba(163, 163, 159, 0.06);
}

.unit-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(251, 224, 102, 0.1);
    color: var(--yellow-highlight);
    border: 1px solid rgba(251, 224, 102, 0.3);
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.unit-code-badge:hover {
    background: var(--yellow-highlight);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(251, 224, 102, 0.4);
}

/* Modal Overlay & Card Details */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: #141410;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s var(--ease-out);
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(40, 52, 105, 0.18);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.modal-field {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.modal-field label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 5px;
}

.modal-field .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-light);
}

.modal-field.highlight .value {
    color: var(--yellow-highlight);
    font-size: 22px;
}

.settings-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.settings-tabs {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: rgba(20, 20, 16, 0.72);
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 14px;
    transition: var(--transition-fast);
}

.settings-tab:hover,
.settings-tab.active {
    background: rgba(40, 52, 105, 0.42);
}

.settings-tab-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--yellow-highlight);
    box-shadow: 0 0 12px rgba(251, 224, 102, 0.45);
}

.settings-tab strong,
.settings-tab small {
    display: block;
}

.settings-tab strong {
    font-size: 14px;
}

.settings-tab small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.settings-content {
    min-height: 320px;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--glass-border);
}

.settings-section-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.settings-section-header p {
    margin: 0;
    color: var(--text-muted);
}

.settings-success-message {
    margin-bottom: 18px;
    padding: 13px 14px;
    color: var(--yellow-highlight);
    background: rgba(40, 52, 105, 0.2);
    border: 1px solid rgba(251, 224, 102, 0.28);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.settings-link-card {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
    padding: 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.22);
}

.settings-link-card span {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.settings-link-card code {
    color: var(--yellow-highlight);
    white-space: nowrap;
    overflow-x: auto;
    font-size: 13px;
}

.settings-form {
    display: grid;
    gap: 22px;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.settings-toggle-row strong,
.settings-toggle-row small {
    display: block;
}

.settings-toggle-row strong {
    color: var(--text-light);
    font-size: 15px;
}

.settings-toggle-row small {
    margin-top: 5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.settings-toggle-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--yellow-highlight);
    flex: 0 0 auto;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

html.theme-light .glass-panel,
html.theme-light .table-wrapper,
html.theme-light .settings-tabs {
    background: rgba(255, 255, 250, 0.76);
    border-color: rgba(20, 20, 16, 0.12);
    box-shadow: 0 18px 46px rgba(20, 20, 16, 0.1);
}

html.theme-light .stat-card {
    background: linear-gradient(145deg, rgba(255, 255, 250, 0.82) 0%, rgba(247, 246, 239, 0.96) 100%);
    box-shadow: 0 14px 34px rgba(20, 20, 16, 0.1);
}

html.theme-light .stat-card:hover,
html.theme-light .unit-card:hover {
    box-shadow: 0 22px 46px rgba(20, 20, 16, 0.13);
}

html.theme-light .unit-card {
    background: rgba(255, 255, 250, 0.76);
    box-shadow: 0 14px 34px rgba(20, 20, 16, 0.08);
}

html.theme-light .form-control {
    background: rgba(255, 255, 250, 0.74);
    color: #141410;
    border-color: rgba(20, 20, 16, 0.14);
}

html.theme-light .form-control:focus {
    background-color: rgba(255, 255, 250, 0.94);
    border-color: rgba(40, 52, 105, 0.34);
    box-shadow: 0 0 0 4px rgba(40, 52, 105, 0.12);
}

html.theme-light select.form-control {
    color-scheme: light;
    background-color: #f7f6ef;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--navy-primary) 50%),
        linear-gradient(135deg, var(--navy-primary) 50%, transparent 50%),
        linear-gradient(135deg, rgba(20, 20, 16, 0.12), rgba(20, 20, 16, 0.06));
}

html.theme-light select.form-control:hover,
html.theme-light select.form-control:focus {
    background-color: #ffffff;
}

html.theme-light select.form-control option {
    background-color: #ffffff;
    color: #141410;
}

html.theme-light select.form-control option:checked {
    background-color: var(--navy-primary);
    color: #ffffff;
}

html.theme-light .inventory-table th {
    background: rgba(20, 20, 16, 0.06);
    color: #666862;
}

html.theme-light .inventory-table td {
    border-bottom-color: rgba(20, 20, 16, 0.08);
}

html.theme-light .inventory-table tbody tr:hover {
    background: rgba(40, 52, 105, 0.06);
}

html.theme-light .unit-code-badge {
    background: rgba(40, 52, 105, 0.08);
    color: var(--navy-primary);
    border-color: rgba(40, 52, 105, 0.16);
}

html.theme-light .unit-code-badge:hover {
    background: var(--yellow-highlight);
    color: #141410;
}

html.theme-light .modal-overlay {
    background: rgba(20, 20, 16, 0.38);
}

html.theme-light .modal-container {
    background: #f7f6ef;
    box-shadow: 0 25px 50px rgba(20, 20, 16, 0.24);
}

html.theme-light .modal-header {
    background: rgba(40, 52, 105, 0.08);
}

html.theme-light .modal-close {
    background: rgba(20, 20, 16, 0.08);
    color: #141410;
}

html.theme-light .modal-close:hover {
    background: rgba(20, 20, 16, 0.14);
}

html.theme-light .modal-field,
html.theme-light .settings-toggle-row,
html.theme-light .settings-link-card {
    background: rgba(255, 255, 250, 0.58);
    border-color: rgba(20, 20, 16, 0.12);
}

html.theme-light .settings-tab:hover,
html.theme-light .settings-tab.active {
    background: rgba(40, 52, 105, 0.1);
}

html.theme-light .settings-success-message {
    color: var(--navy-primary);
    background: rgba(251, 224, 102, 0.22);
    border-color: rgba(40, 52, 105, 0.14);
}

html.theme-light .mp-top-section,
html.theme-light .editor-top-bar {
    box-shadow: 0 16px 34px rgba(20, 20, 16, 0.08);
}

html.theme-light .mp-btn,
html.theme-light .editor-btn {
    background: rgba(255, 255, 250, 0.64);
    color: var(--mp-ink, var(--editor-ink));
}

html.theme-light .mp-btn:hover,
html.theme-light .editor-btn:hover {
    background: rgba(40, 52, 105, 0.08);
}

html.theme-light .mp-btn.is-active,
html.theme-light .editor-btn.is-active {
    background: rgba(40, 52, 105, 0.14);
    color: var(--navy-primary);
    box-shadow: 0 4px 12px rgba(40, 52, 105, 0.12);
}

html.theme-light .mp-stat-pill {
    background: rgba(255, 255, 250, 0.66);
    color: var(--mp-muted);
}

html.theme-light .mp-stat-pill strong {
    color: var(--mp-ink);
}

html.theme-light .masterplan-wrapper .form-control,
html.theme-light .editor-wrapper .form-control {
    background: rgba(255, 255, 250, 0.72) !important;
    color: #141410 !important;
    border-color: var(--mp-line, var(--editor-line)) !important;
}

html.theme-light .editor-top-bar h2 {
    color: var(--editor-ink) !important;
}

html.theme-light .unit-quick-toolbar {
    background: rgba(247, 246, 239, 0.96);
    box-shadow: 0 15px 40px rgba(20, 20, 16, 0.18);
}

html.theme-light .editor-message {
    box-shadow: 0 12px 28px rgba(20, 20, 16, 0.16);
}

html.theme-light .report-live-status,
html.theme-light .report-tab,
html.theme-light .report-card,
html.theme-light .report-chart,
html.theme-light .commission-my-status-card,
html.theme-light .commission-status-leader-card,
html.theme-light .commission-team-card,
html.theme-light .commission-kpi-status-chip,
html.theme-light .control-intro,
html.theme-light .control-building-card,
html.theme-light .control-status-mini,
html.theme-light .control-block-detail,
html.theme-light .control-filter-bar,
html.theme-light .control-leader-card,
html.theme-light .report-breakdown-card,
html.theme-light .report-table-wrapper,
html.theme-light .report-empty {
    background: rgba(255, 255, 250, 0.72);
    border-color: rgba(20, 20, 16, 0.12);
    box-shadow: 0 12px 30px rgba(20, 20, 16, 0.08);
}

html.theme-light .report-total-card,
html.theme-light .report-paid-card {
    background: linear-gradient(135deg, rgba(40, 52, 105, 0.1), rgba(255, 255, 250, 0.82));
}

html.theme-light .report-tab:hover,
html.theme-light .report-tab.is-active {
    background: rgba(251, 224, 102, 0.24);
    color: var(--navy-primary);
}

@media (max-width: 1100px) {
    .top-navbar {
        padding: 14px 20px;
        gap: 16px;
    }

    .navbar-logo span {
        display: none;
    }

    .navbar-nav {
        gap: 8px;
    }

    .nav-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .main-content {
        padding: 26px 22px 34px;
    }
}

@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .app-wrapper {
        min-height: 100vh;
        height: auto;
    }

    .top-navbar {
        position: sticky;
        top: 0;
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
        padding: 16px;
    }

    .navbar-logo {
        justify-content: space-between;
    }

    .navbar-logo span {
        display: block;
        max-width: 148px;
        text-align: right;
    }

    .navbar-nav {
        overflow: visible;
        flex-wrap: wrap;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .nav-item {
        flex: 0 0 auto;
    }

    .nav-dropdown {
        flex: 0 0 auto;
    }

    .nav-dropdown-menu {
        left: 0;
        right: auto;
        min-width: min(260px, calc(100vw - 32px));
    }

    .navbar-right {
        justify-content: flex-end;
        gap: 12px;
    }

    .profile-dropdown-menu {
        right: 0;
        min-width: min(270px, calc(100vw - 32px));
    }

    .main-content {
        overflow: visible;
        padding: 20px 14px 32px;
    }

    .login-screen {
        position: fixed;
        overflow-y: auto;
        align-items: flex-start;
        padding: 28px 16px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .login-brand {
        min-height: auto;
        padding-top: 24px;
        text-align: center;
    }

    .login-tagline {
        margin: 16px auto 0;
        font-size: 14px;
    }

    .login-card {
        padding: 30px 22px;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 22px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card .value {
        font-size: 32px;
    }

    .inventory-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .unit-card {
        padding: 20px;
    }

    .unit-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .inventory-table {
        min-width: 720px;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .modal-container {
        max-height: 92vh;
        border-radius: 20px;
    }

    .modal-header,
    .modal-body {
        padding: 18px;
    }

    .modal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-shell {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .settings-tabs {
        position: static;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 10px;
        scrollbar-width: thin;
    }

    .settings-tab {
        min-width: 220px;
    }

    .settings-section-header,
    .settings-toggle-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-actions {
        justify-content: stretch;
    }

    .settings-actions .btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .navbar-logo strong {
        font-size: 30px;
    }

    .navbar-logo span {
        max-width: 124px;
        font-size: 9px;
    }

    .profile-summary {
        display: none;
    }

    .profile-toggle {
        padding: 5px 9px 5px 5px;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .unit-header {
        gap: 12px;
        flex-direction: column;
    }

    .status-pill {
        align-self: flex-start;
    }

    .form-control {
        font-size: 16px;
    }

    .btn {
        width: 100%;
    }
}
