/* ============================================
   MANZIL PROJECTS - Saudi Real Estate
   Stylesheet - Organized Color System
   ============================================ */

/* ---------- 1. CSS Variables (Blue + Amber) ---------- */
:root {
    /* Primary (blue) */
    --primary-color: #2029c9;
    --primary-dark: #181f9e;
    --primary-light: #4338ca;
    --primary-muted: rgba(32, 41, 201, 0.12);

    /* Accent (amber) */
    --accent-color: #f59e0b;
    --accent-dark: #d97706;
    --accent-light: #fbbf24;
    --accent-muted: rgba(245, 158, 11, 0.15);

    /* Secondary / semantic */
    --secondary-color: #0f172a;
    --secondary-dark: #0b1220;
    --success-color: #059669;
    --success-green: #10b981;
    --success-green-dark: #047857;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --danger-color: #dc2626;
    --danger-dark: #b91c1c;
    --info-color: #2029c9;
    --info-dark: #181f9e;
    --teal-color: #0d9488;
    --purple-accent: #7c3aed;
    --purple-dark: #5b21b6;

    /* Neutrals */
    --light-color: #f8fafc;
    --dark-color: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 6px 12px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 16px 30px rgba(15, 23, 42, 0.12), 0 6px 12px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 30px 60px rgba(15, 23, 42, 0.16), 0 12px 24px rgba(15, 23, 42, 0.08);
    --shadow-3d: 0 20px 40px rgba(15, 23, 42, 0.14), 0 12px 20px rgba(15, 23, 42, 0.08);

    /* Border radius */
    --border-radius-sm: 10px;
    --border-radius-md: 14px;
    --border-radius-lg: 18px;
    --border-radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Focus ring */
    --focus-ring: 0 0 0 3px rgba(32, 41, 201, 0.25);

    /* Sidebar width (compact panel) */
    --sidebar-width: 220px;

    /* Page background */
    --bg-color-1: #e3e9ff;
    --bg-color-2: #ffe6d1;

    /* 3D depth */
    --shadow-3d-strong: 0 28px 60px rgba(15, 23, 42, 0.18), 0 12px 24px rgba(15, 23, 42, 0.1);
    --shadow-depth: 0 12px 30px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Ripple effect for touch/click feedback */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: rippleExpand 0.5s ease-out forwards;
    pointer-events: none;
}
.ripple-dark {
    background: rgba(0, 0, 0, 0.12);
}
@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---------- 2. Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(1200px 800px at 10% 0%, rgba(32, 41, 201, 0.12), transparent 60%),
        radial-gradient(900px 700px at 90% 10%, rgba(245, 158, 11, 0.14), transparent 55%),
        linear-gradient(135deg, var(--bg-color-1) 0%, var(--bg-color-2) 100%);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    height: 100vh;
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    perspective: 1200px;
    transform-style: preserve-3d;
}

body.sidebar-visible {
    padding-left: var(--sidebar-width);
    transition: padding-left var(--transition-normal);
}

.page-qhse {
    position: fixed;
    top: 34px;
    right: 540px;
    z-index: 910;
    padding: 10px 16px;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    text-align: center;
    cursor: pointer;
}

.qhse-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--primary-dark);
    white-space: nowrap;
    animation: none;
}

.qhse-emojis {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qhse-emoji {
    display: inline-block;
    font-size: 1.1rem;
    animation: none;
    transform: scale(1.35);
    transform-origin: center;
    line-height: 1;
}

.qhse-emoji-2 { animation-delay: 0.18s; }
.qhse-emoji-3 { animation-delay: 0.36s; }
.qhse-emoji-4 { animation-delay: 0.54s; }

@keyframes qhseEmojiFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.08); }
}

.live-datetime-card {
    position: fixed;
    top: 24px;
    right: 16px;
    transform: translateX(-3cm);
    z-index: 910;
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    text-align: center;
    min-width: 150px;
}

.live-datetime-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
    letter-spacing: 0.2px;
}

.live-datetime-time {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.4px;
}

@keyframes qhseWave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}

.left-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background:
        linear-gradient(180deg, rgba(32, 41, 201, 0.1) 0%, rgba(245, 158, 11, 0.08) 100%),
        radial-gradient(200px 240px at 40% 20%, rgba(255, 255, 255, 0.7), transparent 65%);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: inset -12px 0 24px rgba(15, 23, 42, 0.06);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: 0;
}

body.sidebar-visible .left-rail {
    opacity: 1;
}


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(700px 450px at 20% 20%, rgba(255, 255, 255, 0.6), transparent 60%),
        radial-gradient(700px 450px at 80% 10%, rgba(255, 255, 255, 0.4), transparent 55%);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 170px 20px 20px;
    flex: 1;
    position: relative;
    z-index: 1;
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
    width: 100%;
    min-width: 0;
    min-height: 0;
    transition: transform var(--transition-normal);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(800px 500px at 85% 10%, rgba(32, 41, 201, 0.08), transparent 60%),
        radial-gradient(700px 500px at 95% 80%, rgba(245, 158, 11, 0.08), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 6px;
    background: linear-gradient(180deg, rgba(32, 41, 201, 0.12), rgba(245, 158, 11, 0.1));
    border-radius: 6px;
    opacity: 0.6;
    pointer-events: none;
}

.dashboard-card {
    margin: 10px 0 6px;
    padding: 7px 10px;
    max-width: 420px;
    width: 100%;
    margin-left: 200px;
    margin-right: auto;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, rgba(32, 41, 201, 0.12), rgba(245, 158, 11, 0.14));
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: var(--shadow-md);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--primary-dark);
    text-align: center;
    animation: qhseWave 5s ease-in-out infinite;
    animation-direction: reverse;
    animation-delay: -2.5s;
}

.dashboard-title {
    font-size: 1.25rem;
}

.dashboard-subtitle {
    font-size: 0.92rem;
    font-weight: 800;
    color: #f6fbff;
    letter-spacing: 0.2px;
    margin-top: 4px;
    text-shadow: 0 1px 6px rgba(15, 23, 42, 0.35);
    line-height: 1.4;
}

/* ---------- 3. Header (3D depth) ---------- */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 60%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: var(--shadow-3d-strong), 0 6px 0 rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
    transition: transform var(--transition-normal);
    transform-style: preserve-3d;
    transform: translateZ(10px);
    z-index: 1;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-light));
}

.page-logo {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 910;
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.page-logo img {
    width: 185px;
    max-width: 80vw;
    height: 52px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.25));
}

.welcome-banner {
    position: fixed;
    top: 20px;
    left: 260px;
    z-index: 910;
    padding: 0;
    margin: 0;
    display: block;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.welcome-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.2px;
    margin-bottom: 6px;
}

.welcome-brand {
    font-size: 1.35em;
    color: #2029c9;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.welcome-mark {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    margin-left: 6px;
    vertical-align: -0.08em;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.25));
    transform-origin: center;
    animation: welcomeEmojiPop 2.3s ease-in-out infinite;
    animation-delay: 0.3s;
}

.welcome-prefix {
    color: #0f766e;
}

.welcome-emojis {
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-emoji {
    display: inline-block;
    font-size: 1.65rem;
    animation: welcomeFloat 2.2s ease-in-out infinite;
}

.welcome-emoji.emoji-2 { animation-delay: 0.22s; }
.welcome-emoji.emoji-3 { animation-delay: 0.44s; }
.welcome-emoji.emoji-4 { animation-delay: 0.66s; }

@keyframes welcomeFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-7px) scale(1.08);
    }
}


.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.logo-placeholder {
    width: 150px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform var(--transition-slow);
}

.logo-placeholder:hover {
    transform: perspective(1000px) rotateY(5deg);
}

.logo-placeholder i {
    font-size: 2rem;
    color: white;
    opacity: 0.9;
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- 4. Signature / Footer (3D depth) ---------- */
.signature {
    background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
    color: var(--gray-300);
    text-align: center;
    padding: 10px 14px;
    font-size: 0.9rem;
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 100;
    border-top: 3px solid var(--accent-color);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15), 0 -2px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    transition: transform var(--transition-normal);
    transform-style: preserve-3d;
    transform: translateZ(10px);
    display: flex;
    justify-content: center;
}

.signature-card {
    max-width: none;
    width: calc(100% - 40px);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-md);
    padding: 8px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin: 0 20px;
}

.signature .name {
    color: var(--accent-light);
    font-weight: 600;
}

.signature .highlight {
    color: white;
    font-weight: 500;
}

/* ---------- 5. Stats Table ---------- */
.stats-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.75));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--border-radius-lg);
    padding: 14px 14px 10px;
    box-shadow: var(--shadow-sm);
    margin: 10px 0 22px;
}

.stats-container {
    display: block;
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0;
    color: var(--icon-color, var(--card-color, var(--primary-color)));
    background: var(--icon-bg, rgba(255, 255, 255, 0.9));
    border: 1px solid var(--icon-border, var(--card-border, rgba(15, 23, 42, 0.08)));
    flex-shrink: 0;
}

.stats-table-wrap {
    overflow-x: auto;
}

.stats-table-meta {
    font-size: 0.78rem;
    color: var(--gray-600);
    margin: 0 0 8px 4px;
    font-weight: 600;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    border: 1px solid rgba(32, 41, 201, 0.28);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
}

.stats-table thead th {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    padding: 9px 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #2029c9, #2563eb);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.stats-table tbody td {
    background: var(--card-bg, rgba(255, 255, 255, 0.78));
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 6px 10px;
    vertical-align: middle;
}

.stats-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.95);
}

.stat-row {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.stat-row:hover td {
    border-color: var(--card-color, #2563eb);
    background: rgba(239, 246, 255, 0.8);
}

.stat-row.stat-action {
    cursor: pointer;
}

.stat-metric {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-action .view-stats-btn {
    margin-top: 0;
}

.stat-icon i {
    font-size: 1.05rem;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.15));
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--card-color, var(--primary-color));
    line-height: 1;
}

.stats-table tbody td.stat-value {
    text-align: center;
}

.stat-label {
    color: var(--gray-700);
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0;
}

.stat-subtext {
    font-size: 0.7rem;
    color: var(--gray-600);
    margin-top: 6px;
}

.stat-actions {
    width: 200px;
}

.stat-actions .view-stats-btn {
    margin-top: 0;
}

.stats-table .completion-progress-bar {
    max-width: 180px;
}

.stats-table .stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.stats-table .view-stats-btn {
    padding: 4px 8px;
    font-size: 0.66rem;
}

/* Stat card colors: unified */
.cities-stat         { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #2563eb; --icon-bg: rgba(37, 99, 235, 0.12); --icon-border: rgba(37, 99, 235, 0.28); --animation-order: 0; }
.projects-stat       { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #0f766e; --icon-bg: rgba(15, 118, 110, 0.12); --icon-border: rgba(15, 118, 110, 0.28); --animation-order: 1; }
.apartments-stat     { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #7c3aed; --icon-bg: rgba(124, 58, 237, 0.12); --icon-border: rgba(124, 58, 237, 0.28); --animation-order: 2; }
.rooms-stat          { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #2563eb; --icon-bg: rgba(37, 99, 235, 0.12); --icon-border: rgba(37, 99, 235, 0.28); --animation-order: 3; }
.beds-stat           { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #d97706; --icon-bg: rgba(217, 119, 6, 0.14);  --icon-border: rgba(217, 119, 6, 0.3);  --animation-order: 4; }
.used-beds-stat      { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #ef4444; --icon-bg: rgba(239, 68, 68, 0.12);  --icon-border: rgba(239, 68, 68, 0.28); --animation-order: 5; }
.available-beds-stat { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #16a34a; --icon-bg: rgba(22, 163, 74, 0.12);   --icon-border: rgba(22, 163, 74, 0.28);  --animation-order: 6; }
.capacity-stat       { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #0ea5e9; --icon-bg: rgba(14, 165, 233, 0.12);  --icon-border: rgba(14, 165, 233, 0.28); --animation-order: 7; }
.completion-stat     { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #a855f7; --icon-bg: rgba(168, 85, 247, 0.12);  --icon-border: rgba(168, 85, 247, 0.28); --animation-order: 8; }
.last-update-stat    { --card-color: var(--primary-color);   --card-bg: rgba(32, 41, 201, 0.08); --card-border: rgba(32, 41, 201, 0.2);  --icon-color: #0f172a; --icon-bg: rgba(15, 23, 42, 0.08);   --icon-border: rgba(15, 23, 42, 0.2);   --animation-order: 9; }
.reports-stat        { --card-color: var(--teal-color);       --card-bg: rgba(13, 148, 136, 0.1);  --card-border: rgba(13, 148, 136, 0.28); --icon-color: #0f766e; --icon-bg: rgba(15, 118, 110, 0.12); --icon-border: rgba(15, 118, 110, 0.28); --animation-order: 10; }

.completion-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--gray-200);
    border-radius: 10px;
    margin-top: 6px;
    overflow: hidden;
}

.completion-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--card-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.view-stats-btn {
    background: rgba(32, 41, 201, 0.12);
    color: var(--card-color, var(--primary-color));
    border: 1px solid var(--card-border, rgba(32, 41, 201, 0.25));
    padding: 5px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 6px;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.view-stats-btn:hover {
    background: var(--card-color, var(--primary-color));
    color: white;
    transform: translateY(-2px) scale(1.02);
}

.view-stats-btn:active {
    transform: scale(0.97);
}

/* ---------- 6. Section Title ---------- */
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ---------- 7. City Cards ---------- */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.city-card {
    background:
        radial-gradient(180px 120px at 92% 8%, rgba(255, 255, 255, 0.7), transparent 62%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
    border-radius: 20px;
    padding: 18px 18px 16px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1), 0 6px 14px rgba(15, 23, 42, 0.06);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    border: 1px solid var(--city-border, rgba(15, 23, 42, 0.16));
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.city-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--city-color, var(--primary-color)), rgba(255, 255, 255, 0.25));
}

.city-card::after {
    content: '';
    position: absolute;
    top: 10px;
    right: -35px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(32, 41, 201, 0.12), transparent 70%);
    pointer-events: none;
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.14), 0 10px 18px rgba(15, 23, 42, 0.08);
    border-color: var(--city-color, var(--primary-color));
}

.city-card:active {
    transform: translateY(-2px) scale(0.995);
    box-shadow: var(--shadow-sm);
}

.city-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--city-color, var(--primary-color));
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.city-description {
    color: var(--gray-600);
    font-size: 0.82rem;
    margin-bottom: 12px;
    line-height: 1.5;
    min-height: 2.5em;
}

.city-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
}

.city-stat-item {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 249, 0.86));
    border-radius: 12px;
    padding: 9px 6px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.24);
    transition: all var(--transition-fast);
    transform-style: preserve-3d;
}

.city-stat-item:hover {
    transform: translateY(-2px);
    border-color: rgba(32, 41, 201, 0.28);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.city-stat-value {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--city-color, var(--primary-color));
    margin-bottom: 2px;
    line-height: 1.1;
}

.city-stat-label {
    font-size: 0.68rem;
    color: var(--gray-600);
    font-weight: 600;
    letter-spacing: 0.2px;
}

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

@media (max-width: 560px) {
    .cities-grid {
        grid-template-columns: 1fr;
    }
    .city-card {
        padding: 16px 14px 14px;
    }
}

/* City cards: unified */
.riyadh-card { --city-color: var(--primary-color);   --city-bg: rgba(32, 41, 201, 0.08); --city-border: rgba(32, 41, 201, 0.2); }
.jeddah-card { --city-color: var(--primary-color);   --city-bg: rgba(32, 41, 201, 0.08); --city-border: rgba(32, 41, 201, 0.2); }
.dammam-card { --city-color: var(--primary-color);   --city-bg: rgba(32, 41, 201, 0.08); --city-border: rgba(32, 41, 201, 0.2); }
.other-card  { --city-color: var(--primary-color);   --city-bg: rgba(32, 41, 201, 0.08); --city-border: rgba(32, 41, 201, 0.2); }

/* ---------- 8. Project & Apartment Grids ---------- */
.project-groups-grid,
.projects-grid,
.apartments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}


.project-group-card,
.project-card,
.apartment-card {
    background: var(--group-bg, rgba(255, 255, 255, 0.78));
    border-radius: var(--border-radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-depth);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    border: 1px solid var(--group-border, rgba(15, 23, 42, 0.12));
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    transform: perspective(1000px) translateZ(0) rotateX(1deg);
}

.apartment-card {
    --unit-accent: var(--primary-color);
}

.apartment-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--unit-accent), rgba(255, 255, 255, 0.7));
}

.apartment-card[data-unit-type="room"] {
    --unit-accent: var(--accent-color);
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 235, 0.96));
}

.unit-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-right: 52px;
}

.unit-card-title-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.apartment-number {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--unit-accent);
    line-height: 1.2;
    word-break: break-word;
}

.unit-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.unit-type-badge--apartment {
    background: rgba(32, 41, 201, 0.1);
    color: var(--primary-color);
}

.unit-type-badge--room {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.apartment-status {
    white-space: nowrap;
    text-transform: capitalize;
}

.unit-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unit-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    color: var(--gray-600);
    font-size: 0.88rem;
}

.unit-card-row span:last-child {
    color: var(--gray-800);
    font-weight: 600;
    text-align: right;
}

.unit-capacity-box {
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    background: var(--gray-100);
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unit-capacity-value {
    color: var(--unit-accent);
    font-weight: 700;
}

.double-bed-icon-stack {
    display: inline-flex;
    flex-direction: column;
    line-height: 0.8;
    vertical-align: middle;
    margin-left: 4px;
    font-size: 0.8rem;
}

.unit-card-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.floor-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 34px 20px;
    color: var(--gray-500);
}

.project-group-card::before,
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--group-color, var(--primary-color));
}

.project-group-card:hover,
.project-card:hover,
.apartment-card:hover {
    transform: perspective(1000px) translateY(-6px) translateZ(18px) rotateY(4deg) rotateX(3deg);
    box-shadow: var(--shadow-3d-strong);
    border-color: var(--group-color, var(--primary-color));
}

.project-group-card:active,
.project-card:active,
.apartment-card:active {
    transform: perspective(1000px) scale(0.98) translateZ(0);
    box-shadow: var(--shadow-sm);
}

.comment-thread-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(32, 41, 201, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.comment-thread-btn:hover {
    background: rgba(32, 41, 201, 0.08);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.comment-thread-btn.has-open-thread {
    border-color: rgba(220, 38, 38, 0.6);
    background: rgba(254, 226, 226, 0.95);
    color: #b91c1c;
}

.comment-thread-btn.has-open-thread::after {
    content: attr(data-open-thread-count);
    position: absolute;
    top: -8px;
    left: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.comment-thread-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.comment-thread-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.city-card > .comment-thread-btn,
.project-group-card > .comment-thread-btn,
.project-card > .comment-thread-btn,
.apartment-card > .comment-thread-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.comment-target-host {
    position: relative;
}

.comment-target-host > .comment-thread-btn[data-auto-comment="1"] {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
}

.comment-target-inline-host {
    position: relative;
}

.has-open-comment-thread {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.24), var(--shadow-3d, 0 10px 24px rgba(15, 23, 42, 0.16));
}

.comment-context-focus {
    animation: commentContextFocusPulse 1.2s ease;
}

@keyframes commentContextFocusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.48), var(--shadow-3d, 0 10px 24px rgba(15, 23, 42, 0.16));
    }
    100% {
        box-shadow: 0 0 0 14px rgba(220, 38, 38, 0), var(--shadow-3d, 0 10px 24px rgba(15, 23, 42, 0.16));
    }
}

.comment-thread-inline-trigger {
    position: absolute !important;
    top: 8px;
    right: 8px;
    z-index: 5;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
}

.comment-table-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px 0;
}

#commentsBtn {
    position: relative;
}

#commentsBtn .comments-btn-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

#commentsBtn.has-unread-comments {
    border-color: rgba(220, 38, 38, 0.5);
}

.group-name,
.project-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--group-color, var(--primary-color));
    margin-bottom: 8px;
}

.group-info,
.project-location {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.group-stats,
.project-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

























.stat-badge {
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-700);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--gray-200);
}

.stat-badge i {
    font-size: 0.9em;
    opacity: 0.95;
}

.beds-info {
    background: rgba(76, 201, 240, 0.1);
    border-color: rgba(76, 201, 240, 0.3);
    color: var(--success-color);
}

.kitchen-badge {
    background: rgba(248, 150, 30, 0.1);
    border-color: rgba(248, 150, 30, 0.3);
    color: var(--warning-color);
}

.bathroom-badge {
    background: rgba(67, 97, 238, 0.1);
    border-color: rgba(67, 97, 238, 0.3);
    color: var(--primary-color);
}

.capacity-badge {
    background: rgba(114, 9, 183, 0.1);
    border-color: rgba(114, 9, 183, 0.3);
    color: var(--secondary-color);
}

/* ---------- 9. Buttons ---------- */
.back-btn {
    background: rgba(255, 255, 255, 0.92);
    color: var(--gray-700);
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transform-style: preserve-3d;
}

.back-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(-5px) translateZ(5px);
}

.back-btn:active {
    transform: translateX(-2px) scale(0.98);
}

/* ---------- 10. Auth: Bottom-left button + popover ---------- */
.auth-trigger-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    font-family: 'Space Grotesk', sans-serif;
}

.auth-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(32, 41, 201, 0.25);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.auth-trigger-btn.hidden {
    display: none !important;
}

.auth-panel {
    display: none;
    position: fixed;
    bottom: 70px;
    left: 24px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    width: 320px;
    text-align: center;
    animation: authPopoverIn 0.25s ease;
}

.auth-panel.visible {
    display: block;
}

@keyframes authPopoverIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-panel p {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.auth-input + .auth-input {
    margin-top: -2px;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.auth-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
    box-shadow: var(--shadow-md);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-btn:active,
.auth-trigger-btn:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

/* ---------- 11. Admin Panel: Compact sidebar, matches page colors ---------- */
.admin-panel {
    position: fixed;
    top: 72px;
    left: 0;
    width: calc(var(--sidebar-width) - 6px);
    height: calc(100vh - 72px);
    border-radius: var(--border-radius-xl);
    background:
        radial-gradient(180px 220px at 20% 15%, rgba(32, 41, 201, 0.12), transparent 60%),
        radial-gradient(200px 240px at 80% 85%, rgba(245, 158, 11, 0.12), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.84) 100%);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: var(--shadow-lg), 10px 0 30px rgba(15, 23, 42, 0.08);
    z-index: 900;
    overflow: hidden;
    display: none;
    flex-direction: column;
    padding-bottom: 10px;
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.admin-panel.active {
    display: flex;
}

.admin-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.admin-panel::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: calc(var(--border-radius-xl) - 6px);
    border: 1px dashed rgba(32, 41, 201, 0.15);
    pointer-events: none;
}


.admin-panel .admin-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--gray-800);
    padding: 8px 12px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(32, 41, 201, 0.12);
    flex-shrink: 0;
}

.admin-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px 6px;
    flex: 1;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.85);
    color: var(--gray-700);
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 5px 8px;
    border-radius: var(--border-radius-md);
    font-size: 0.67rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    text-align: left;
    width: 100%;
    min-height: 33px;
    line-height: 1.1;
    white-space: nowrap;
    flex-wrap: nowrap;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.admin-btn:hover {
    background: linear-gradient(135deg, rgba(32, 41, 201, 0.12), rgba(245, 158, 11, 0.12));
    color: var(--primary-dark);
    border-color: rgba(32, 41, 201, 0.5);
    transform: translateX(2px);
    box-shadow: var(--shadow-md);
}

.admin-btn:active {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.admin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.85);
    color: var(--gray-700);
    border-color: rgba(15, 23, 42, 0.12);
    transform: none;
    box-shadow: none;
}

.admin-btn-stats {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.22), rgba(14, 165, 233, 0.2));
    border-color: rgba(15, 118, 110, 0.45);
    color: #0f766e;
}

.admin-btn-stats i {
    background: rgba(15, 118, 110, 0.16);
    border-color: rgba(15, 118, 110, 0.35);
    color: #0f766e;
}

.admin-btn-stats:hover {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.3), rgba(14, 165, 233, 0.28));
    border-color: rgba(14, 116, 144, 0.6);
    color: #115e59;
}

.admin-btn-stats.active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.35), rgba(56, 189, 248, 0.3));
    border-color: rgba(15, 118, 110, 0.7);
    color: #134e4a;
}

.admin-btn-reports {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), rgba(249, 115, 22, 0.18));
    border-color: rgba(194, 65, 12, 0.45);
    color: #9a3412;
}

.admin-btn-reports i {
    background: rgba(194, 65, 12, 0.14);
    border-color: rgba(194, 65, 12, 0.35);
    color: #c2410c;
}

.admin-btn-reports:hover {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.3), rgba(249, 115, 22, 0.28));
    border-color: rgba(154, 52, 18, 0.65);
    color: #7c2d12;
}

.admin-btn-hse {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(239, 68, 68, 0.18));
    border-color: rgba(153, 27, 27, 0.45);
    color: #991b1b;
}

.admin-btn-hse i {
    background: rgba(185, 28, 28, 0.14);
    border-color: rgba(185, 28, 28, 0.35);
    color: #b91c1c;
}

.admin-btn-hse:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(239, 68, 68, 0.28));
    border-color: rgba(127, 29, 29, 0.65);
    color: #7f1d1d;
}

.admin-btn-weekly {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.2), rgba(16, 185, 129, 0.2));
    border-color: rgba(5, 150, 105, 0.45);
    color: #065f46;
}

.admin-btn-weekly i {
    background: rgba(5, 150, 105, 0.14);
    border-color: rgba(5, 150, 105, 0.35);
    color: #047857;
}

.admin-btn-weekly:hover {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.3), rgba(16, 185, 129, 0.28));
    border-color: rgba(6, 95, 70, 0.65);
    color: #064e3b;
}

.admin-btn-add {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(99, 102, 241, 0.2));
    border-color: rgba(109, 40, 217, 0.45);
    color: #6d28d9;
}

.admin-btn-add i {
    background: rgba(109, 40, 217, 0.14);
    border-color: rgba(109, 40, 217, 0.35);
    color: #7c3aed;
}

.admin-btn-add:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(99, 102, 241, 0.28));
    border-color: rgba(91, 33, 182, 0.65);
    color: #5b21b6;
}

.admin-btn-update {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(59, 130, 246, 0.2));
    border-color: rgba(67, 56, 202, 0.45);
    color: #3730a3;
}

.admin-btn-update i {
    background: rgba(67, 56, 202, 0.14);
    border-color: rgba(67, 56, 202, 0.35);
    color: #4338ca;
}

.admin-btn-update:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3), rgba(59, 130, 246, 0.28));
    border-color: rgba(49, 46, 129, 0.65);
    color: #312e81;
}

.admin-btn-users {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.2), rgba(20, 184, 166, 0.2));
    border-color: rgba(14, 116, 144, 0.45);
    color: #0e7490;
}

.admin-btn-users i {
    background: rgba(14, 116, 144, 0.14);
    border-color: rgba(14, 116, 144, 0.35);
    color: #0891b2;
}

.admin-btn-users:hover {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.3), rgba(20, 184, 166, 0.28));
    border-color: rgba(21, 94, 117, 0.65);
    color: #155e75;
}

.admin-btn-backup {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(59, 130, 246, 0.18));
    border-color: rgba(37, 99, 235, 0.48);
    color: #1d4ed8;
}

.admin-btn-backup i {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.35);
    color: #2563eb;
}

.admin-btn-backup:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(59, 130, 246, 0.28));
    border-color: rgba(29, 78, 216, 0.62);
    color: #1e40af;
}

.admin-btn-logout {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2), rgba(239, 68, 68, 0.2));
    border-color: rgba(190, 24, 93, 0.45);
    color: #be123c;
}

.admin-btn-logout i {
    background: rgba(190, 24, 93, 0.14);
    border-color: rgba(190, 24, 93, 0.35);
    color: #e11d48;
}

.admin-btn-logout:hover {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.3), rgba(239, 68, 68, 0.28));
    border-color: rgba(136, 19, 55, 0.65);
    color: #881337;
}

/* Two-tone control panel buttons (alternating A/B) */
.admin-btn-tone-a {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.95));
    border-color: rgba(148, 163, 184, 0.4);
    color: #334155;
}

.admin-btn-tone-a i {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.3);
    color: #475569;
}

.admin-btn-tone-a:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(241, 245, 249, 0.98));
    border-color: rgba(100, 116, 139, 0.42);
    color: #1e293b;
}

.admin-btn-tone-b {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.95));
    border-color: rgba(148, 163, 184, 0.4);
    color: #334155;
}

.admin-btn-tone-b i {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.3);
    color: #475569;
}

.admin-btn-tone-b:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(241, 245, 249, 0.98));
    border-color: rgba(100, 116, 139, 0.42);
    color: #1e293b;
}

.admin-btn-tone-a[aria-pressed="true"],
.admin-btn-tone-a.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(240, 249, 255, 0.98));
    border-color: rgba(148, 163, 184, 0.5);
    color: #1e293b;
}

.admin-btn-tone-b[aria-pressed="true"],
.admin-btn-tone-b.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(240, 249, 255, 0.98));
    border-color: rgba(148, 163, 184, 0.5);
    color: #1e293b;
}

.admin-btn i {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 41, 201, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(32, 41, 201, 0.2);
    font-size: 0.74rem;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.12));
}

.admin-dropdown {
    position: relative;
}

.admin-dropdown-toggle {
    justify-content: space-between;
}

.admin-dropdown-toggle .dropdown-caret {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--gray-500);
}

.admin-dropdown.open .admin-dropdown-toggle .dropdown-caret i {
    transform: rotate(180deg);
}

.admin-dropdown-toggle .dropdown-caret i {
    transition: transform var(--transition-fast);
}

.admin-dropdown-menu {
    display: none;
    margin-top: 4px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.admin-dropdown.open .admin-dropdown-menu {
    display: block;
}

.admin-dropdown-item {
    background: transparent;
    color: var(--gray-700);
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 6px 8px;
    font-size: 0.67rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-align: left;
    width: 100%;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.admin-dropdown-item:last-child {
    border-bottom: 0;
}

.admin-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(32, 41, 201, 0.1), rgba(245, 158, 11, 0.1));
    color: var(--primary-dark);
}

.admin-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--primary-color);
}

.admin-metric-card {
    margin-top: 2px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(32, 41, 201, 0.18);
    border-radius: var(--border-radius-md);
    padding: 8px 8px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    align-items: center;
    box-shadow: var(--shadow-sm);
    color: var(--gray-700);
}

.admin-metric-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 41, 201, 0.12);
    color: var(--primary-color);
    border: 1px solid rgba(32, 41, 201, 0.2);
    font-size: 0.78rem;
}

.admin-metric-icon i {
    font-size: 0.8rem;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.12));
}

.admin-metric-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--primary-dark);
    line-height: 1;
}

.admin-metric-label {
    font-size: 0.62rem;
    color: var(--gray-600);
    margin-top: 1px;
}

.admin-metric-sub {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--success-color);
    padding: 2px 5px;
    border-radius: 999px;
    border: 1px solid rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.08);
}

.admin-metric-card.is-offline .admin-metric-sub {
    color: var(--danger-color);
    border-color: rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.08);
}

#backupNow {
    margin-bottom: 0;
}

/* ---------- 12. Modals ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--border-radius-xl);
    padding: 25px;
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalAppear 0.3s ease;
    transform-style: preserve-3d;
}

/* Reports modal: larger, table-like layout */
#reportsModal .modal-content {
    max-height: 90vh;
    min-height: 70vh;
}

#reportsModal .reports-grid,
#reportsPage .reports-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--border-radius-md);
    padding: 14px;
}

#reportsModal .report-category-card,
#reportsModal .report-year-card,
#reportsModal .report-month-card,
#reportsModal .report-file-card,
#reportsPage .report-category-card,
#reportsPage .report-year-card,
#reportsPage .report-month-card,
#reportsPage .report-file-card {
    border-radius: 12px;
}

#hseTicketsModal .modal-content {
    max-width: 1200px;
    max-height: 90vh;
}

#hseTicketsModal .table-container,
#hseTicketsPage .table-container {
    overflow-x: auto;
}

.visitors-table-wrap {
    max-height: 60vh;
    overflow: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
}

#visitorNamesModal .modal-content {
    max-width: 900px;
}

.hse-tickets-table {
    min-width: 1100px;
}

.hse-tickets-table .admin-btn {
    width: auto;
    justify-content: center;
    padding: 5px 8px;
    font-size: 0.7rem;
    display: inline-flex;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.9) translateY(20px) rotateX(10deg); }
    to { opacity: 1; transform: scale(1) translateY(0) rotateX(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* ---------- Reports modal ---------- */
.reports-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: stretch;
}

.report-category-card,
.report-year-card,
.report-month-card,
.report-file-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--border-radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    appearance: none;
    font-family: inherit;
    width: 100%;
}

.report-category-card,
.report-year-card,
.report-month-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
    border-color: rgba(15, 23, 42, 0.14);
}

.report-category-card::before,
.report-year-card::before,
.report-month-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    width: 44px;
    height: 12px;
    transform: translateY(-45%);
    border-radius: 8px 8px 4px 4px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.report-category-card::after,
.report-year-card::after,
.report-month-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120px 80px at 85% 0%, rgba(59, 130, 246, 0.08), transparent 60%);
    pointer-events: none;
}

.report-category-card:hover,
.report-year-card:hover,
.report-month-card:hover,
.report-file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.report-file-card {
    cursor: default;
}

.report-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-card-title i {
    color: var(--primary-color);
}

.report-card-sub {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 6px;
    line-height: 1.4;
}

.reports-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.reports-controls .form-input,
.reports-controls .form-select {
    max-width: 220px;
}

.report-empty {
    text-align: center;
    color: var(--gray-600);
    padding: 20px;
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius-md);
    background: rgba(248, 250, 252, 0.7);
}

.report-file-preview {
    width: 100%;
    height: 120px;
    background: rgba(15, 23, 42, 0.04);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
}

.report-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.report-file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.report-file-actions a,
.report-file-actions button {
    text-decoration: none;
}

.report-file-actions .admin-btn,
.report-file-actions .edit-btn,
.report-file-actions .delete-btn {
    width: auto;
    padding: 6px 10px;
    font-size: 0.78rem;
    margin-top: 0;
}

.report-table-wrapper {
    width: 100%;
    max-height: none;
    min-height: 0;
    overflow: visible;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: var(--shadow-sm);
    padding: 12px;
}

.report-charts {
    margin-top: 18px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.report-stats {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.report-stat-card {
    background: linear-gradient(135deg, rgba(32, 41, 201, 0.08), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(32, 41, 201, 0.2);
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}

.report-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--gray-600);
    text-transform: uppercase;
}

.report-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 6px;
}

.report-stat-sub {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 4px;
}

.report-chart-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.report-chart-card.hse-chart {
    min-height: 420px;
}

.report-chart-card.hse-chart canvas {
    width: 100% !important;
    height: 340px !important;
    max-height: 340px;
}

.report-chart-card.water-chart {
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.report-chart-card.water-chart canvas {
    width: 100% !important;
    height: 340px !important;
    max-height: 340px;
}

.report-chart-card.chart-stacked {
    min-height: 340px;
    display: flex;
    flex-direction: column;
}

.report-chart-card.chart-stacked canvas {
    width: 100% !important;
    height: 300px !important;
    max-height: 300px;
}

.report-chart-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    text-align: center;
}

#reportPreviewBody {
    display: block;
}

.report-table-wrapper + .report-charts {
    margin-top: 22px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 16px;
}

.report-table-note {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: center;
    color: var(--gray-700);
    table-layout: auto;
}

.report-table th,
.report-table td {
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
    max-width: 220px;
    font-family: 'Manrope', sans-serif;
    line-height: 1.5;
}

.report-table th {
    position: sticky;
    top: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.2px;
    font-family: 'Space Grotesk', sans-serif;
}

.report-table tbody tr:nth-child(odd) {
    background: linear-gradient(90deg, rgba(32, 41, 201, 0.06), rgba(245, 158, 11, 0.06));
}

.report-table tbody tr:nth-child(even) {
    background: linear-gradient(90deg, rgba(32, 41, 201, 0.12), rgba(245, 158, 11, 0.08));
}

.report-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(32, 41, 201, 0.16), rgba(245, 158, 11, 0.14));
    color: var(--gray-800);
}

/* ---------- 13. Forms ---------- */
.forms-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.forms-container.active {
    display: flex;
}

.edit-form {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-lg);
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--gray-800);
    caret-color: var(--primary-color);
    -webkit-text-fill-color: var(--gray-800);
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--gray-500);
    opacity: 1;
    -webkit-text-fill-color: var(--gray-500);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

#newFloorName,
.floor-edit-item .form-input {
    background: #ffffff;
    color: var(--gray-900);
    caret-color: var(--primary-color);
    -webkit-text-fill-color: var(--gray-900);
    font-weight: 500;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
    font-family: 'Manrope', sans-serif;
}

#newFloorName::placeholder,
.floor-edit-item .form-input::placeholder {
    direction: ltr;
    text-align: left;
}

.floor-input-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.floor-input-row #newFloorName {
    flex: 1 1 auto;
    min-width: 0;
}

.floor-input-row .add-floor-btn {
    width: auto;
    min-width: 120px;
    justify-content: center;
    flex: 0 0 auto;
    padding-left: 18px;
    padding-right: 18px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}

.save-btn {
    background: linear-gradient(135deg, var(--success-green) 0%, var(--success-color) 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex: 1;
}

.save-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.save-btn:active,
.cancel-btn:active {
    transform: scale(0.98);
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    padding: 12px 25px;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
}

.cancel-btn:hover {
    background: var(--gray-200);
    transform: translateY(-3px);
}

/* ---------- 14. Status Badges ---------- */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.status-available {
    background: rgba(76, 201, 240, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 201, 240, 0.3);
}

.status-reserved {
    background: rgba(248, 150, 30, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(248, 150, 30, 0.3);
}

.status-completed {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(6, 214, 160, 0.3);
}

.reserved-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.26));
    color: #92400e;
    border: 1px solid rgba(217, 119, 6, 0.32);
    box-shadow: 0 6px 14px rgba(217, 119, 6, 0.16);
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.completed-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.24));
    color: #065f46;
    border: 1px solid rgba(5, 150, 105, 0.32);
    box-shadow: 0 6px 14px rgba(5, 150, 105, 0.14);
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.reserved-badge i,
.completed-badge i {
    font-size: 0.78rem;
}

.company-name-badge {
    margin-top: 5px !important;
    background: linear-gradient(135deg, #9d4edd 0%, #7b2cbf 100%) !important;
    color: #f8fbff !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

/* Fallback: handle older rendered markup where company badge was inline-styled */
.project-card .reserved-badge + .reserved-badge,
.project-card .reserved-badge[style*="#9d4edd"],
.project-card .reserved-badge[style*="#7b2cbf"] {
    color: #f8fbff !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

/* ---------- 15. Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 40px;
    font-size: 0.9rem;
    color: var(--gray-600);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

#breadcrumb {
    margin-top: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: var(--gray-400);
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-current {
    color: var(--gray-800);
    font-weight: 600;
}

/* ---------- 16. Auto-save & Notifications ---------- */
.auto-save-indicator {
    position: fixed;
    top: 96px;
    right: 20px;
    background: linear-gradient(135deg, var(--success-green) 0%, var(--success-color) 100%);
    color: white;
    padding: 10px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.save-notification {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid var(--warning-color);
    color: #856404;
    padding: 15px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    display: none;
}

.save-options {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.maintenance-alert {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: var(--shadow-md);
    color: var(--gray-800);
    text-align: left;
}

.maintenance-alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-dark);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.maintenance-alert-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.maintenance-alert-message {
    font-size: 0.95rem;
    color: var(--gray-700);
}

@media (max-width: 720px) {
    .maintenance-alert {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- 17. Floor Section ---------- */
.floor-section {
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.floor-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
    padding: 0;
    border: none;
}

.floor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
}

.floor-heading {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.floor-meta-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--gray-700);
    font-size: 0.78rem;
    font-weight: 700;
}

.floor-meta-badge--apartment {
    background: rgba(32, 41, 201, 0.1);
    color: var(--primary-color);
}

.floor-meta-badge--room {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.floor-meta-badge--kitchen {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.floor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.add-unit-btn.admin-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(32, 41, 201, 0.22);
    background: linear-gradient(135deg, rgba(32, 41, 201, 0.12), rgba(32, 41, 201, 0.04));
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.add-unit-btn.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.add-room-btn.admin-btn {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.05));
    color: #b45309;
}

.floor-kitchen-btn.admin-btn {
    border-color: rgba(16, 185, 129, 0.28);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.05));
    color: #047857;
}

.floor-kitchen-btn.admin-btn.is-active {
    border-color: rgba(4, 120, 87, 0.34);
    background: linear-gradient(135deg, rgba(4, 120, 87, 0.18), rgba(16, 185, 129, 0.08));
    color: #065f46;
}

.unit-form-body {
    padding: 20px;
    max-height: 65vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.unit-form-section {
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.unit-form-section-title {
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.unit-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.unit-form-grid-span-2 {
    grid-column: 1 / -1;
}

.unit-summary-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    text-align: center;
    font-weight: 600;
    color: var(--gray-700);
}

.unit-summary-box--primary {
    border-color: rgba(67, 97, 238, 0.28);
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.unit-summary-value {
    font-size: 1.05rem;
    font-weight: 700;
}

.unit-summary-subtext {
    margin-top: 6px;
    font-size: 0.88rem;
    color: var(--gray-600);
}

.unit-summary-divider {
    margin: 0 10px;
    color: var(--gray-400);
}

.bed-type-card {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--gray-200);
    background: rgba(248, 250, 252, 0.98);
}

.bed-type-title {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
}

.bed-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bed-type-label {
    display: block;
    margin-bottom: 5px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.floor-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #ffffff;
    margin-top: 10px;
}

.floor-list-name {
    font-weight: 600;
    color: var(--gray-700);
}

/* ---------- 18. Tables ---------- */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.6);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.data-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-100);
}

.data-table tr:hover {
    background-color: var(--gray-100);
}

.data-table tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.7);
}

.edit-btn {
    background: var(--info-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 8px;
    margin-right: 4px;
}

.edit-btn i,
.delete-btn i,
.back-btn i,
.auth-btn i,
.auth-trigger-btn i,
.view-stats-btn i,
.save-btn i,
.cancel-btn i,
.add-floor-btn i {
    font-size: 0.95em;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.12));
}

.edit-btn:hover {
    background: var(--info-dark);
    transform: translateY(-2px) scale(1.05);
}

.delete-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 8px;
}

.delete-btn:hover {
    background: var(--danger-dark);
    transform: translateY(-2px) scale(1.05);
}

.location-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(32, 41, 201, 0.12);
    border: 1px solid rgba(32, 41, 201, 0.25);
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 6px;
}

.location-icon i {
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.18));
}

.location-icon:hover {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-dark);
    transform: translateY(-1px) scale(1.05);
}



.last-update-date { font-size: 0.9rem !important; }
.last-update-time { font-size: 0.8rem !important; }

/* ---------- 19. Overlay & Auth Message ---------- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.overlay.active {
    display: block;
}

.auth-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    display: none;
}

body.no-delete-permission .delete-btn {
    display: none !important;
}

.users-management {
    width: 100%;
    min-width: 0;
}

#usersPage {
    width: 100%;
}

#usersManagementContent {
    width: 100%;
    min-height: calc(100vh - 190px);
}

#assetsPage {
    width: 100%;
}

#assetsPageContent {
    width: 100%;
    min-height: calc(100vh - 190px);
}

#reportsPage {
    width: 100%;
}

#reportsPageContent {
    width: 100%;
    min-height: calc(100vh - 190px);
}

#qhseDepartmentPage {
    width: 100%;
}

#qhseDepartmentPageContent {
    width: 100%;
    min-height: calc(100vh - 190px);
}

#hseTicketsPage {
    width: 100%;
}

#hseTicketsPageContent {
    width: 100%;
    min-height: calc(100vh - 190px);
}

#weeklyTrackerPage {
    width: 100%;
}

#weeklyTrackerPageContent {
    width: 100%;
    min-height: calc(100vh - 190px);
}

#commentsPage {
    width: 100%;
}

#commentsPageContent {
    width: 100%;
    min-height: calc(100vh - 190px);
}

.qhse-drive-layout {
    display: grid;
    gap: 14px;
}

.qhse-drive-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.qhse-drive-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-700);
    font-weight: 600;
    flex-wrap: wrap;
}

.qhse-drive-breadcrumb i {
    color: var(--gray-400);
}

.qhse-breadcrumb-link {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
}

.qhse-breadcrumb-link:hover {
    text-decoration: underline;
}

.qhse-drive-stat {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(14, 116, 144, 0.18);
    background: linear-gradient(145deg, rgba(240, 249, 255, 0.95), rgba(236, 253, 245, 0.92));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.qhse-drive-stat-label {
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.qhse-drive-stat strong {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.qhse-drive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.qhse-drive-search {
    flex: 1 1 320px;
}

.qhse-drive-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.qhse-drive-upload-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.qhse-drive-note {
    color: var(--gray-600);
    font-size: 0.92rem;
}

.qhse-drive-alert {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(217, 119, 6, 0.2);
    background: rgba(255, 247, 237, 0.95);
    color: #9a3412;
    font-weight: 600;
}

.qhse-drive-folders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.qhse-drive-folders .report-empty {
    grid-column: 1 / -1;
}

.qhse-folder-shell {
    display: grid;
    gap: 8px;
}

.qhse-folder-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid rgba(14, 116, 144, 0.14);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.95));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.qhse-folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
}

.qhse-folder-card.is-active {
    border-color: rgba(14, 116, 144, 0.42);
    background: linear-gradient(145deg, rgba(224, 242, 254, 0.96), rgba(236, 253, 245, 0.98));
}

.qhse-folder-nav-card {
    border-style: dashed;
}

.qhse-folder-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(14, 116, 144, 0.12);
    color: #0f766e;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.qhse-folder-content {
    min-width: 0;
}

.qhse-folder-name {
    font-weight: 700;
    color: var(--gray-900);
    word-break: break-word;
}

.qhse-folder-meta {
    margin-top: 4px;
    color: var(--gray-500);
    font-size: 0.88rem;
}

.qhse-link-composer {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(14, 116, 144, 0.16);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.94));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.qhse-link-composer-toggle {
    justify-self: start;
}

.qhse-link-composer-body {
    display: grid;
    gap: 12px;
}

.qhse-link-composer-head,
.qhse-links-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.qhse-link-composer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.qhse-link-description-input {
    min-height: 104px;
    resize: vertical;
}

.qhse-link-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.qhse-links-section {
    display: grid;
    gap: 12px;
}

.qhse-section-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-900);
    font-size: 1.02rem;
}

.qhse-section-subtitle {
    margin-top: 4px;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.qhse-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.12);
    color: #0f766e;
    font-weight: 700;
}

.qhse-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.qhse-link-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.qhse-link-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.qhse-link-title {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
}

.qhse-link-meta {
    margin-top: 4px;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.qhse-link-description {
    margin: 0;
    color: #b91c1c;
    font-weight: 700;
    line-height: 1.6;
    white-space: pre-line;
    word-break: break-word;
}

.qhse-link-url {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
}

.qhse-link-url:hover {
    text-decoration: underline;
}

.qhse-link-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.qhse-drive-table-wrap {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    overflow: auto;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.qhse-drive-table {
    margin: 0;
}

.qhse-file-name {
    font-weight: 700;
    color: var(--gray-900);
    word-break: break-word;
}

.qhse-file-meta {
    margin-top: 4px;
    color: var(--gray-500);
    font-size: 0.85rem;
    word-break: break-word;
}

.qhse-file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.qhse-preview-text {
    margin: 0;
    padding: 16px;
    max-height: 70vh;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #f8fafc;
    color: var(--gray-800);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.55;
}

@media (max-width: 768px) {
    .qhse-drive-toolbar {
        align-items: stretch;
    }

    .qhse-drive-toolbar-actions {
        width: 100%;
    }

    .qhse-drive-toolbar-actions .admin-btn {
        flex: 1 1 160px;
        justify-content: center;
    }

    .qhse-drive-folders {
        grid-template-columns: 1fr;
    }

    .qhse-link-composer-grid,
    .qhse-links-grid {
        grid-template-columns: 1fr;
    }

    .qhse-link-composer-actions .admin-btn {
        width: 100%;
        justify-content: center;
    }
}

.comments-center-layout {
    display: grid;
    gap: 14px;
}

.comments-center-nav-host {
    margin-top: 4px;
}

.comments-home-grid {
    margin-top: 8px;
}

.comments-home-card .report-card-sub {
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.comments-center-section {
    display: grid;
    gap: 8px;
}

.comments-center-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.comments-center-back-btn + .comments-section-title {
    margin-right: auto;
}

.comments-section-title {
    margin: 0;
    font-size: 1rem;
    color: var(--gray-800);
}

.comments-center-table .comment-actions-cell {
    min-width: 118px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
    align-items: stretch;
}

.users-table.comments-center-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.comments-center-table th,
.comments-center-table td {
    font-size: 0.8rem;
    vertical-align: middle;
    padding: 8px 7px;
}

.comments-center-table th {
    background: linear-gradient(135deg, #e8eefc 0%, #f5f8ff 100%);
    color: #1f2a44;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
}

.comments-center-table td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.comments-center-table .comment-cell-context {
    min-width: 135px;
    font-weight: 600;
    color: var(--gray-800);
}

.comments-center-table .comment-cell-message {
    min-width: 125px;
}

.comments-center-table .comment-cell-mentions {
    min-width: 120px;
    color: #0f766e;
    font-weight: 600;
}

.comment-summary-message {
    color: var(--gray-800);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

.comment-cell-text {
    margin-top: 6px;
    color: var(--gray-700);
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.comment-muted-cell {
    color: var(--gray-500);
    font-weight: 600;
}

.comments-center-table .comment-thread-btn {
    position: static;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
}

.comments-management .users-table-wrap {
    overflow-x: auto;
}

.comments-center-table .comment-actions-cell .admin-btn,
.comments-center-table .comment-actions-cell .delete-btn {
    width: 100% !important;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    justify-content: center;
    text-align: center;
    padding: 6px 8px;
    font-size: 0.78rem;
    transform: none !important;
}

.comments-center-table .comment-actions-cell .admin-btn:hover,
.comments-center-table .comment-actions-cell .admin-btn:active,
.comments-center-table .comment-actions-cell .delete-btn:hover,
.comments-center-table .comment-actions-cell .delete-btn:active {
    transform: none !important;
}

.comments-center-table .comment-actions-cell .delete-btn {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.comments-row.is-current {
    background: rgba(32, 41, 201, 0.08) !important;
}

.comment-notification-row.is-unread {
    background: rgba(254, 242, 242, 0.7);
}

.comment-kind-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.comment-kind-pill.is-comment {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.comment-kind-pill.is-mention {
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
}

.comment-thread-details {
    margin-top: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--border-radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
    padding: 14px;
    display: grid;
    gap: 10px;
}

.comment-thread-main {
    border: 1px dashed rgba(148, 163, 184, 0.5);
    border-radius: var(--border-radius-md);
    padding: 12px;
    background: rgba(255, 255, 255, 0.85);
}

.comment-thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--gray-600);
}

.comment-context-chip {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(32, 41, 201, 0.12);
    color: var(--primary-dark);
    font-weight: 600;
}

.comment-thread-message {
    color: var(--gray-800);
    white-space: pre-wrap;
}

.comment-thread-mentions,
.comment-reply-mentions {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #0f766e;
    font-weight: 600;
}

.comment-thread-replies {
    display: grid;
    gap: 8px;
}

.comment-reply-item {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
}

.comment-reply-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.comment-reply-body {
    color: var(--gray-800);
    white-space: pre-wrap;
}

.comment-composer-shell {
    max-width: 760px;
    width: 100%;
}

.comment-composer-context {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-composer-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.comment-composer-textarea {
    min-height: 130px;
    resize: vertical;
}

.comment-mention-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow-y: auto;
    z-index: 40;
}

.comment-mention-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--gray-700);
}

.comment-mention-item:hover,
.comment-mention-item.is-active {
    background: rgba(32, 41, 201, 0.08);
    color: var(--primary-dark);
}

.comment-alert-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.22);
    color: var(--gray-700);
}

.comment-alert-pill.is-unread {
    background: rgba(220, 38, 38, 0.16);
    color: #b91c1c;
}

.comment-notifications-panel {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.92);
    margin-bottom: 12px;
    padding: 10px;
}

.comment-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-notifications-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--gray-800);
}

.comment-notifications-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-notifications-count {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 600;
}

.comment-notifications-tools .admin-btn,
.comment-notification-actions .admin-btn {
    width: auto;
    text-align: center;
}

.comments-notifications-table .comment-actions-cell {
    min-width: 88px;
}

.comment-notifications-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.comment-notification-item {
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 12px;
    padding: 10px;
    background: #fff;
    display: grid;
    gap: 6px;
}

.comment-notification-item.is-unread {
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(254, 242, 242, 0.7);
}

.comment-notification-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--gray-700);
    font-size: 0.84rem;
}

.comment-notification-kind {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.comment-notification-kind.is-mention {
    background: rgba(16, 185, 129, 0.18);
    color: #047857;
}

.comment-notification-kind.is-comment {
    background: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
}

.comment-notification-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--gray-600);
}

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

@media (max-width: 860px) {
    .comment-composer-grid {
        grid-template-columns: 1fr;
    }
}

.assets-coming-layout {
    width: 100%;
}

.assets-coming-card {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: var(--border-radius-lg);
    background:
        radial-gradient(140px 90px at 10% 0%, rgba(59, 130, 246, 0.15), transparent 65%),
        radial-gradient(180px 100px at 90% 100%, rgba(16, 185, 129, 0.14), transparent 65%),
        rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    padding: 28px 24px;
    text-align: center;
    display: grid;
    gap: 12px;
    align-items: center;
    justify-items: center;
    animation: assetsCardPulse 2.8s ease-in-out infinite;
}

.assets-coming-emojis {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 2rem;
    margin-bottom: 2px;
}

.assets-coming-emoji {
    display: inline-flex;
    transform-origin: center;
    animation: assetsEmojiFloat 1.9s ease-in-out infinite;
}

.assets-emoji-two {
    animation-delay: 0.18s;
}

.assets-emoji-three {
    animation-delay: 0.36s;
}

.assets-emoji-four {
    animation-delay: 0.54s;
}

.assets-coming-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--gray-800);
}

.assets-coming-subtitle {
    margin: 0;
    max-width: 540px;
    color: var(--gray-600);
    font-size: 0.98rem;
}

@keyframes assetsEmojiFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-7px) rotate(-4deg) scale(1.06);
    }
}

@keyframes assetsCardPulse {
    0%, 100% {
        box-shadow: var(--shadow-md);
    }
    50% {
        box-shadow: 0 18px 34px -20px rgba(15, 23, 42, 0.45);
    }
}

.weekly-tracker-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.weekly-tracker-controls {
    align-items: center;
}

.weekly-week-range {
    font-size: 0.86rem;
    color: var(--gray-700);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 9px 12px;
}

.weekly-dashboard-section,
.weekly-employees-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
    padding: 14px;
}

.weekly-section-title {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--gray-800);
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.weekly-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.weekly-dashboard-card {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--border-radius-md);
    padding: 12px;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(32, 41, 201, 0.08));
    box-shadow: var(--shadow-sm);
}

.weekly-dashboard-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    color: var(--gray-800);
    font-weight: 700;
}

.weekly-dashboard-metric {
    margin-top: 6px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color);
}

.weekly-dashboard-sub {
    font-size: 0.78rem;
    color: var(--gray-600);
}

.weekly-dashboard-progress {
    margin-top: 8px;
    width: 100%;
    height: 8px;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.weekly-dashboard-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #10b981, #14b8a6);
    border-radius: 999px;
    transition: width var(--transition-normal);
}

.weekly-dashboard-foot {
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--gray-700);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.weekly-employee-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.04);
}

.weekly-employee-tab {
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--gray-700);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.weekly-employee-tab:hover {
    color: var(--gray-900);
    background: rgba(15, 23, 42, 0.06);
}

.weekly-employee-tab.active {
    color: var(--primary-color);
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.12);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.weekly-employee-tab:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 1px;
}

.weekly-employee-tab-name {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weekly-employee-tab-count {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 6px;
    background: rgba(15, 23, 42, 0.14);
    color: var(--gray-900);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.weekly-employee-tab.active .weekly-employee-tab-count {
    background: rgba(37, 99, 235, 0.22);
    color: var(--primary-color);
}

.weekly-employee-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    margin-bottom: 12px;
}

.weekly-employee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.weekly-employee-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.weekly-employee-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weekly-tracker-table {
    min-width: 1100px;
}

.weekly-tracker-table .form-input {
    min-width: 130px;
    padding: 8px 10px;
    font-size: 0.84rem;
}

.weekly-status-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
}

.weekly-status-cell .form-input {
    min-width: 130px;
}

.weekly-status-cell .delete-btn {
    margin-top: 0;
    padding: 6px 10px;
}

.weekly-empty-row {
    text-align: center;
    color: var(--gray-600);
    font-style: italic;
}

.users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.users-table-wrap {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: #fff;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.users-table th,
.users-table td {
    padding: 10px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
    font-size: 0.9rem;
    vertical-align: top;
    word-break: break-word;
}

.users-table th {
    background: var(--gray-100);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

.users-perms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.users-perms label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}

.users-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.users-help-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(135deg, rgba(32, 41, 201, 0.08), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(32, 41, 201, 0.14);
    color: var(--gray-700);
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    margin-bottom: 10px;
    font-size: 0.84rem;
}

.users-help-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.75;
}

.users-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: #fff;
}

.users-bulk-toolbar .form-input {
    min-width: 220px;
    max-width: 320px;
}

.user-email-toggle {
    background: none;
    border: none;
    color: var(--primary-dark);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.user-bulk-select {
    transform: scale(1.1);
    cursor: pointer;
}

.users-main-row,
.user-entry-row {
    background: #fff;
}

.users-main-row:nth-child(4n + 1),
.user-entry-row:nth-child(2n) {
    background: rgba(248, 250, 252, 0.7);
}

.user-entry-row {
    cursor: pointer;
}

.user-entry-row:hover {
    background: rgba(226, 232, 240, 0.45);
}

.users-details-row td {
    background: var(--gray-50);
    padding: 0;
}

.users-permissions-dropdown {
    padding: 14px;
    border-top: 1px dashed var(--gray-300);
    display: grid;
    gap: 12px;
}

.users-perms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px 12px;
}

.users-top-perms {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 12px;
    grid-template-columns: 1fr;
}

.users-role-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.users-role-group {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
}

.users-role-group .form-label {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.users-detail-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.users-detail-sections-single {
    grid-template-columns: 1fr;
}

.users-detail-sections h4,
.users-city-matrix h4 {
    margin-bottom: 8px;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.users-city-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.users-city-table th,
.users-city-table td {
    border-bottom: 1px solid var(--gray-200);
    padding: 8px;
    font-size: 0.84rem;
}

.users-city-table th {
    background: var(--gray-100);
    font-weight: 700;
}

.perm-summary {
    color: var(--gray-700);
    font-size: 0.82rem;
}

.perm-summary-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.perm-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.76rem;
    border: 1px solid transparent;
    font-weight: 600;
    line-height: 1.2;
}

.perm-pill.is-yes {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.28);
}

.perm-pill.is-no {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.24);
}

.users-section-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 10px;
}

.users-section-card h4 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.users-section-card h4 i {
    color: var(--primary-color);
}

.permissions-matrix-wrap {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    overflow-x: auto;
    background: #fff;
}

.permissions-matrix-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

.permissions-matrix-table th,
.permissions-matrix-table td {
    border-bottom: 1px solid var(--gray-200);
    padding: 8px 10px;
    font-size: 0.84rem;
    text-align: left;
    vertical-align: middle;
}

.permissions-matrix-table th {
    background: var(--gray-100);
    font-weight: 700;
}

.permissions-matrix-table td:nth-child(3),
.permissions-matrix-table td:nth-child(4),
.permissions-matrix-table td:nth-child(5),
.permissions-matrix-table th:nth-child(3),
.permissions-matrix-table th:nth-child(4),
.permissions-matrix-table th:nth-child(5) {
    text-align: center;
    width: 90px;
}

.perm-matrix-area {
    color: var(--gray-700);
    font-weight: 600;
    white-space: nowrap;
}

.perm-matrix-name {
    color: var(--gray-800);
    font-weight: 500;
    white-space: nowrap;
}

.perm-matrix-name i {
    color: var(--primary-color);
    margin-right: 6px;
}

.perm-matrix-child-row .perm-matrix-name {
    color: var(--gray-700);
    font-weight: 500;
}

.permissions-vertical-list {
    display: grid;
    gap: 10px;
}

.perm-group {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 10px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.perm-group .perm-row:last-child {
    border-bottom: none;
}

.perm-row-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.perm-row.is-child {
    margin-left: 18px;
    padding-left: 10px;
    border-left: 2px solid rgba(148, 163, 184, 0.35);
}

.perm-row.is-child .perm-row-title {
    font-weight: 500;
    color: var(--gray-700);
}

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

.perm-row-actions label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-700);
}

.users-perms-vertical {
    grid-template-columns: 1fr;
}

.users-perms-vertical label {
    padding: 6px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.users-perms-vertical label:last-child {
    border-bottom: none;
}

.users-effective-preview {
    border: 1px solid rgba(34, 197, 94, 0.28);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.08));
    border-radius: var(--border-radius-md);
    padding: 10px;
    color: var(--gray-800);
}

.effective-preview-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.effective-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px 10px;
    font-size: 0.84rem;
}

.page-qhse.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.2);
}

@media (max-width: 980px) {
    .users-management {
        min-width: 96vw;
    }
    .users-detail-sections {
        grid-template-columns: 1fr;
    }
    .perm-summary-badges {
        gap: 4px;
    }
    .users-role-toolbar {
        grid-template-columns: 1fr;
    }
    .users-role-group {
        grid-template-columns: 1fr;
    }
    .users-bulk-toolbar .form-input {
        min-width: 180px;
    }
    .permissions-matrix-table {
        min-width: 640px;
    }
    .perm-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .perm-row.is-child {
        margin-left: 10px;
    }
}

.force-pass-note {
    margin-bottom: 14px;
    color: var(--gray-700);
}

/* ---------- 20. Toast (for JS) ---------- */
.toast-container {
    position: fixed;
    top: 152px;
    right: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.35s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast--success {
    background: linear-gradient(135deg, var(--success-green) 0%, var(--success-color) 100%);
    color: white;
}

.toast--error {
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
    color: white;
}

.toast--info {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    color: white;
}

.toast--warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--warning-dark) 100%);
    color: white;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- 21. Loading spinner ---------- */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- 22. Utilities ---------- */
.hidden {
    display: none !important;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.content-wrapper {
    overflow-y: auto;
}

.table-row-hover {
    transition: all 0.3s ease;
}

.table-row-hover:hover {
    background: linear-gradient(90deg, var(--primary-muted), var(--accent-muted));
    transform: translateX(5px);
}

/* ---------- 23. Responsive ---------- */
@media (max-width: 1200px) {
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    body.sidebar-visible { padding-left: 0; }
    .left-rail { display: none; }
    .container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 170px 14px 18px;
    }
    .page-logo {
        position: fixed;
        top: 8px;
        left: 8px;
        margin: 0;
        align-items: flex-start;
        z-index: 910;
    }
    .welcome-banner {
        position: fixed;
        top: 16px;
        left: 168px;
        margin: 0;
        width: auto;
        max-width: calc(100% - 176px);
        z-index: 910;
    }
    .page-logo img {
        width: 150px;
        height: 44px;
    }
    .page-qhse {
        position: fixed;
        top: 64px;
        right: 12px;
        padding: 8px 12px;
        margin: 0;
        z-index: 910;
    }
    .qhse-title {
        font-size: 1rem;
    }
    .live-datetime-card {
        position: fixed;
        top: 8px;
        right: 12px;
        transform: none;
        min-width: 0;
        padding: 8px 12px;
        margin: 0;
        z-index: 910;
    }
    .admin-panel {
        width: 210px;
        height: auto;
        top: 60px;
        left: 12px;
    }
    .admin-panel:not(.active) {
        transform: translateX(-100%);
    }
    .admin-panel.active {
        transform: translateX(0);
    }
    .auth-trigger-btn {
        bottom: 18px;
        left: 18px;
        padding: 12px 18px;
        font-size: 0.9rem;
    }
    .auth-panel {
        bottom: 60px;
        left: 18px;
        width: calc(100vw - 36px);
        max-width: 320px;
    }
    .dashboard-card {
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }
    h1 { font-size: 1.8rem; }
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 10px;
    }
    .stat-card { padding: 10px; }
    .stat-value { font-size: 1.2rem; }
    .cities-grid,
    .project-groups-grid,
    .projects-grid,
    .apartments-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .admin-controls { flex-direction: column; }
    .admin-btn {
        width: 100%;
        justify-content: center;
    }
    .floor-header,
    .unit-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .unit-card-header {
        padding-right: 0;
    }
    .floor-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .floor-actions .admin-btn {
        width: auto;
        flex: 1 1 220px;
    }
    .admin-dropdown-toggle {
        justify-content: space-between;
    }
    .modal-content { padding: 15px; }
    .unit-form-grid,
    .bed-type-grid {
        grid-template-columns: 1fr;
    }
    .unit-form-grid-span-2 {
        grid-column: auto;
    }
    .form-actions { flex-direction: column; }
    .breadcrumb {
        flex-wrap: wrap;
        padding: 10px 12px;
    }
    #breadcrumb {
        margin-top: 14px;
    }
    .signature {
        font-size: 0.8rem;
        padding: 12px;
    }
    .last-update-date { font-size: 0.8rem !important; }
    .last-update-time { font-size: 0.7rem !important; }
}

@media (max-width: 1024px) {
    html,
    body {
        height: auto;
        min-height: 100vh;
    }
    body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    .floor-actions .admin-btn {
        width: 100%;
        flex-basis: 100%;
    }
    .stat-card {
        min-height: 0;
    }
    .breadcrumb {
        margin-top: 16px;
    }
    #breadcrumb {
        margin-top: 12px;
    }
    .reports-controls .form-input,
    .reports-controls .form-select {
        max-width: 100%;
        width: 100%;
    }
    .weekly-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .weekly-employee-tabs {
        gap: 4px;
        padding: 4px;
    }
    .weekly-employee-tab {
        padding: 7px 10px;
        font-size: 0.82rem;
        gap: 6px;
    }
    .weekly-employee-tab-name {
        max-width: 130px;
    }
    .weekly-employee-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .weekly-status-cell {
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
    }
    .weekly-status-cell .delete-btn {
        width: 100%;
    }
    .edit-floors-form,
    .edit-form,
    .modal-content {
        width: 100%;
    }
    .unit-summary-subtext {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .unit-summary-divider {
        display: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    html,
    body {
        height: auto;
        min-height: 100vh;
    }
    body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
}

/* ---------- 24. Fixed Top Strip (hard override) ---------- */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 228px;
    right: 10px;
    height: 108px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.5) 65%, rgba(255, 255, 255, 0.3) 100%),
        radial-gradient(520px 180px at 12% 0%, rgba(32, 41, 201, 0.14), transparent 70%),
        radial-gradient(520px 180px at 88% 0%, rgba(245, 158, 11, 0.14), transparent 70%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14), 0 4px 10px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px) saturate(120%);
    pointer-events: none;
    z-index: 900;
}

.container {
    margin-top: 120px !important;
    height: calc(100vh - 120px) !important;
    padding-top: 0 !important;
    overflow-y: auto !important;
}

.page-logo {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 910 !important;
}

.welcome-banner {
    position: fixed !important;
    top: 14px !important;
    left: 260px !important;
    z-index: 910 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    height: 86px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

.welcome-title {
    font-size: 1.7rem !important;
    line-height: 1.02 !important;
    margin-bottom: 2px !important;
}

.welcome-emojis {
    gap: 6px !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 34px !important;
    margin-top: -1px !important;
}

.welcome-emoji {
    font-size: 1.78rem !important;
    filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.24));
    transform-origin: center;
    animation: none !important;
    transform: none !important;
}

.welcome-emoji.emoji-1 { animation-delay: 0s; }
.welcome-emoji.emoji-2 {
    animation: none !important;
}
.welcome-emoji.emoji-3 {
    animation: none !important;
}
.welcome-emoji.emoji-4 { animation-delay: 0.6s; }

@keyframes welcomeEmojiPop {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.24));
    }
    30% {
        transform: translateY(-4px) scale(1.1) rotate(-4deg);
        filter: drop-shadow(0 6px 10px rgba(32, 41, 201, 0.35));
    }
    60% {
        transform: translateY(-2px) scale(1.05) rotate(3deg);
        filter: drop-shadow(0 5px 9px rgba(245, 158, 11, 0.32));
    }
}

@keyframes welcomeSemiArcLeft {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.24));
    }
    50% {
        transform: translate(-14px, -9px) scale(1.12) rotate(-12deg);
        filter: drop-shadow(0 6px 10px rgba(32, 41, 201, 0.35));
    }
}

@keyframes welcomeSemiArcRight {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.24));
    }
    50% {
        transform: translate(14px, -9px) scale(1.12) rotate(12deg);
        filter: drop-shadow(0 6px 10px rgba(245, 158, 11, 0.35));
    }
}

.page-qhse {
    position: fixed !important;
    top: 14px !important;
    left: calc(50% + 46px) !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 910 !important;
    padding: 10px 16px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.24) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
    backdrop-filter: blur(10px) !important;
}

.live-datetime-card {
    position: fixed !important;
    top: 14px !important;
    right: 20px !important;
    transform: none !important;
    z-index: 910 !important;
    padding: 9px 13px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.28) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(10px) !important;
}

@media (max-width: 768px) {
    body {
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .container {
        margin-top: 170px !important;
        height: auto !important;
        min-height: calc(100vh - 170px) !important;
        padding-top: 0 !important;
        overflow: visible !important;
    }
    .admin-panel {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: calc(100% - 16px) !important;
        height: auto !important;
        max-height: none !important;
        margin: 170px 8px 8px !important;
        z-index: 20 !important;
        transform: none !important;
    }
    .admin-panel:not(.active) {
        display: none !important;
        transform: none !important;
    }
    .admin-panel.active {
        display: flex !important;
        transform: none !important;
    }
    .admin-controls {
        gap: 6px !important;
        max-height: none;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
    .admin-btn {
        min-height: 33px;
        flex-shrink: 0;
    }
    .admin-btn:hover,
    .admin-btn:active {
        transform: none !important;
    }
    body::after {
        left: 8px;
        right: 8px;
        height: 160px;
    }
    .page-logo {
        top: 8px !important;
        left: 8px !important;
    }
    .welcome-banner {
        top: 58px !important;
        left: 8px !important;
        right: 8px !important;
        max-width: calc(100% - 16px) !important;
        padding: 0 !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        overflow: visible !important;
    }
    .welcome-title {
        font-size: 1.2rem !important;
        margin-bottom: 0 !important;
        display: block !important;
        width: 100% !important;
    }
    .welcome-emojis {
        display: flex !important;
        width: 100% !important;
        justify-content: flex-start !important;
        min-height: 24px !important;
        gap: 5px !important;
        margin-top: 0 !important;
    }
    .welcome-emoji {
        font-size: 1.2rem !important;
    }
    .page-qhse {
        top: 110px !important;
        left: 8px !important;
        right: auto !important;
        max-width: calc(100% - 16px) !important;
        padding: 6px 10px !important;
        transform: none !important;
    }
    .live-datetime-card {
        top: 8px !important;
        right: 12px !important;
        transform: none !important;
    }
}

@media (max-width: 560px) {
    .container {
        margin-top: 182px !important;
        min-height: calc(100vh - 182px) !important;
    }
    body::after {
        height: 172px;
    }
    .welcome-title {
        font-size: 1.05rem !important;
    }
    .welcome-emoji {
        font-size: 1.05rem !important;
    }
    .page-qhse {
        top: 116px !important;
        padding: 5px 8px !important;
    }
}
