/*
  Developed by Rameez Scripts
  WhatsApp: https://whatsapp.rameezscripts.com/ (For Custom Projects)
  YouTube: https://www.youtube.com/@rameezimdad (Subscribe for more!)
*/

/* ===== Color Scheme - Light Theme (Default) ===== */
:root {
    /* UI 3 "Forest Executive" (docs/colors.md) — Primary #234E52 · Secondary #52796F · Accent #84A98C.
       Accent is 2.6:1 under white text, and every slot here carries white text (buttons, gradient
       headers, active nav), so Secondary takes the accent slot. #84A98C stays decorative (login art). */
    --navy-primary: #234E52;
    --navy-dark: #234E52;
    --navy-light: #52796F;
    --navy-accent: #52796F;
    --navy-hover: #52796F;

    /* rgb triplets — fallbacks; config.php overwrites these per user theme */
    /* squared UI: one radius for controls, one for surfaces. nothing else. */
    --r-control: 2px;
    --r-card: 3px;
    --navy-primary-rgb: 35, 78, 82;
    --navy-light-rgb: 82, 121, 111;
    --navy-accent-rgb: 82, 121, 111;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;

    /* Light Theme Colors */
    --bg-primary: #F8FAF8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --input-bg: #ffffff;
    --input-border: #d0d0d0;
    --table-hover: #f9f9f9;
    --skeleton-base: #f0f0f0;
    --skeleton-shine: #e0e0e0;
}

/* ===== Dark Theme ===== */
body.dark-mode {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #1e1e3f;
    --text-primary: #e8eaf6;
    --text-secondary: #b0b3c5;
    --text-muted: #8a8d9f;
    --border-color: #2d2d5a;
    --border-light: #252550;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --input-bg: #252550;
    --input-border: #3d3d7a;
    --table-hover: #252550;
    --skeleton-base: #252550;
    --skeleton-shine: #2d2d5a;
    /* brand greens are NOT overridden here — the chosen theme carries into dark mode
       (the old navy overrides threw a user's picked colours away after dark) */
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input, select, textarea {
    font-size: 16px !important;
    touch-action: manipulation;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--navy-primary) 0%, var(--navy-dark) 100%);
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: width 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.sidebar-title {
    color: white;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-title-text {
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-toggle-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar-toggle-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.sidebar-logo-section {
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-logo {
    width: 55px;
    height: 55px;
    min-width: 55px;
    min-height: 55px;
    max-width: 55px;
    max-height: 55px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid rgba(255,255,255,0.25);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    display: block;
    overflow: hidden;
}

.sidebar-logo:hover {
    transform: scale(1.1);
    border-color: var(--navy-accent);
    box-shadow: 0 5px 15px rgba(var(--navy-accent-rgb),0.6);
}

.sidebar-menu-section {
    flex: 1;
    padding: 20px 16px;
}

.sidebar-menu-title {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    padding: 0 12px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a,
.sidebar-menu button {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    border-radius: var(--r-control);
    font-size: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-menu a:hover,
.sidebar-menu button:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(4px);
}

.sidebar-menu a.active,
.sidebar-menu button.active {
    background: var(--navy-accent);
    color: var(--navy-on-accent, #fff);
    box-shadow: 0 4px 12px rgba(var(--navy-accent-rgb),0.3);
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-logout {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

.sidebar-logout button {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(234,67,53,0.2) 0%, rgba(234,67,53,0.3) 100%);
    border: 1px solid rgba(234,67,53,0.4);
    color: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
}

.sidebar-logout button:hover {
    background: linear-gradient(135deg, rgba(234,67,53,0.4) 0%, rgba(234,67,53,0.5) 100%);
    transform: translateY(-2px);
}

.sidebar-logout button i {
    font-size: 16px;
}

.sidebar-logout button span {
    font-size: 15px;
}

/* Sidebar User Info */
.sidebar-user-name {
    font-size: 15px;
    font-weight: 600;
    color: white;
    text-align: center;
    transition: all 0.3s ease;
}

.sidebar-user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    background: rgba(var(--navy-accent-rgb),0.3);
    padding: 4px 12px;
    border-radius: var(--r-card);
    text-transform: capitalize;
    transition: all 0.3s ease;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-title {
    justify-content: center;
}

.sidebar.collapsed .sidebar-title-text {
    display: none;
}

.sidebar.collapsed .sidebar-toggle-btn {
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--navy-primary);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar.collapsed .sidebar-logo-section {
    padding: 10px;
}

.sidebar.collapsed .sidebar-logo {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    max-width: 45px;
    max-height: 45px;
}

.sidebar.collapsed .sidebar-menu-section {
    padding: 15px 8px;
}

.sidebar.collapsed .sidebar-menu-title {
    display: none;
}

.sidebar.collapsed .sidebar-menu a,
.sidebar.collapsed .sidebar-menu button {
    justify-content: center;
    padding: 14px 10px;
    gap: 0;
}

.sidebar.collapsed .sidebar-menu a span,
.sidebar.collapsed .sidebar-menu button span {
    display: none;
}

.sidebar.collapsed .sidebar-menu a i,
.sidebar.collapsed .sidebar-menu button i {
    font-size: 20px;
    width: auto;
}

.sidebar.collapsed .sidebar-menu a:hover,
.sidebar.collapsed .sidebar-menu button:hover {
    transform: scale(1.1);
}

/* Hide submenu arrow in collapsed state */
.sidebar.collapsed .submenu-arrow {
    display: none;
}

/* Submenu in collapsed state */
.sidebar.collapsed .sidebar-submenu {
    position: absolute;
    left: 70px;
    top: 0;
    width: 200px;
    background: var(--navy-dark);
    border-radius: var(--r-card);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
    max-height: none;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
}

.sidebar.collapsed .has-submenu:hover .sidebar-submenu {
    opacity: 1;
    visibility: visible;
}

.sidebar.collapsed .sidebar-submenu a {
    padding: 12px 16px;
    justify-content: flex-start;
    gap: 10px;
}

.sidebar.collapsed .sidebar-submenu a span {
    display: inline;
}

.sidebar.collapsed .sidebar-submenu a i {
    font-size: 14px;
    width: 20px;
}

/* Theme toggle in collapsed state */
.sidebar.collapsed .sidebar-theme {
    padding: 12px 8px;
}

.sidebar.collapsed .sidebar-theme button {
    padding: 14px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-theme button span {
    display: none;
}

.sidebar.collapsed .sidebar-theme button i {
    font-size: 20px;
}

/* Logout button in collapsed state */
.sidebar.collapsed .sidebar-logout {
    padding: 12px 8px;
}

.sidebar.collapsed .sidebar-logout button {
    padding: 14px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-logout button span {
    display: none;
}

.sidebar.collapsed .sidebar-logout button i {
    font-size: 20px;
}

/* Tooltip for collapsed sidebar items */
.sidebar.collapsed .sidebar-menu li {
    position: relative;
}

.sidebar.collapsed .sidebar-menu li::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--navy-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

.sidebar.collapsed .sidebar-menu li:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu Button - DEPRECATED (Now using bottom navigation bar) */
/* Old top hamburger button - kept for backwards compatibility but hidden */
.mobile-menu-btn-old {
    display: none !important;
}

/* Bottom nav menu button is now in mobile-menu.php inline styles */

/* ===== Mobile Bottom Navigation Bar ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--navy-primary);
    z-index: 1001;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    justify-content: space-around;
    align-items: center;
    padding: 0 5px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    border-radius: var(--r-card);
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 60px;
}

.mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.mobile-nav-item span {
    white-space: nowrap;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    color: white;
    background: rgba(255,255,255,0.1);
}

.mobile-nav-item.active {
    color: var(--navy-on-accent, #fff);
    background: var(--navy-accent);
    box-shadow: 0 2px 8px rgba(var(--navy-accent-rgb),0.4);
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

.mobile-nav-more {
    color: rgba(255,255,255,0.9);
}

/* Sidebar Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Sidebar */
@media (max-width: 768px) {
    /* Show bottom navigation */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Add padding to main content for bottom nav */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: 80px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px !important;
        z-index: 1000;
        transition: left 0.3s ease;
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    /* Disable collapsed state on mobile */
    .sidebar.collapsed {
        width: 280px !important;
        left: -280px;
    }

    .sidebar.collapsed.mobile-open {
        left: 0;
    }

    .sidebar.collapsed .sidebar-title-text,
    .sidebar.collapsed .sidebar-menu-title,
    .sidebar.collapsed .sidebar-menu a span,
    .sidebar.collapsed .sidebar-menu button span,
    .sidebar.collapsed .sidebar-theme button span,
    .sidebar.collapsed .sidebar-logout button span {
        display: inline !important;
    }

    .sidebar.collapsed .sidebar-menu a,
    .sidebar.collapsed .sidebar-menu button,
    .sidebar.collapsed .sidebar-theme button,
    .sidebar.collapsed .sidebar-logout button {
        justify-content: flex-start !important;
        padding: 14px 16px !important;
        gap: 14px !important;
    }

    .sidebar.collapsed .sidebar-menu a i,
    .sidebar.collapsed .sidebar-menu button i {
        font-size: 18px !important;
    }

    .sidebar.collapsed .sidebar-logo {
        width: 55px !important;
        height: 55px !important;
        min-width: 55px !important;
        min-height: 55px !important;
        max-width: 55px !important;
        max-height: 55px !important;
    }

    .sidebar.collapsed .submenu-arrow {
        display: inline !important;
    }

    .sidebar.collapsed .sidebar-submenu {
        position: static !important;
        width: 100% !important;
        background: transparent !important;
        box-shadow: none !important;
        opacity: 0;
        visibility: hidden;
    }

    .sidebar.collapsed .sidebar-submenu.open {
        opacity: 1;
        visibility: visible;
    }

    /* Hide sidebar toggle button on mobile */
    .sidebar-toggle-btn {
        display: none !important;
    }

    .app-container {
        flex-direction: column;
    }

    /* Adjust header for mobile */
    .header {
        padding: 15px;
    }

    .header h1 {
        font-size: 18px;
    }

    /* Data section padding adjustment */
    .data-section {
        padding: 15px;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .section-header > div {
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .section-header .btn {
        flex: 1;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .mobile-nav-item {
        padding: 8px 8px;
        min-width: 50px;
    }

    .mobile-nav-item i {
        font-size: 18px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }
}

/* Dark mode for mobile navigation */
body.dark-mode .mobile-bottom-nav {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

body.dark-mode .mobile-nav-item {
    color: var(--text-muted);
}

body.dark-mode .mobile-nav-item:hover,
body.dark-mode .mobile-nav-item:focus {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

body.dark-mode .mobile-nav-item.active {
    color: var(--navy-on-accent, #fff);
    background: var(--navy-accent);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
    transition: background-color 0.3s ease, margin-left 0.3s ease;
}

/* the ONE page header — page icon + title + breadcrumb left, active branch + tools right.
   never stack a separate breadcrumb bar or a second header bar under this. */
.header {
    background: var(--bg-card);
    padding: 13px 20px;
    border-radius: var(--r-control);
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    color: var(--text-primary);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-page { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-page-icon {
    flex: 0 0 44px; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-card);
    background: rgba(var(--navy-accent-rgb), 0.10);
    color: var(--navy-accent-ink, var(--navy-accent));
    font-size: 18px;
}
.header-page-txt { min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 14px; }

.header h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-section {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--r-control);
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== Skeleton Loaders ===== */
.skeleton {
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 3px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-table {
    width: 100%;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--r-control);
    transition: background-color 0.3s ease;
}

.skeleton-table-row {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

.skeleton-table-cell {
    height: 20px;
    border-radius: var(--r-control);
}

.skeleton-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--r-card);
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--navy-primary);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.skeleton-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--r-card);
    margin-bottom: 16px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
    border-radius: var(--r-control);
}

.skeleton-text-large {
    height: 32px;
    margin-bottom: 8px;
    border-radius: var(--r-control);
}

.skeleton-chart {
    width: 100%;
    height: 300px;
    border-radius: var(--r-control);
}

/* ===== Dashboard Stats ===== */
.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

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

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--r-card);
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--navy-primary);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--shadow-hover);
}

.stat-card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy-accent-ink, var(--navy-accent));
    margin-bottom: 8px;
}

body.dark-mode .stat-card-value {
    color: #5dade2;
}

.stat-card-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

/* ===== Charts ===== */
.chart-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--r-card);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.chart-card h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--r-control);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none; /* a nav link styled as a button must not keep the anchor underline */
}

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

.btn-primary:hover {
    background: var(--navy-hover);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #2d8e47;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c8392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* DataTable responsive hint for mobile */
.table-scroll-hint {
    display: none;
    text-align: center;
    padding: 10px;
    background: rgba(var(--navy-accent-rgb), 0.1);
    border-radius: var(--r-card);
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--navy-accent-ink, var(--navy-accent));
}

.table-scroll-hint i {
    margin-right: 6px;
}

@media (max-width: 768px) {
    .table-scroll-hint {
        display: block;
    }
}

/* ===== Action Icons ===== */
.action-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 10px;
    margin: 0 4px;
    border-radius: var(--r-control);
    transition: all 0.3s;
}

.action-icon.edit-icon {
    color: var(--warning);
}

.action-icon.edit-icon:hover {
    background: rgba(251,188,4,0.1);
    transform: scale(1.15);
}

.action-icon.delete-icon {
    color: var(--danger);
}

.action-icon.delete-icon:hover {
    background: rgba(234,67,53,0.1);
    transform: scale(1.15);
}

.action-icon.view-icon {
    color: var(--navy-accent-ink, var(--navy-accent));
}

.action-icon.view-icon:hover {
    background: rgba(var(--navy-accent-rgb),0.1);
    transform: scale(1.15);
}

/* ===== Status Badges ===== */
.status-badge {
    padding: 6px 14px;
    border-radius: var(--r-control);
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-admin {
    background: #d4edda;
    color: #155724;
}

.status-user {
    background: #cce5ff;
    color: #004085;
}

.status-current {
    background: #e3f2fd;
    color: #1565c0;
    font-size: 11px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--navy-accent-ink, var(--navy-accent));
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--input-border);
    border-radius: var(--r-control);
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 2px rgba(var(--navy-accent-rgb),0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* a dropdown trigger is a div, so the input rule above never reached it — it sat ~8px shorter
   with a different border than the date box beside it. keyed off the GROUP, so a new control
   dropped into a form can't miss the box. */
.form-group .sd-trigger {
    padding: 14px 16px;
    border: 1px solid var(--input-border);
    border-radius: var(--r-control);
}

.form-group input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group .sd-trigger {
    min-height: 50px;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.error {
    margin-top: 15px;
    margin-bottom: 15px;
    color: var(--danger);
    font-size: 14px;
    background: #fef2f2;
    padding: 12px;
    border-radius: var(--r-card);
    border: 1px solid #fecaca;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

body.dark-mode .modal-overlay {
    background: rgba(0,0,0,0.8);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--r-card);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px var(--shadow-hover);
    transition: background-color 0.3s ease;
}

.modal-header {
    padding: 24px 30px;
    background: var(--navy-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--r-card) 4px 0 0;
}

body.dark-mode .modal-header {
    background: var(--navy-light);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

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

.modal-body {
    padding: 30px;
    color: var(--text-primary);
}

/* ===== Filters Section ===== */
.filters-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    padding: 20px;
    margin-bottom: 25px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--navy-accent);
}

.filters-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* a lone filter would otherwise stretch the whole card width */
.filters-grid > .filter-group:only-child {
    max-width: 340px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* hint line under a heading or a field — was used on 10 pages with no rule at all,
   so it rendered at full body size and competed with the heading above it */
.info-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
}

.info-text > i {
    flex: none;
    margin-top: 2px;
    opacity: 0.85;
}

/* as a section intro it has to clear the header; as a field hint the form-group gap already spaces it */
p.info-text {
    margin: 4px 0 20px;
}

/* several of these are filled by JS — take no room until they have something to say */
.info-text:empty {
    display: none;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* EVERY control inside a filter group wears the same box — keyed off the group, not off a class
   the markup has to remember, so a bare <input type="date"> can never again render as a browser
   default next to a styled dropdown. min-height keeps a native date control and an sd-trigger
   on exactly the same baseline. */
.filter-input,
.filter-group input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.filter-group select,
.filter-group textarea,
.filter-group .sd-trigger {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 2px solid var(--input-border);
    border-radius: var(--r-control);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.filter-input:focus,
.filter-group input:not([type="hidden"]):focus,
.filter-group select:focus,
.filter-group textarea:focus,
.filter-group .sd-trigger:focus,
.filter-group .searchable-dropdown.open .sd-trigger {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb),0.15);
}

/* the sd panel must line up under the trigger, not float a stale white box in dark mode */
body.dark-mode .filter-group .sd-trigger { background: var(--input-bg); }
/* a native date/time picker paints itself light unless the control declares its scheme */
body.dark-mode .filter-group input[type="date"],
body.dark-mode .filter-group input[type="time"],
body.dark-mode .filter-group input[type="datetime-local"],
body.dark-mode .filter-group input[type="month"] { color-scheme: dark; }

/* ===== Account Info Card ===== */
.account-info-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--r-card);
    box-shadow: 0 2px 8px var(--shadow-color);
    border-left: 4px solid var(--navy-accent);
    margin-bottom: 30px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.account-info-card h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    width: 180px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-value {
    color: var(--text-primary);
    flex: 1;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 220px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-3,
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
    }

    .filters-section {
        padding: 15px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filters-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .filters-header .btn-sm {
        width: 100%;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }

    .info-label {
        width: 100%;
    }

    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ===== Login Page Specific ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: var(--r-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 3px solid var(--navy-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.login-box h2 {
    margin-bottom: 35px;
    color: var(--navy-primary);
    font-size: 26px;
    font-weight: 600;
}

.login-footer {
    margin-top: 24px;
    font-size: 13px;
    color: #666;
}

@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }
}

/* ===== Settings Page - 2x2 Grid Layout ===== */

/* Main Grid */
.settings-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

/* Mega Cards */
.settings-mega-card {
    background: white;
    border-radius: var(--r-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.settings-mega-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--navy-accent);
}

/* Card Header */
.settings-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 24px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-primary);
    margin: 0 0 4px 0;
}

.settings-card-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* Card Body */
.settings-card-body {
    padding: 24px;
}

/* Stat Items (inline) */
.stat-item-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--r-card);
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.stat-item-inline:last-child {
    margin-bottom: 0;
}

.stat-item-inline:hover {
    background: #fff;
    border-color: var(--navy-accent);
    box-shadow: 0 2px 8px rgba(var(--navy-accent-rgb), 0.1);
}

.stat-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-item-content {
    flex: 1;
}

.stat-item-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item-value {
    font-size: 16px;
    color: var(--navy-primary);
    font-weight: 700;
}

/* Control Group */
.control-group {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: var(--r-card);
    padding: 20px;
    margin-bottom: 16px;
}

.control-group-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.control-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--r-card);
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--navy-primary-rgb), 0.2);
}

.control-info {
    flex: 1;
}

.control-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 4px;
}

.control-desc {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.control-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

/* Large Toggle Switch */
.toggle-switch-large {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.toggle-input-large {
    display: none;
}

.toggle-label-large {
    display: block;
    width: 80px;
    height: 40px;
    background: #ccc;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider-large {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-input-large:checked + .toggle-label-large {
    background: var(--success);
}

.toggle-input-large:checked + .toggle-label-large .toggle-slider-large {
    transform: translateX(40px);
}

.toggle-label-large:hover {
    opacity: 0.9;
}

/* Toggle Status */
.toggle-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-enabled {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.2);
}

.status-disabled {
    background: #ccc;
    box-shadow: none;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(52, 168, 83, 0.1);
    }
}

.status-text {
    font-size: 14px;
    font-weight: 600;
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(var(--navy-accent-rgb), 0.05);
    border: 1px solid rgba(var(--navy-accent-rgb), 0.2);
    border-left: 4px solid var(--navy-accent);
    padding: 14px 16px;
    border-radius: var(--r-card);
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.info-banner i {
    color: var(--navy-accent-ink, var(--navy-accent));
    font-size: 18px;
    flex-shrink: 0;
}

/* Security Features */
.security-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--r-card);
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.security-feature:last-child {
    margin-bottom: 0;
}

.security-feature:hover {
    background: white;
    border-color: var(--success);
    box-shadow: 0 2px 8px rgba(52, 168, 83, 0.1);
}

.security-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-card);
    background: linear-gradient(135deg, var(--success) 0%, #2d9148 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.2);
}

.security-feature-content {
    flex: 1;
}

.security-feature-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 4px;
}

.security-feature-desc {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.security-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--r-card);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.security-feature-badge.active {
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
    border: 2px solid rgba(52, 168, 83, 0.3);
}

/* Server Info Items */
.server-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f3f5;
}

.server-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.server-info-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.server-info-label i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy-accent-ink, var(--navy-accent));
    font-size: 16px;
}

.server-info-value {
    font-size: 14px;
    color: var(--navy-primary);
    font-weight: 700;
}

.version-badge,
.upload-badge {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
    padding: 6px 14px;
    border-radius: var(--r-card);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(var(--navy-primary-rgb), 0.2);
}

.upload-badge {
    background: linear-gradient(135deg, var(--success) 0%, #2d9148 100%);
}

.time-value {
    font-family: 'Courier New', monospace;
    background: rgba(var(--navy-accent-rgb), 0.05);
    padding: 6px 12px;
    border-radius: var(--r-card);
    color: var(--navy-accent-ink, var(--navy-accent));
    font-size: 13px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 60px;
    height: 32px;
    background: #ccc;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
    background: var(--success);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(28px);
}

.toggle-label:hover {
    opacity: 0.9;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 24px;
    border-radius: var(--r-card);
    text-align: center;
    border: 1px solid #dee2e6;
    transition: all 0.3s;
}

.info-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--navy-accent);
}

.info-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.info-value {
    font-size: 18px;
    color: var(--navy-primary);
    font-weight: 700;
}

/* Dashboard Grid 4 */
.dashboard-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Security Cards */
.security-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.security-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: var(--r-card);
    padding: 20px;
    display: flex;
    gap: 16px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.security-card:hover {
    border-color: var(--success);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.15);
    transform: translateY(-2px);
}

.security-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.security-card-content {
    flex: 1;
}

.security-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-primary);
    margin-bottom: 6px;
}

.security-card-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.security-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
    padding: 4px 10px;
    border-radius: var(--r-card);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(52, 168, 83, 0.2);
}

/* Info Table */
.info-table {
    background: white;
    border-radius: var(--r-card);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.info-table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.3s;
}

.info-table-row:last-child {
    border-bottom: none;
}

.info-table-row:hover {
    background: #f8f9fa;
}

.info-table-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-table-label i {
    color: var(--navy-accent-ink, var(--navy-accent));
    width: 20px;
    text-align: center;
}

.info-table-value {
    font-size: 14px;
    color: var(--navy-primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: rgba(var(--navy-primary-rgb), 0.05);
    padding: 6px 12px;
    border-radius: var(--r-card);
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .settings-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .settings-card-header {
        padding: 20px;
    }

    .settings-card-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .settings-card-title {
        font-size: 18px;
    }

    .settings-card-body {
        padding: 20px;
    }

    .control-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .control-toggle-wrapper {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .toggle-status {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .setting-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-switch {
        align-self: flex-start;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-4 {
        grid-template-columns: 1fr;
    }

    .security-info-grid {
        grid-template-columns: 1fr;
    }

    .info-table-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .info-table-value {
        width: 100%;
        text-align: left;
    }

    .server-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .server-info-value {
        width: 100%;
    }
}

/* ===== Sidebar Submenu Styles ===== */
.sidebar-menu .has-submenu {
    position: relative;
}

.submenu-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 12px;
    margin-left: auto;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.submenu-toggle.open .submenu-arrow {
    transform: rotate(180deg);
    color: white;
}

.sidebar-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--r-control);
    margin-top: 4px;
}

.sidebar-submenu.open {
    max-height: 500px;
    opacity: 1;
    margin-bottom: 8px;
}

.sidebar-submenu li {
    margin-bottom: 0;
}

.sidebar-submenu a {
    width: 100%;
    text-align: left;
    padding: 12px 16px 12px 48px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: var(--r-control);
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 400;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-submenu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: var(--navy-accent);
    padding-left: 52px;
}

.sidebar-submenu a.active {
    background: rgba(var(--navy-accent-rgb), 0.25);
    color: white;
    border-left-color: var(--navy-accent);
    font-weight: 500;
}

.sidebar-submenu a i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.submenu-toggle.active {
    background: var(--navy-accent);
    color: var(--navy-on-accent, #fff);
}

@media (max-width: 768px) {
    .sidebar-submenu a {
        padding: 12px 16px 12px 40px;
        font-size: 13px;
    }

    .sidebar-submenu a:hover {
        padding-left: 44px;
    }
}

/* ===== Setup Page Styles ===== */
.setup-wrapper {
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
}

.setup-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--r-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.setup-container h2 {
    color: var(--navy-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setup-container .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.setup-container hr {
    border: none;
    border-top: 2px solid var(--navy-primary);
    margin-bottom: 30px;
}

.log-item {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: var(--r-card);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-success {
    background: #d4edda;
    border-left-color: var(--success);
    color: #155724;
}

.log-error {
    background: #f8d7da;
    border-left-color: var(--danger);
    color: #721c24;
}

.log-info {
    background: #d1ecf1;
    border-left-color: var(--navy-accent);
    color: #0c5460;
}

.credentials-box {
    background: #fff3cd;
    padding: 20px;
    border-radius: var(--r-card);
    margin: 20px 0;
    border-left: 4px solid #ffc107;
}

.credentials-box strong {
    color: var(--navy-primary);
}

/* ===== Theme Toggle ===== */
.sidebar .sidebar-theme {
    padding: 16px 20px;
    background: rgba(0,0,0,0.15);
}

.sidebar .sidebar-theme button {
    width: 100% !important;
    padding: 14px 16px !important;
    background: linear-gradient(135deg, rgba(251,188,4,0.2) 0%, rgba(251,188,4,0.3) 100%) !important;
    border: 1px solid rgba(251,188,4,0.4) !important;
    color: white !important;
    cursor: pointer !important;
    border-radius: var(--r-control) !important;
    font-size: 15px !important;
    transition: all 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-weight: 600 !important;
    font-family: inherit;
    text-align: center;
    box-sizing: border-box;
}

.sidebar .sidebar-theme button:hover {
    background: linear-gradient(135deg, rgba(251,188,4,0.4) 0%, rgba(251,188,4,0.5) 100%) !important;
    transform: translateY(-2px);
}

.sidebar .sidebar-theme button i {
    font-size: 16px;
    width: auto;
}

.sidebar .sidebar-theme button span {
    font-size: 15px;
}

/* ===== Google Translate Widget ===== */
/* Hide Google Translate top bar */
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
}

/* Dark mode specific overrides */
body.dark-mode .login-container {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

body.dark-mode .login-box {
    background: var(--bg-card);
    box-shadow: 0 4px 20px var(--shadow-hover);
}

body.dark-mode .login-box h2 {
    color: var(--text-primary);
}

/* Login Page Theme Toggle */
.login-theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: var(--r-card);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 1000;
}

.login-theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

body.dark-mode .login-theme-toggle {
    background: var(--bg-card);
    border-color: var(--navy-accent);
    color: #ffd700;
}

body.dark-mode .setup-wrapper {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

body.dark-mode .setup-container {
    background: var(--bg-card);
    box-shadow: 0 4px 20px var(--shadow-hover);
}

body.dark-mode .setup-container h2 {
    color: var(--text-primary);
}

body.dark-mode .setup-container .subtitle {
    color: var(--text-muted);
}

body.dark-mode .setup-container hr {
    border-top-color: var(--border-color);
}

body.dark-mode .log-item {
    border-left-width: 4px;
}

body.dark-mode .log-success {
    background: rgba(52, 168, 83, 0.15);
    color: #6fcf97;
}

body.dark-mode .log-error {
    background: rgba(234, 67, 53, 0.15);
    color: #f5857a;
}

body.dark-mode .log-info {
    background: rgba(var(--navy-accent-rgb), 0.15);
    color: #5dade2;
}

body.dark-mode .credentials-box {
    background: rgba(251, 188, 4, 0.1);
    border-color: rgba(251, 188, 4, 0.4);
    color: var(--text-secondary);
}

body.dark-mode .credentials-box strong {
    color: var(--text-primary);
}

/* Settings Page Dark Mode */
body.dark-mode .settings-mega-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .settings-card-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom-color: var(--border-color);
}

body.dark-mode .settings-card-title {
    color: var(--text-primary);
}

body.dark-mode .settings-card-subtitle {
    color: var(--text-muted);
}

body.dark-mode .stat-item-inline {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .stat-item-label {
    color: var(--text-muted);
}

body.dark-mode .stat-item-value {
    color: var(--text-primary);
}

body.dark-mode .control-group {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-color: var(--border-color);
}

body.dark-mode .control-title {
    color: var(--text-primary);
}

body.dark-mode .control-desc {
    color: var(--text-muted);
}

body.dark-mode .control-toggle-wrapper {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .info-banner {
    background: rgba(var(--navy-accent-rgb), 0.1);
    border-color: rgba(var(--navy-accent-rgb), 0.3);
    color: var(--text-secondary);
}

body.dark-mode .security-feature {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .security-feature-name {
    color: var(--text-primary);
}

body.dark-mode .security-feature-desc {
    color: var(--text-muted);
}

body.dark-mode .server-info-item {
    border-bottom-color: var(--border-light);
}

body.dark-mode .server-info-label {
    color: var(--text-muted);
}

body.dark-mode .server-info-value {
    color: var(--text-primary);
}

body.dark-mode .time-value {
    background: rgba(var(--navy-accent-rgb), 0.1);
    color: var(--navy-accent-ink, var(--navy-accent));
}

/* Dashboard Page Dark Mode */
body.dark-mode .data-section p {
    color: var(--text-secondary);
}

body.dark-mode .data-section strong {
    color: var(--text-primary);
}

/* Logs Page Dark Mode - Empty Details */
body.dark-mode em.text-muted,
body.dark-mode .text-muted em {
    color: var(--text-muted) !important;
}

/* Version/Upload Badges in Dark Mode */
body.dark-mode .version-badge,
body.dark-mode .upload-badge {
    color: white !important;
}

/* Ensure form inputs text is visible in dark mode */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-muted);
}

/* Filter labels in dark mode */
body.dark-mode .filter-group label {
    color: var(--text-secondary);
}

/* Settings page stat items dark mode */
body.dark-mode .stat-item-inline:hover {
    background: var(--bg-card);
    border-color: var(--navy-accent);
}

body.dark-mode .security-feature:hover {
    background: var(--bg-card);
    border-color: var(--success);
}

/* Ensure all header welcome text is visible */
body.dark-mode .header > div {
    color: var(--text-secondary) !important;
}

/* ===== UI Customization / Theme Section ===== */
.theme-preview {
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

body.dark-mode .theme-preview {
    background: var(--bg-card);
    border-color: var(--border-color) !important;
}

.theme-preview h4 {
    color: var(--text-primary);
}

/* Color picker styling */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--r-card);
}

/* Preset buttons */
.preset-btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.preset-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Theme mode options */
.theme-mode-option {
    transition: all 0.3s ease;
}

.theme-mode-option:hover {
    border-color: var(--navy-accent) !important;
    background: var(--bg-secondary);
}

.theme-mode-option:has(input:checked) {
    border-color: var(--navy-accent) !important;
    background: rgba(var(--navy-accent-rgb), 0.1);
}

body.dark-mode .theme-mode-option {
    border-color: var(--border-color) !important;
}

body.dark-mode .theme-mode-option:hover {
    border-color: var(--navy-accent) !important;
    background: var(--bg-secondary);
}

body.dark-mode .theme-mode-option:has(input:checked) {
    border-color: var(--navy-accent) !important;
    background: rgba(var(--navy-accent-rgb), 0.2);
}

/* Responsive theme form */
@media (max-width: 768px) {
    #themeForm .form-grid {
        grid-template-columns: 1fr !important;
    }

    .preset-btn {
        width: 35px !important;
        height: 35px !important;
    }

    .theme-mode-option {
        flex: 1;
        justify-content: center;
    }
}

/* SweetAlert2 Dark Mode */
body.dark-mode .swal2-popup {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .swal2-title {
    color: var(--text-primary) !important;
}

body.dark-mode .swal2-html-container {
    color: var(--text-secondary) !important;
}

body.dark-mode .swal2-input,
body.dark-mode .swal2-textarea {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

/* ===== Text Utility Classes ===== */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* ===== COMPREHENSIVE MOBILE RESPONSIVE STYLES ===== */

/* Smooth scrolling for better UX */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow */
body {
    overflow-x: hidden;
}

/* Mobile-optimized scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--navy-accent);
    border-radius: var(--r-control);
}

/* Safe area padding for iOS devices with notch */
@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 8px);
        height: calc(65px + env(safe-area-inset-bottom, 0px));
    }

    .main-content {
        padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
}

/* ===== Mobile Responsive (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Main content adjustments */
    .main-content {
        padding: 15px;
        padding-bottom: 90px;
    }

    /* Header mobile optimization */
    .header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .header h1 {
        font-size: 18px;
        width: 100%;
    }

    .header > div {
        font-size: 13px;
        width: 100%;
        text-align: right;
    }

    /* Data section mobile */
    .data-section {
        padding: 15px;
        border-radius: var(--r-card);
    }

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

    .section-header h2 {
        font-size: 18px;
    }

    .section-header .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    /* Stat cards mobile */
    .stat-card {
        padding: 20px;
    }

    .stat-card-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin-bottom: 12px;
    }

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

    .stat-card-label {
        font-size: 12px;
    }

    /* Charts mobile */
    .chart-card {
        padding: 15px;
    }

    .chart-container {
        height: 250px;
    }

    /* Buttons mobile - larger touch targets */
    .btn {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }

    .btn-sm {
        padding: 12px 16px;
        min-height: 44px;
    }

    /* Form inputs mobile - larger touch targets */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 16px;
        font-size: 16px !important;
        min-height: 52px;
        border-radius: var(--r-card);
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 10px;
    }

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

    .form-actions {
        flex-direction: column;
        gap: 12px;
    }

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

    /* Filter inputs mobile */
    .filter-input {
        padding: 14px 12px;
        font-size: 16px !important;
        min-height: 50px;
    }

    /* Modal mobile full screen */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--r-card) 16px 0 0;
        margin: 0;
    }

    .modal-header {
        padding: 20px;
        border-radius: var(--r-card) 16px 0 0;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .modal-body {
        padding: 20px;
        max-height: calc(95vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Account info cards mobile */
    .account-info-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .account-info-card h3 {
        font-size: 18px;
    }

    .info-row {
        flex-direction: column;
        gap: 8px;
        padding: 12px 0;
    }

    .info-label {
        width: 100%;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .info-value {
        font-size: 15px;
        font-weight: 500;
    }

    /* Login page mobile */
    .login-container {
        padding: 15px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .login-box {
        padding: 30px 20px;
        border-radius: var(--r-card);
        width: 100%;
        max-width: 100%;
    }

    .login-logo {
        width: 90px;
        height: 90px;
        margin-bottom: 20px;
    }

    .login-box h2 {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .login-box .form-group input {
        padding: 16px;
    }

    .login-box .btn {
        padding: 16px;
        font-size: 16px;
    }

    /* Settings page mobile */
    .settings-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .settings-mega-card {
        border-radius: var(--r-card);
    }

    .settings-card-header {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .settings-card-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .settings-card-title {
        font-size: 16px;
    }

    .settings-card-body {
        padding: 16px;
    }

    .control-group {
        padding: 15px;
        margin-bottom: 12px;
    }

    .control-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .control-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .control-title {
        font-size: 15px;
    }

    .control-toggle-wrapper {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    /* Security features mobile */
    .security-feature {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 14px;
    }

    .security-feature-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Server info mobile */
    .server-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }

    /* Stat items inline mobile */
    .stat-item-inline {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 14px;
    }

    .stat-item-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    /* Status badges mobile */
    .status-badge {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Filters mobile */
    .filters-section {
        padding: 12px;
        margin-bottom: 15px;
    }

    .filters-header {
        padding-bottom: 12px;
        margin-bottom: 15px;
    }

    .filters-header h3 {
        font-size: 16px;
    }

    .filters-grid {
        gap: 12px;
    }

    .filter-group label {
        font-size: 12px;
    }

    /* Profile image section mobile */
    .profile-image-container {
        max-width: 100%;
    }

    /* Theme customization mobile */
    #themeForm .form-grid {
        grid-template-columns: 1fr !important;
    }

    .preset-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .theme-mode-option {
        padding: 12px !important;
    }

    .theme-preview {
        padding: 15px !important;
    }
}

/* ===== Extra Small Devices (max-width: 480px) ===== */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
        padding-bottom: 85px;
    }

    .header {
        padding: 12px;
    }

    .header h1 {
        font-size: 16px;
    }

    .data-section {
        padding: 12px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .stat-card {
        padding: 15px;
    }

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

    .stat-card-label {
        font-size: 11px;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 200px;
    }

    .modal-body {
        padding: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px;
    }

    .login-box {
        padding: 25px 15px;
    }

    .login-logo {
        width: 80px;
        height: 80px;
    }

    .login-box h2 {
        font-size: 20px;
    }

    .account-info-card {
        padding: 15px;
    }

    .info-label {
        font-size: 11px;
    }

    .info-value {
        font-size: 14px;
    }

    /* Mobile bottom nav extra small */
    .mobile-nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }

    .mobile-nav-item i {
        font-size: 18px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }
}

/* ===== Landscape Mobile Orientation ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-bottom-nav {
        height: 55px;
    }

    .mobile-nav-item {
        padding: 5px 10px;
    }

    .mobile-nav-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }

    .main-content {
        padding-bottom: 70px;
    }

    .modal {
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        max-height: calc(100vh - 70px);
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for touch devices */
    .btn {
        min-height: 48px;
    }

    .action-icon {
        min-width: 48px;
        min-height: 48px;
    }

    .sidebar-menu a,
    .sidebar-menu button {
        min-height: 50px;
    }

    .mobile-nav-item {
        min-height: 56px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }

    .action-icon:hover {
        transform: none;
    }

    /* Add active states for touch feedback */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .action-icon:active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    .mobile-nav-item:active {
        transform: scale(0.95);
        opacity: 0.9;
    }

    .sidebar-menu a:active,
    .sidebar-menu button:active {
        transform: scale(0.98);
    }
}

/* ===== iOS Specific Fixes ===== */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS 100vh issue */
    .login-container {
        min-height: -webkit-fill-available;
    }

    .app-container {
        min-height: -webkit-fill-available;
    }

    /* Fix for iOS input zoom */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Fix for iOS momentum scrolling */
    .modal-body,
    .main-content,
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Pull to Refresh Prevention ===== */
body {
    overscroll-behavior-y: contain;
}

/* ===== Tablet Responsive (768px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .dashboard-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-grid-2x2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        width: 85%;
        max-width: 700px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .sidebar,
    .mobile-bottom-nav,
    .sidebar-overlay,
    .btn,
    .action-icon {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 20px;
    }

    .app-container {
        display: block;
    }
}

/* ===== Dark Mode Global Text Colors ===== */
body.dark-mode {
    color: var(--text-primary);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--text-primary) !important;
}

body.dark-mode p,
body.dark-mode span:not(.status-badge):not(.role-badge):not(.version-badge):not(.upload-badge):not(.room-status):not(.room-tile-no):not(.room-tile-type):not(.room-tile-status):not(.count-chip):not(.floor-count):not(.chip):not(.val):not(.val-box):not(.val-muted):not(.tc-bar-name):not(.tc-bar-meta):not(.tc-room-no):not(.tc-room-un):not(.pos-item-name):not(.pos-item-price):not(.pos-line-amt):not(.pos-line-note):not(.rv-stars):not(.rv-crown):not(.rc-vip):not(.fb-label):not(.sc-ok):not(.sc-short):not(.sc-over):not(.info-box-number):not(.gm-hit),
body.dark-mode div:not(.sidebar):not(.modal-header):not(.stat-card-icon):not(.settings-card-icon):not(.cell-title):not(.bk-avail):not(.bk-pick):not(.tc-bar):not(.pos-item):not(.rc-box):not(.rc-row):not(.rc-terms):not(.rc-sheet):not(.gm-hit):not(.guest-vip-note),
body.dark-mode label {
    color: var(--text-secondary);
}

body.dark-mode .text-muted,
body.dark-mode .info-text,
body.dark-mode .help-text,
body.dark-mode em.text-muted {
    color: var(--text-muted) !important;
}

/* Account Page Dark Mode */
body.dark-mode .account-info-card {
    background: var(--bg-card);
    border-left-color: var(--navy-accent);
}

body.dark-mode .account-info-card h3 {
    color: var(--text-primary);
}

body.dark-mode .info-row {
    border-bottom-color: var(--border-light);
}

body.dark-mode .info-label {
    color: var(--text-secondary);
}

body.dark-mode .info-value {
    color: var(--text-primary);
}

/* Profile Image Section Dark Mode */
body.dark-mode .profile-image-container {
    background: var(--bg-secondary);
    border-color: var(--navy-accent);
}

body.dark-mode .profile-image-label {
    color: var(--text-muted) !important;
}

body.dark-mode #defaultProfileIcon {
    color: var(--navy-accent-ink, var(--navy-accent)) !important;
}

/* Form Labels and Text Dark Mode */
body.dark-mode .form-group label {
    color: var(--text-secondary);
}

body.dark-mode .form-group label i {
    color: var(--navy-accent-ink, var(--navy-accent));
}

/* Section Headers Dark Mode */
body.dark-mode .section-header h2 {
    color: var(--text-primary);
}

body.dark-mode .data-section {
    background: var(--bg-card);
}

/* Info/Help Text Dark Mode */
body.dark-mode [style*="color: #666"],
body.dark-mode [style*="color:#666"] {
    color: var(--text-muted) !important;
}

/* Warning/Disabled Messages Dark Mode */
body.dark-mode #uploadDisabledMessage {
    background: rgba(251, 188, 4, 0.1) !important;
    border-color: rgba(251, 188, 4, 0.4) !important;
    color: #ffd54f !important;
}

/* File Input Dark Mode */
body.dark-mode input[type="file"] {
    background: var(--bg-secondary) !important;
    border-color: var(--navy-accent) !important;
    color: var(--text-primary) !important;
}

/* Header Welcome Text Dark Mode */
body.dark-mode .header {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.dark-mode .header div {
    color: var(--text-secondary);
}

/* ===== Profile Image Section ===== */
.profile-section-grid {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.profile-image-display {
    text-align: center;
    flex-shrink: 0;
}

.profile-image-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--navy-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 0 auto 15px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-image-container #defaultProfileIcon {
    font-size: 50px;
    color: var(--navy-accent-ink, var(--navy-accent));
}

.profile-image-label {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-upload-form {
    flex: 1;
    min-width: 280px;
}

.file-input-styled {
    width: 100%;
    padding: 14px;
    border: 2px dashed var(--navy-accent);
    border-radius: var(--r-card);
    background: var(--bg-secondary);
    font-size: 16px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-styled:hover {
    border-color: var(--navy-primary);
    background: var(--bg-primary);
}

.help-text {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.warning-message {
    padding: 15px;
    background: rgba(251, 188, 4, 0.15);
    border: 1px solid rgba(251, 188, 4, 0.5);
    border-radius: var(--r-card);
    color: var(--warning);
    margin-top: 15px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .profile-section-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .profile-image-display {
        width: 100%;
    }

    .profile-image-container {
        width: 100px;
        height: 100px;
    }

    .profile-image-container #defaultProfileIcon {
        font-size: 40px;
    }

    .profile-upload-form {
        width: 100%;
        min-width: unset;
    }

    .file-input-styled {
        padding: 16px;
    }
}

/* ===== Theme Customization Section Mobile ===== */
@media (max-width: 768px) {
    .theme-preview-container {
        padding: 15px;
    }

    .theme-preview-swatches {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #previewPrimary,
    #previewSecondary,
    #previewAccent {
        width: 100% !important;
        height: 40px !important;
    }

    #previewButton {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 10px !important;
    }

    .theme-mode-option {
        flex: 1;
        justify-content: center;
        padding: 14px 16px !important;
    }
}

/* ===== Setup Guide Table (OAuth & SMTP) ===== */
.setup-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.setup-guide-table thead tr {
    background: var(--navy-primary);
    color: white;
}

.setup-guide-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
}

.setup-guide-table td {
    padding: 14px 16px;
}

.setup-guide-table tbody tr {
    border-bottom: 1px solid var(--input-border, #e9ecef);
}

.setup-guide-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.setup-guide-table .step-num {
    font-weight: bold;
    color: var(--navy-accent-ink, var(--navy-accent));
    width: 50px;
}

.setup-guide-table .step-name {
    font-weight: 600;
    min-width: 180px;
}

.setup-guide-table .step-final {
    background: rgba(52, 168, 83, 0.08);
}

.setup-guide-table .step-final .step-num {
    color: var(--success);
}

.setup-guide-table .step-final .step-name {
    color: var(--success);
}

.setup-guide-table .step-section-header td {
    background: var(--navy-primary);
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
}

.setup-guide-table code {
    background: var(--input-border, #e9ecef);
    padding: 4px 8px;
    border-radius: var(--r-card);
    font-size: 13px;
    display: inline-block;
    margin-top: 6px;
    word-break: break-all;
}

body.dark-mode .setup-guide-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .setup-guide-table .step-final {
    background: rgba(52, 168, 83, 0.1);
}

body.dark-mode .setup-guide-table .step-section-header td {
    background: var(--navy-light);
}

/* ===== Credential Status Indicator ===== */
.credential-status {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.credential-input-wrapper {
    position: relative;
}

/* ===== Success Message ===== */
.success {
    margin-top: 15px;
    margin-bottom: 15px;
    color: var(--success);
    font-size: 14px;
    background: #f0fdf4;
    padding: 12px 16px;
    border-radius: var(--r-card);
    border: 1px solid #bbf7d0;
}

body.dark-mode .success {
    background: rgba(52, 168, 83, 0.1);
    border-color: rgba(52, 168, 83, 0.3);
}

body.dark-mode .error {
    background: rgba(234, 67, 53, 0.12);
    border-color: rgba(234, 67, 53, 0.32);
}

/* ===== Login Page Utilities ===== */
.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-subtitle .highlight {
    color: var(--navy-accent-ink, var(--navy-accent));
    font-weight: 600;
}

.login-link {
    color: var(--navy-accent-ink, var(--navy-accent));
    text-decoration: none;
    font-weight: 500;
}

.login-link:hover {
    text-decoration: underline;
}

.login-footer-link {
    margin-bottom: 8px;
}

/* ===== OTP Input ===== */
.otp-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: bold;
}

/* ===== Full Width Button ===== */
.btn-block {
    width: 100%;
}

/* ===== Remember Me & Forgot Password Row ===== */
.login-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-muted);
}

.remember-me-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--navy-accent);
}

/* ===== OAuth Divider ===== */
.oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.oauth-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid var(--border-color);
}

.oauth-divider span {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* ===== Google OAuth Button ===== */
.google-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--r-card);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.google-oauth-btn:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.05);
}

/* ===== SMTP Setup Utilities ===== */
.smtp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.smtp-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.smtp-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

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

.card-divider {
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* ===== Resend OTP Section ===== */
.resend-section {
    margin-top: 20px;
    text-align: center;
}

.resend-countdown {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.resend-countdown .timer {
    font-weight: bold;
    color: var(--navy-accent-ink, var(--navy-accent));
}

/* ===== Card Icon Gradient Variants ===== */
.icon-gradient-navy {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
}
.icon-gradient-accent {
    background: linear-gradient(135deg, var(--navy-accent) 0%, var(--navy-primary) 100%);
}
.icon-gradient-navy-accent {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-accent) 100%);
}
.icon-gradient-light {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-hover) 100%);
}
.icon-gradient-success {
    background: linear-gradient(135deg, #34a853 0%, #2d9148 100%);
}
.icon-gradient-blue {
    background: linear-gradient(135deg, var(--navy-accent) 0%, var(--navy-primary) 100%);
}
.icon-gradient-warning {
    background: linear-gradient(135deg, #fbbc04 0%, #e0a800 100%);
}

/* ===== Stat Icon Color Variants ===== */
.stat-icon-success {
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
}
.stat-icon-accent {
    background: rgba(var(--navy-accent-rgb), 0.1);
    color: var(--navy-accent-ink, var(--navy-accent));
}
.stat-icon-warning {
    background: rgba(251, 188, 4, 0.1);
    color: var(--warning);
}
.stat-icon-danger {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
}

/* ===== Layout Utilities ===== */
.mb-24 { margin-bottom: 24px; }
.mb-30 { margin-bottom: 30px; }
.mt-24 { margin-top: 24px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.mt-30 { margin-top: 30px; }

/* ===== Quick Actions Bar ===== */
.quick-actions-bar {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ===== Card Body Variants ===== */
.card-body-flush {
    padding: 0;
}
.card-body-flush-scroll {
    padding: 0;
    overflow-x: auto;
}

/* ===== Info Banner Variants ===== */
.info-banner-inset {
    margin: 16px;
    border-radius: var(--r-card);
}
.info-banner-top {
    margin-top: 10px;
}

/* ===== Button Group Inline ===== */
.btn-group-inline {
    display: flex;
    gap: 10px;
}

/* ===== Table Responsive Wrapper ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-full-width {
    width: 100%;
}

/* ===== Data Table Flush ===== */
.data-table.data-table-flush {
    margin: 0;
}

/* ===== Skeleton Helpers ===== */
.skeleton-card-mb { margin-bottom: 20px; }
.skeleton-grid-mb { margin-bottom: 30px; }
.skeleton-w-50 { width: 50%; }
.skeleton-w-60 { width: 60%; }
.skeleton-w-70 { width: 70%; }
.skeleton-w-80 { width: 80%; }
.skeleton-mb-sm { margin-bottom: 12px; }
.skeleton-mb-md { margin-bottom: 16px; }
.skeleton-flex-1 { flex: 1; }
.skeleton-flex-2 { flex: 2; }

/* ===== Dashboard Activities ===== */
.activities-loading {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}
.activities-loading .fa-spinner {
    font-size: 24px;
}
.activities-loading p {
    margin-top: 10px;
}
.activities-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}
.activities-empty .fa-inbox {
    font-size: 32px;
    margin-bottom: 10px;
}

/* ===== Dashboard Activity Table Cells ===== */
.action-badge {
    padding: 4px 10px;
    border-radius: var(--r-card);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.action-badge-default {
    background: rgba(var(--navy-accent-rgb), 0.1);
    color: var(--navy-accent-ink, var(--navy-accent));
}
.action-badge-success {
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
}
.action-badge-danger {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
}
.action-badge-warning {
    background: rgba(251, 188, 4, 0.1);
    color: var(--warning);
}
.activity-detail {
    color: var(--text-muted);
    font-size: 13px;
}
.activity-ip code {
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--r-control);
}

.ip-mask-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ip-mask-wrap code {
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--r-control);
}

.ip-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    padding: 2px 4px;
    transition: color 0.2s;
}

.ip-toggle-btn:hover {
    color: var(--navy-primary);
}
.activity-time {
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Status Text Helpers ===== */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--navy-accent-ink, var(--navy-accent)); }
.text-muted { color: var(--text-muted); }

/* ===== Logo Upload Section (settings.php) ===== */
.logo-upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}
.logo-preview-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}
body.dark-mode .logo-preview-img {
    border-color: var(--border-color);
}
.logo-upload-controls {
    flex: 1;
}
.logo-upload-controls-inner {
    display: flex;
    gap: 10px;
    align-items: center;
}
.logo-upload-btn {
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 16px;
}
.logo-file-name {
    color: var(--text-muted);
    font-size: 13px;
}
.logo-help-text {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

/* ===== Form Grid Variants ===== */
.form-grid-2col {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-grid-3col {
    grid-template-columns: repeat(3, 1fr);
}

/* ===== Theme Customization (account.php) ===== */
.theme-preview-container {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: var(--r-card);
    border: 2px solid var(--border-color);
}
.theme-preview-title {
    margin-bottom: 15px;
    color: var(--text-primary);
}
.theme-preview-swatches {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}
.color-preview-box {
    width: 80px;
    height: 50px;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}
.preview-button-spacer {
    margin-left: 20px;
}
.color-picker-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.color-picker-input {
    width: 60px;
    height: 45px;
    padding: 2px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: var(--r-card);
}
.hex-input {
    flex: 1;
    text-transform: uppercase;
}
.color-help-text {
    color: var(--text-muted);
    margin-top: 5px;
    display: block;
}
.theme-mode-options {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.theme-mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--r-card);
    transition: all 0.3s;
}
.theme-mode-option input[type="radio"] {
    width: 18px;
    height: 18px;
}
.icon-sun { color: #fbbc04; }
.icon-moon { color: #5dade2; }
.preset-colors-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ===== Preset Button Base Styles ===== */
.preset-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.preset-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===== Profile Image Cover ===== */
.profile-img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== UI Help Text ===== */
.ui-help-text {
    margin-bottom: 20px;
    color: var(--text-muted);
}

/* ===== Palette Gallery (UI Customization) ===== */
.palette-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 14px;
    margin-top: 10px;
}
.palette-card {
    position: relative;
    text-align: left;
    padding: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--r-card);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.palette-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px var(--shadow-hover);
    border-color: var(--navy-accent);
}
.palette-card.active {
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 2px var(--navy-accent) inset;
}
.palette-swatch {
    display: flex;
    height: 54px;
    width: 100%;
}
.palette-swatch span { flex: 1; }
.palette-meta { padding: 10px 12px; }
.palette-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.palette-id {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.palette-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--navy-accent);
    color: var(--navy-on-accent, #fff);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}
.palette-card.active .palette-check { display: flex; }
.palette-default-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--r-card);
    letter-spacing: 0.3px;
}

/* ===== AdminLTE-style collapsible card (theme-aware) ===== */
.lte-card {
    background: var(--bg-card);
    border-radius: var(--r-card);
    box-shadow: 0 2px 6px var(--shadow-color);
    margin-bottom: 22px;
    border-top: 3px solid var(--navy-accent);
    overflow: hidden;
}
.lte-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}
.lte-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lte-card-title i { color: var(--navy-accent-ink, var(--navy-accent)); }
.lte-card-tools { display: flex; align-items: center; gap: 4px; }
.lte-card-tools button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 9px;
    font-size: 14px;
    border-radius: var(--r-card);
    transition: color 0.2s, background 0.2s;
}
.lte-card-tools button:hover { color: var(--navy-accent-ink, var(--navy-accent)); background: var(--bg-primary); }
.lte-card-body { padding: 18px; }
.lte-card.collapsed .lte-card-body { display: none; }
.lte-card.collapsed { border-top-color: var(--border-color); }

/* current theme summary strip */
.current-theme-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.current-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    min-width: 145px;
}
.current-swatch-chip {
    width: 34px;
    height: 34px;
    border-radius: var(--r-card);
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}
.current-swatch-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.current-swatch-hex {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: monospace;
}
.current-theme-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.current-theme-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 7px 15px;
    border-radius: var(--r-card);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}
.current-mode-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 7px 13px;
    border-radius: var(--r-card);
    border: 1px solid var(--border-color);
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.theme-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ===== AdminLTE small-box KPI (dashboard) ===== */
.lte-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 1200px) { .lte-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .lte-kpi-grid { grid-template-columns: 1fr; } }

.small-box {
    position: relative;
    display: block;
    border-radius: var(--r-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #fff;
    overflow: hidden;
    transition: transform 0.25s;
}
.small-box:hover { transform: translateY(-3px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.small-box .inner { padding: 18px 20px 12px; position: relative; z-index: 2; }
.small-box .inner h3 { font-size: clamp(24px, 4.5vw, 32px); font-weight: 700; margin: 0 0 6px; white-space: nowrap; }
.small-box .inner p { font-size: 14px; margin: 0; opacity: 0.95; }
.small-box .icon { position: absolute; top: 12px; right: 16px; z-index: 1; font-size: 64px; color: rgba(0, 0, 0, 0.15); transition: font-size 0.3s; }
.small-box:hover .icon { font-size: 70px; }
.small-box-footer {
    position: relative;
    display: block;
    width: 100%;
    padding: 8px 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-decoration: none;
    z-index: 3;
}
.small-box-footer:hover { background: rgba(0, 0, 0, 0.22); color: #fff; }

/* box colors — navy theme (react to user's custom accent/primary) */
.bg-navy    { background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%); }
.bg-info    { background: linear-gradient(135deg, var(--navy-accent) 0%, #3393e0 100%); }
.bg-success { background: linear-gradient(135deg, #2e8b46 0%, var(--success) 100%); }
.bg-warning { background: linear-gradient(135deg, #e0a800 0%, var(--warning) 100%); color: #1f2d3d; }
.bg-warning .small-box-footer { color: rgba(0, 0, 0, 0.65); }
.bg-danger  { background: linear-gradient(135deg, #c5221f 0%, var(--danger) 100%); }

/* ===== Header tools: quick theme + language switcher ===== */
.header-tool-wrapper { position: relative; }
.header-tool-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    padding: 8px 10px;
    border-radius: var(--r-card);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    transition: all 0.25s;
}
.header-tool-btn:hover { background: #f0f0f0; color: var(--navy-primary); }
.header-tool-btn .lang-current { font-size: 12px; font-weight: 700; }
body.dark-mode .header-tool-btn { color: var(--text-secondary); }
body.dark-mode .header-tool-btn:hover { background: var(--bg-primary); color: var(--text-primary); }

.header-tool-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    box-shadow: 0 12px 34px var(--shadow-hover);
    z-index: 1200;
    display: none;
    overflow: hidden;
}
.header-tool-dropdown.open { display: block; }
.header-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}
.header-tool-header strong { color: var(--text-primary); font-size: 14px; display: flex; align-items: center; gap: 7px; }
.mode-toggle-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--r-control);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    transition: all 0.2s;
}
.mode-toggle-btn:hover { color: var(--navy-accent-ink, var(--navy-accent)); border-color: var(--navy-accent); }

.theme-quick-menu { width: 264px; }
.theme-quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px; }
.theme-quick-swatch {
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--r-card);
    height: 34px;
    cursor: pointer;
    overflow: hidden;
    background: none;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.theme-quick-swatch span { display: block; width: 100%; height: 100%; }
.theme-quick-swatch:hover { transform: translateY(-2px); border-color: var(--navy-accent); }
.theme-quick-swatch.active { border-color: var(--navy-accent); box-shadow: 0 0 0 2px var(--navy-accent) inset; }
.header-tool-footer {
    display: block;
    text-align: center;
    padding: 11px;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-accent-ink, var(--navy-accent));
    text-decoration: none;
    border-top: 1px solid var(--border-color);
}
.header-tool-footer:hover { background: var(--bg-primary); }

.lang-menu { min-width: 214px; max-height: 340px; overflow-y: auto; padding: 6px; }
.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 9px 11px;
    border-radius: var(--r-card);
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-primary);
    text-align: left;
}
.lang-item:hover { background: var(--bg-primary); }
.lang-item.active { background: rgba(var(--navy-accent-rgb), 0.12); color: var(--navy-accent-ink, var(--navy-accent)); font-weight: 700; }
.lang-item .lang-flag { font-size: 18px; line-height: 1; }
.lang-item .lang-check { margin-left: auto; color: var(--navy-accent-ink, var(--navy-accent)); font-size: 12px; }
[dir="rtl"] .header-tool-dropdown { right: auto; left: 0; }
[dir="rtl"] .lang-item { text-align: right; }

/* keep the GT widget rendered (so the combo builds) but off-screen — NOT display:none */
.gt-offscreen {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* extra google-translate chrome hiding */
.goog-te-gadget { font-size: 0 !important; }
.goog-te-gadget span, .goog-logo-link { display: none !important; }
.goog-tooltip, .goog-tooltip:hover, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* ===== New Classes Mobile Responsive ===== */
@media (max-width: 768px) {
    .setup-guide-table th,
    .setup-guide-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .setup-guide-table .step-name {
        min-width: 120px;
    }

    .smtp-form-grid {
        grid-template-columns: 1fr;
    }

    .smtp-actions {
        flex-direction: column;
    }

    .login-options-row {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .form-grid-2col { grid-template-columns: 1fr; }
    .form-grid-3col { grid-template-columns: 1fr; }
    .palette-gallery { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
    .current-theme-meta { margin-left: 0; width: 100%; }
    .current-swatch { flex: 1; min-width: 120px; }
    .theme-action-row .btn { flex: 1; justify-content: center; }
    .theme-mode-options { flex-direction: column; gap: 10px; }
    .theme-preview-swatches { flex-direction: column; }
    .color-preview-box { width: 100%; }
    .logo-upload-row { flex-direction: column; align-items: flex-start; }
    .quick-actions-bar { justify-content: center; }

    .preset-btn {
        width: 45px !important;
        height: 45px !important;
    }
}

/* ===== Utility Classes ===== */
.initially-hidden {
    display: none;
}

/* ===== Breadcrumbs — second line of the page header, never its own bar ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 3px 0 0;
    padding: 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--navy-accent-ink, var(--navy-accent));
    text-decoration: none;
}

.breadcrumb a i {
    font-size: 11px;
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.45;
    font-weight: 300;
}

body.dark-mode .breadcrumb a:hover {
    color: var(--navy-accent-ink, var(--navy-accent));
}

/* ===== Maintenance Page ===== */
.maintenance-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    padding: 20px;
}

.maintenance-admin-link {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    opacity: 0.3;
    transition: opacity 0.3s, transform 0.2s;
    z-index: 10;
}

.maintenance-admin-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

.maintenance-content {
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.maintenance-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 8px 32px rgba(var(--navy-accent-rgb), 0.3);
}

.maintenance-icon i {
    font-size: 48px;
    color: #fff;
}

.maintenance-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 16px;
}

body.dark-mode .maintenance-title {
    color: var(--text-primary);
}

.maintenance-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.maintenance-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e3f2fd;
    padding: 14px 20px;
    border-radius: var(--r-card);
    border-left: 4px solid var(--navy-accent);
    font-size: 14px;
    color: var(--navy-primary);
    margin-bottom: 30px;
    text-align: left;
}

body.dark-mode .maintenance-info {
    background: rgba(var(--navy-accent-rgb), 0.1);
    color: var(--text-secondary);
}

.maintenance-brand {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.maintenance-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid var(--border-color);
}

.maintenance-brand p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Maintenance Card Warning (Settings) ===== */
.maintenance-card-warning {
    border-color: #ffc107;
}

.maintenance-card-warning:hover {
    border-color: #ff9800;
}

.icon-gradient-danger {
    background: linear-gradient(135deg, #ea4335, #ff6b6b);
}

.info-banner-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

body.dark-mode .info-banner-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #ffc107;
}

.text-danger {
    color: #ea4335 !important;
}

/* ===== Notification Bell ===== */
/* .header-right is its own stacking context (position + z-index below), so the panels inside
   it can't out-paint later content on z-index alone. Above page content, still under the
   sidebar (999/1001) and modal overlays (1000). */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 900;
}

.notification-bell-wrapper {
    position: relative;
}

.notification-bell-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    position: relative;
    padding: 8px;
    border-radius: var(--r-card);
    transition: all 0.3s;
}

.notification-bell-btn:hover {
    background: #f0f0f0;
    color: var(--navy-primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ea4335;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 420px;
    background: white;
    border-radius: var(--r-card);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.notification-dropdown.open {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.notification-dropdown-header strong {
    font-size: 15px;
    color: var(--navy-primary);
}

.notification-dropdown-header button {
    background: transparent;
    border: none;
    color: var(--navy-accent-ink, var(--navy-accent));
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.notification-dropdown-header button:hover {
    text-decoration: underline;
}

.notification-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.notification-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e8f4fd;
    border-left: 3px solid var(--navy-accent);
}

.notification-item.unread:hover {
    background: #d6ecfb;
}

.notification-item-icon {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
}

.notification-item-message {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.notification-item-mark {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-item-mark:hover {
    color: #34a853;
}

/* Dark Mode — Notification Bell */
body.dark-mode .notification-bell-btn {
    color: var(--text-secondary);
}

body.dark-mode .notification-bell-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

body.dark-mode .notification-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .notification-dropdown-header {
    background: var(--bg-primary);
    border-bottom-color: var(--border-color);
}

body.dark-mode .notification-dropdown-header strong {
    color: var(--text-primary);
}

body.dark-mode .notification-item {
    border-bottom-color: var(--border-color);
}

body.dark-mode .notification-item:hover {
    background: var(--bg-primary);
}

body.dark-mode .notification-item.unread {
    background: rgba(var(--navy-accent-rgb), 0.1);
    border-left-color: var(--navy-accent);
}

body.dark-mode .notification-item.unread:hover {
    background: rgba(var(--navy-accent-rgb), 0.15);
}

body.dark-mode .notification-item-title {
    color: var(--text-primary);
}

body.dark-mode .notification-item-message {
    color: var(--text-secondary);
}

body.dark-mode .notification-item-time {
    color: var(--text-muted);
}

/* ===== About Section Styles ===== */
.about-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    border-radius: var(--r-card);
    color: white;
}

.about-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

.about-title h1 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 700;
}

.about-dev {
    font-size: 14px;
    opacity: 0.9;
}

.about-card {
    background: white;
    border-radius: var(--r-card);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--navy-primary);
}

.about-card h2 {
    color: var(--navy-primary);
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-card p {
    color: #555;
    line-height: 1.7;
    font-size: 15px;
}

.about-features {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.about-features li {
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: var(--r-card);
    color: #333;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    align-items: flex-start;
    gap: 12px;
}

.about-features li i {
    color: var(--navy-primary);
    margin-right: 10px;
    font-size: 16px;
    flex-shrink: 0;
}

.about-table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
}

.about-roles-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.about-roles-table th,
.about-roles-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.about-roles-table th {
    background: var(--navy-primary);
    color: white;
    font-weight: 600;
}

.about-roles-table th:first-child {
    text-align: left;
}

.about-roles-table td:first-child {
    text-align: left;
    font-weight: 500;
    background: #f8f9fa;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--r-control);
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: #d4edda;
    color: #155724;
}

.role-sf {
    background: #cce5ff;
    color: #004085;
}

.text-success {
    color: var(--success) !important;
}

.about-developer {
    border-left-color: var(--navy-accent);
}

.developer-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.developer-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--navy-primary);
    flex-shrink: 0;
}

.developer-details h3 {
    color: var(--navy-primary);
    font-size: 20px;
    margin-bottom: 5px;
}

.developer-brand {
    color: var(--navy-accent-ink, var(--navy-accent));
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.developer-details p {
    margin-bottom: 15px;
}

.developer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dev-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--r-card);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.dev-link.whatsapp {
    background: #25D366;
    color: white;
}

.dev-link.whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.dev-link.youtube {
    background: #FF0000;
    color: white;
}

.dev-link.youtube:hover {
    background: #CC0000;
    transform: translateY(-2px);
}

.dev-link.telegram {
    background: #229ED9;
    color: white;
}

.dev-link.telegram:hover {
    background: #1a7fb0;
    transform: translateY(-2px);
}

.dev-link.email {
    background: var(--navy-accent);
    color: var(--navy-on-accent, #fff);
}

.dev-link.email:hover {
    background: var(--navy-primary);
    transform: translateY(-2px);
}

.about-footer {
    text-align: center;
    padding: 25px;
    color: #666;
    font-size: 14px;
}

.about-version {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Dark Mode — About Section */
body.dark-mode .about-card {
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .about-card h2 {
    color: var(--text-primary);
}

body.dark-mode .about-card p {
    color: var(--text-secondary);
}

body.dark-mode .about-features li {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

body.dark-mode .about-roles-table th {
    background: var(--navy-primary);
}

body.dark-mode .about-roles-table td {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .about-roles-table td:first-child {
    background: var(--bg-primary);
}

body.dark-mode .developer-details h3 {
    color: var(--text-primary);
}

body.dark-mode .developer-avatar {
    border-color: var(--navy-accent);
}

body.dark-mode .about-footer {
    color: var(--text-secondary);
}

body.dark-mode .about-version {
    color: var(--text-muted);
}

/* Mobile — Notification Dropdown */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 300px;
        right: -40px;
    }

    .header-right {
        gap: 10px;
        font-size: 13px;
    }

    .about-header {
        flex-direction: column;
        text-align: center;
    }

    .about-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .developer-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .developer-links {
        justify-content: center;
    }
}

/* RBAC matrix — sticky grid (roles.php) */
.rbac-wrap {
    overflow: auto;
    border: 1px solid var(--border-color);
    max-height: 72vh;
    margin: 15px 0;
}

.rbac-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    width: 100%;
    table-layout: fixed; /* role cols split equally, fills 100% */
}

.rbac-table th,
.rbac-table td {
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-light);
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
    background: var(--bg-card);
}

.rbac-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f5f8fc;
}

.rbac-rolehead {
    color: #fff;
    padding: 5px 9px;
    font-weight: 700;
    font-size: 11px;
    display: inline-block;
    min-width: 74px;
    border-radius: var(--r-control);
}

.rbac-perm-legend {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 1px;
}

.rbac-table th.rbac-pagecol,
.rbac-table td.rbac-pagecol {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
    font-weight: 600;
    color: var(--navy-primary);
    background: var(--bg-card);
    width: 200px; /* fixed; rest splits equally among roles */
    box-shadow: 1px 0 0 var(--border-color);
}

.rbac-table thead th.rbac-pagecol {
    z-index: 4;
    background: #f5f8fc;
}

.rbac-grouprow td {
    background: #eef2f7 !important;
    color: #5a6b7b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    text-align: left;
}

.rbac-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap; /* wrap V·A·E·D when many roles shrink cols */
}

/* impersonation — "login as this user" */
.action-icon.loginas-icon { color: var(--navy-accent-ink, var(--navy-accent)); }
.action-icon.loginas-icon:hover { color: #005fa3; }
.impersonate-notice {
    margin: 10px;
    padding: 10px 12px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #664d03;
}
.impersonate-notice > i { font-size: 18px; color: #997404; flex-shrink: 0; }
.impersonate-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.impersonate-text span { font-weight: 600; }
.impersonate-text a { color: var(--navy-accent-ink, var(--navy-accent)); font-weight: 700; text-decoration: none; }
.impersonate-text a:hover { text-decoration: underline; }
body.dark-mode .impersonate-notice { background: #3a2f00; border-color: #5c4a00; color: #ffe69c; }
body.dark-mode .impersonate-text a { color: #4aa3ff; }

.rbac-dot {
    width: 24px;
    height: 24px;
    border: 1px solid #d4d4d4;
    background: #fff;
    color: #bbb;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    border-radius: 0;
}

.rbac-dot:hover {
    border-color: var(--navy-accent);
}

.rbac-dot.on {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.rbac-dot.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.rbac-dot.on.locked {
    background: #9bbf9e;
    border-color: #9bbf9e;
}

/* perm letters in About roles table */
.perm-on {
    display: inline-block;
    min-width: 16px;
    font-weight: 800;
    font-size: 12px;
    color: var(--success);
    letter-spacing: 1px;
}

.perm-off {
    display: inline-block;
    min-width: 16px;
    font-weight: 600;
    font-size: 12px;
    color: #c4c4c4;
    letter-spacing: 1px;
}

/* User role badge (Admin badge already defined above) */
.role-user {
    background: #cce5ff;
    color: #004085;
}

/* Dark Mode — RBAC matrix */
body.dark-mode .rbac-wrap {
    border-color: var(--border-color);
}

body.dark-mode .rbac-table th,
body.dark-mode .rbac-table td {
    border-bottom-color: var(--border-color);
    border-right-color: var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.dark-mode .rbac-table thead th,
body.dark-mode .rbac-table thead th.rbac-pagecol {
    background: var(--navy-dark);
}

body.dark-mode .rbac-table td.rbac-pagecol {
    color: var(--text-primary);
    background: var(--bg-card);
    box-shadow: 1px 0 0 var(--border-color);
}

body.dark-mode .rbac-grouprow td {
    background: var(--bg-primary) !important;
    color: var(--text-muted);
}

body.dark-mode .rbac-dot {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

body.dark-mode .rbac-dot.on {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

body.dark-mode .perm-off {
    color: #5a5a78;
}

/* ===== Slight curved feel — global rounding polish (subtle, dashboard-wide) ===== */
/* larger surfaces / cards */
.data-section,
.lte-card,
.account-info-card,
.settings-mega-card,
.theme-preview-container,
.notification-dropdown,
.header-tool-dropdown,
.about-table-wrapper,
.setup-guide-table,
.small-box,
.stat-card,
.info-box,
.modal-content,
.modal-box { border-radius: var(--r-card) !important; }

/* controls / chips / smaller elements */
.palette-card,
.notification-item,
.btn,
.mode-toggle-btn,
.lang-item,
.theme-quick-swatch,
.action-badge,
.hex-input,
.color-picker-input,
.data-section input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
.data-section select,
.data-section textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea { border-radius: var(--r-control) !important; }
/* file input stays squared per DaisyUI standard — do not round */

/* ===== Cross-document View Transitions — REMOVED 2026-09-15 =====
   `@view-transition { navigation: auto; }` crossfaded the page and snapshotted the sidebar,
   bottom nav and header tools as named captures. Every skipped transition (a second click, a
   hidden tab, a slow document) rejected with "AbortError: Transition was skipped" and could
   strand a captured element half-painted — the sidebar came back clipped with its background
   missing. A 0.3s fade is not worth a broken sidebar. To bring it back, restore
   @view-transition + the view-transition-name rules here AND the hushVT guard in app.js. */

/* ===== DaisyUI-style file input — squared button, follows the user's palette ===== */
.file-input {
    display: block;
    width: 100%;
    height: 48px;
    line-height: 46px;
    padding: 0;
    font-size: 16px;
    color: var(--text-secondary);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--r-card);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.file-input:hover  { border-color: var(--navy-accent); }
.file-input:focus  { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.18); }
.file-input:disabled { opacity: 0.55; cursor: not-allowed; }
.file-input::file-selector-button {
    height: 46px;
    margin: 0 14px 0 0;
    padding: 0 20px;
    border: 0;
    border-right: 1px solid var(--input-border);
    border-radius: 0;
    background: rgba(var(--navy-accent-rgb), 0.14);
    color: var(--navy-accent-ink, var(--navy-accent));
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
}
.file-input::file-selector-button:hover { background: var(--navy-accent); color: var(--navy-on-accent, #fff); }

/* ===== My Account — themed cards (every colour here rides the theme vars) ===== */
.acct-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 22px 24px 24px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.acct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.acct-head-txt h2 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0; }
.acct-head-txt p  { font-size: 13px; color: var(--text-muted); margin: 3px 0 0; }
.acct-chip {
    flex: 0 0 38px; width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-card);
    background: rgba(var(--navy-accent-rgb), 0.13);
    font-size: 16px;
}
.acct-chip i { color: var(--navy-accent-ink, var(--navy-accent)); }

/* profile photo + upload */
.acct-photo { display: flex; align-items: flex-start; gap: 26px; flex-wrap: wrap; }
.acct-avatar-col { flex: 0 0 auto; text-align: center; }
.acct-avatar {
    position: relative;
    width: 116px; height: 116px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(var(--navy-accent-rgb), 0.12);
    border: 1px solid rgba(var(--navy-accent-rgb), 0.28);
}
.acct-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.acct-avatar #defaultProfileIcon { font-size: 52px; color: rgba(var(--navy-accent-rgb), 0.75); }
.acct-avatar-cam {
    position: absolute; right: 2px; bottom: 4px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--navy-primary);
    border: 2px solid var(--bg-card);
}
.acct-avatar-cam i { color: #fff; font-size: 12px; }
.acct-avatar-label { margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }

.acct-upload { flex: 1 1 320px; min-width: 260px; }
.acct-drop {
    padding: 16px 18px 18px;
    border: 1.5px dashed rgba(var(--navy-accent-rgb), 0.45);
    background: rgba(var(--navy-accent-rgb), 0.05);
    border-radius: var(--r-card);
}
.acct-drop-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.acct-drop-head > i { font-size: 26px; color: var(--navy-accent-ink, var(--navy-accent)); }
.acct-drop-head strong { display: block; font-size: 14.5px; color: var(--text-primary); }
.acct-drop-head small  { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.acct-hint { display: block; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }
.acct-hint i { color: var(--navy-accent-ink, var(--navy-accent)); margin-right: 5px; }

/* account info tiles */
.acct-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.acct-info {
    display: flex; align-items: center; gap: 13px;
    padding: 4px 20px;
    border-left: 1px solid var(--border-light);
}
.acct-info:first-child { border-left: 0; padding-left: 0; }
.acct-info-icon {
    flex: 0 0 44px; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-card);
    background: rgba(var(--navy-accent-rgb), 0.13);
    font-size: 17px;
}
.acct-info-icon i { color: var(--navy-accent-ink, var(--navy-accent)); }
.acct-info-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acct-info-label { font-size: 12.5px; color: var(--text-muted); }
.acct-info-value { font-size: 15px; font-weight: 700; color: var(--text-primary); word-break: break-word; }

/* forms inside account cards */
.acct-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; }
.acct-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 22px; }
.acct-card .form-group { margin-bottom: 0; }
.acct-card .form-group label {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
    font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
}
.acct-card .form-group label i { color: var(--navy-accent-ink, var(--navy-accent)); }
.acct-req::after { content: ' *'; color: var(--danger); font-weight: 700; }
.acct-card input[type="text"],
.acct-card input[type="email"],
.acct-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.acct-card input:focus {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), 0.18);
}
.acct-pw { position: relative; }
.acct-pw input { padding-right: 46px !important; }
.acct-eye {
    position: absolute; right: 6px; top: 50%;
    transform: translateY(-50%);
    padding: 8px;
    background: none; border: 0; border-radius: var(--r-control);
    color: var(--text-muted); font-size: 15px; line-height: 1;
    cursor: pointer; transition: all 0.2s;
}
.acct-eye:hover { color: var(--navy-accent-ink, var(--navy-accent)); background: rgba(var(--navy-accent-rgb), 0.1); }

.acct-card .form-actions { display: flex; gap: 12px; margin-top: 22px; }
.acct-pw-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.acct-note {
    flex: 1; min-width: 240px;
    display: flex; align-items: center; gap: 9px;
    padding: 11px 15px;
    border-radius: var(--r-card);
    background: rgba(var(--navy-accent-rgb), 0.08);
    border: 1px solid rgba(var(--navy-accent-rgb), 0.18);
    font-size: 13px; color: var(--text-secondary);
}
.acct-note i { color: var(--navy-accent-ink, var(--navy-accent)); }
.acct-card .btn-primary {
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--navy-accent) 0%, rgba(var(--navy-accent-rgb), 0.82) 100%);
    color: var(--navy-on-accent, #fff);
}
.acct-card .btn-primary:hover { background: var(--navy-accent); filter: brightness(1.08); transform: translateY(-2px); }

/* dark mode — beat the blanket div/span colour rule */
body.dark-mode .acct-info-label,
body.dark-mode .acct-avatar-label,
body.dark-mode .acct-head-txt p { color: var(--text-muted) !important; }
body.dark-mode .acct-drop { background: rgba(var(--navy-accent-rgb), 0.09); }

@media (max-width: 1100px) {
    .acct-info-grid { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
    .acct-info:nth-child(odd) { border-left: 0; padding-left: 0; }
    .acct-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .acct-card { padding: 18px 16px 20px; }
    .acct-photo { flex-direction: column; align-items: center; }
    .acct-upload { width: 100%; min-width: 0; }
    .acct-info-grid { grid-template-columns: 1fr; }
    .acct-info { border-left: 0; padding: 0; }
    .acct-grid-2, .acct-grid-3 { grid-template-columns: 1fr; }
    .acct-pw-actions { flex-direction: column; align-items: stretch; }
    .acct-note { min-width: 0; }
}

/* ===== Auth (login) — inset shell, sign-in / story split =====
   Palette: UI 3 "Forest Executive" (docs/colors.md), exact hexes, login-scoped.
   Accent #84A98C is 2.6:1 on white, so it never carries small text — it drives
   quote marks, the active tab bar, focus rings and the skyline. Text = Primary. */
.auth-body {
    --fx-primary: #234E52;
    --fx-secondary: #52796F;
    --fx-bg: #F8FAF8;
    --fx-card: #FFFFFF;
    --fx-accent: #84A98C;
    --fx-primary-rgb: 35, 78, 82;
    --fx-secondary-rgb: 82, 121, 111;
    --fx-accent-rgb: 132, 169, 140;
    --fx-line: rgba(35, 78, 82, 0.13);
    --fx-ink: var(--fx-primary);
    --fx-body: #333333;
    --fx-mute: #666666;
    min-height: 100vh;
    background: var(--fx-primary);
}
/* full-bleed: the shell owns the whole viewport, no frame, no inset */
.auth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    overflow: hidden;
}

/* ---- left: sign-in column ---- */
.auth-form-col {
    display: grid; grid-template-rows: auto 1fr auto;
    padding: 34px 46px 26px;
    background: var(--fx-bg);
}
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-lockup { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.auth-tools { display: inline-flex; align-items: center; gap: 9px; }
.auth-home { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
             border: 1px solid var(--fx-line); border-radius: var(--r-card);
             background: var(--fx-card); color: var(--fx-secondary);
             font-size: 13px; font-weight: 600; text-decoration: none;
             transition: color 0.2s, border-color 0.2s; }
.auth-home:hover { color: var(--fx-primary); border-color: var(--fx-secondary); }
.auth-mark {
    width: 36px; height: 36px; flex: 0 0 36px;
    padding: 2px; border-radius: var(--r-card);
    border: 1px solid var(--fx-line);
    background: var(--fx-card);
    object-fit: cover;
}
.auth-lockup strong { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; color: var(--fx-ink); }
.auth-toggle {
    width: 38px; height: 38px; flex: 0 0 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--fx-line); border-radius: var(--r-card);
    background: var(--fx-card); color: var(--fx-secondary);
    font-size: 14px; cursor: pointer;
    transition: color 0.2s, border-color 0.2s, transform 0.3s;
}
.auth-toggle:hover { color: var(--fx-primary); border-color: var(--fx-secondary); transform: rotate(-18deg); }

.auth-panel-inner {
    width: 100%; max-width: 360px; margin: auto; padding: 30px 0;
    animation: auth-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(10px); } }
.auth-panel h2 { margin: 0 0 8px; font-size: 34px; font-weight: 700; letter-spacing: -0.8px; text-align: center; color: var(--fx-ink); }
.auth-sub { margin: 0 0 24px; font-size: 13.5px; line-height: 1.6; text-align: center; color: var(--fx-mute); }

/* segmented tabs — sign in / sign up */
.auth-seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    gap: 4px; margin: 0 0 20px; padding: 4px;
    border-radius: var(--r-card);
    background: rgba(var(--fx-primary-rgb), 0.06);
}
.auth-seg a, .auth-seg span {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; border-radius: var(--r-card);
    font-size: 13px; font-weight: 600; text-decoration: none;
    color: var(--fx-secondary);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.auth-seg a:hover { color: var(--fx-primary); }
.auth-seg .is-on {
    background: var(--fx-card); color: var(--fx-ink);
    box-shadow: 0 1px 3px rgba(var(--fx-primary-rgb), 0.14);
}
.auth-seg i { font-size: 12.5px; color: var(--fx-secondary); }
.auth-seg .is-on i { color: var(--fx-accent); }

.auth-google {
    width: 100%; height: 48px;
    display: inline-flex; align-items: center; justify-content: center; gap: 11px;
    margin-bottom: 18px;
    border: 1px solid var(--fx-line); border-radius: var(--r-card);
    background: var(--fx-card); color: var(--fx-ink);
    font-size: 14px; font-weight: 600; text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-google:hover { border-color: var(--fx-secondary); box-shadow: 0 4px 14px rgba(var(--fx-primary-rgb), 0.09); }

.auth-panel-inner .error,
.auth-panel-inner .success {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 0 0 18px; padding: 12px 14px;
    border-radius: var(--r-card);
    font-size: 13.2px; line-height: 1.55; text-align: left;
}
.auth-panel-inner .error i,
.auth-panel-inner .success i { margin-top: 2px; font-size: 14px; }

.auth-group { margin-bottom: 15px; }
.auth-group label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 700; color: var(--fx-ink); }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-field { position: relative; }
.auth-field input {
    width: 100%; height: 50px; padding: 0 16px;
    border: 1px solid var(--fx-line); border-radius: var(--r-card);
    background: var(--fx-card); color: var(--fx-body);
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field-pw input { padding-right: 46px; }
.auth-field input::placeholder { color: var(--fx-mute); opacity: 0.6; font-weight: 400; }
.auth-field input:focus {
    outline: none;
    border-color: var(--fx-accent);
    box-shadow: 0 0 0 4px rgba(var(--fx-accent-rgb), 0.28);
}
.auth-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--r-control); background: none;
    font-size: 14px; color: var(--fx-mute);
    cursor: pointer; transition: color 0.2s, background 0.2s;
}
.auth-eye:hover { color: var(--fx-primary); background: rgba(var(--fx-primary-rgb), 0.07); }
.auth-caps { display: none; align-items: center; gap: 7px; margin: 8px 0 0; font-size: 12px; font-weight: 600; color: #D97706; }
.auth-caps.on { display: flex; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 0; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--fx-mute); cursor: pointer; -webkit-user-select: none; user-select: none; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--fx-primary); cursor: pointer; }
.auth-link { font-size: 12.5px; font-weight: 700; color: var(--fx-primary); text-decoration: none; }
.auth-link:hover { color: var(--fx-secondary); text-decoration: underline; }

.auth-submit {
    width: 100%; height: 52px; margin-top: 22px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: var(--r-card);
    background: var(--fx-primary);
    color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.2px;
    cursor: pointer; touch-action: manipulation;
    box-shadow: 0 10px 22px rgba(var(--fx-primary-rgb), 0.26);
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.auth-submit:hover:not(:disabled) { background: var(--fx-secondary); transform: translateY(-1px); box-shadow: 0 14px 28px rgba(var(--fx-primary-rgb), 0.32); }
.auth-submit:active:not(:disabled) { transform: translateY(0); }
.auth-submit:disabled { opacity: 0.68; cursor: not-allowed; box-shadow: none; }

.auth-signup { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--fx-mute); }
.auth-maint { margin-top: 16px; text-align: left; }

.auth-foot { padding-top: 16px; border-top: 1px solid var(--fx-line); text-align: center; }
.auth-trust { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 12px; font-size: 11.5px; color: var(--fx-mute); }
.auth-trust i { color: var(--fx-accent); }
.auth-copy { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--fx-mute); }
.auth-copy i { color: var(--fx-accent); }

/* ---- right: story column ---- */
.auth-story {
    position: relative;
    display: grid; grid-template-rows: auto 1fr auto;
    padding: 30px 46px 0;
    background: var(--fx-card);
    border-left: 1px solid var(--fx-line);
    overflow: hidden;
}
.auth-shift {
    justify-self: end;
    display: inline-flex; align-items: center; gap: 9px;
    padding: 7px 14px; border-radius: var(--r-card);
    border: 1px solid var(--fx-line);
    background: var(--fx-bg);
    font-size: 12px; font-weight: 600; color: var(--fx-secondary);
}
.auth-shift .auth-clock { font-weight: 800; color: var(--fx-ink); font-variant-numeric: tabular-nums; }
.auth-live {
    width: 7px; height: 7px; border-radius: 50%;
    background: #16A34A;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
    animation: auth-live 2.2s ease-out infinite;
}
@keyframes auth-live {
    70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.auth-quote { max-width: 470px; margin: 0; align-self: center; padding: 20px 0 26px; }
.auth-qmark { display: block; font-size: 52px; line-height: 0.6; color: var(--fx-accent); }
.auth-qmark-end { text-align: right; }
.auth-quote p { margin: 18px 0; font-size: 19px; font-weight: 500; line-height: 1.6; letter-spacing: -0.2px; color: var(--fx-ink); }
.auth-cite { display: flex; align-items: center; gap: 12px; margin-top: 22px; font-style: normal; }
.auth-cite img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid var(--fx-line); }
.auth-cite strong { display: block; font-size: 14px; font-weight: 700; color: var(--fx-ink); }
.auth-cite small  { display: block; margin-top: 2px; font-size: 12px; color: var(--fx-mute); }

/* line-art skyline, flush to the bottom of the column */
.auth-scene { display: block; height: auto; margin: 0 -46px -1px; width: calc(100% + 92px); }
.sc-line   { fill: none; stroke: var(--fx-secondary); stroke-width: 1.6; stroke-linejoin: round; }
.sc-line-2 { fill: none; stroke: var(--fx-primary); stroke-width: 1.8; stroke-linejoin: round; }
.sc-win    { fill: none; stroke: var(--fx-secondary); stroke-width: 1; opacity: 0.55; }
.sc-lit    { fill: var(--fx-accent); stroke: none; opacity: 0.75; }
.sc-tree   { fill: var(--fx-bg); stroke: var(--fx-primary); stroke-width: 1.6; }
.sc-trunk  { fill: none; stroke: var(--fx-primary); stroke-width: 1.6; stroke-linecap: round; }
.sc-ground { fill: none; stroke: var(--fx-primary); stroke-width: 1.8; stroke-linecap: round; }

/* signup: strength meter + live match hint (status colours per colors.md rule 5) */
.auth-strength { display: flex; align-items: center; gap: 10px; margin: 9px 0 0; }
.auth-strength[hidden] { display: none; }
.auth-strength-bar { flex: 1; height: 5px; border-radius: var(--r-card); background: rgba(var(--fx-primary-rgb), 0.10); overflow: hidden; }
.auth-strength-bar i { display: block; width: 12%; height: 100%; border-radius: var(--r-card); background: #DC2626; transition: width 0.25s, background 0.25s; }
.auth-strength small { min-width: 60px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--fx-mute); }
.auth-strength[data-lvl="1"] .auth-strength-bar i { width: 25%;  background: #DC2626; }
.auth-strength[data-lvl="2"] .auth-strength-bar i { width: 50%;  background: #D97706; }
.auth-strength[data-lvl="3"] .auth-strength-bar i { width: 75%;  background: #D97706; }
.auth-strength[data-lvl="4"] .auth-strength-bar i { width: 100%; background: #16A34A; }
.auth-hint { display: none; align-items: center; gap: 7px; margin: 8px 0 0; font-size: 12px; font-weight: 600; }
.auth-hint.ok, .auth-hint.bad { display: flex; }
.auth-hint.ok  { color: #16A34A; }
.auth-hint.bad { color: #DC2626; }

/* signup carries two more fields than login — tighten the rhythm so it still fits one screen */
.page-signup .auth-panel-inner { max-width: 372px; padding: 22px 0; }
.page-signup .auth-panel h2 { font-size: 31px; }
.page-signup .auth-sub { margin-bottom: 20px; }
.page-signup .auth-seg { margin-bottom: 18px; }
.page-signup .auth-group { margin-bottom: 13px; }
.page-signup .auth-submit { margin-top: 18px; }

/* dark mode — keep the palette greens, swap the surfaces for the app's dark tokens */
body.dark-mode.auth-body {
    --fx-bg: #1a1a2e;
    --fx-card: #1e1e3f;
    --fx-line: rgba(255, 255, 255, 0.10);
    --fx-ink: #e8eaf6;
    --fx-body: #e8eaf6;
    --fx-mute: #8a8d9f;
}
body.dark-mode .auth-submit { background: var(--fx-secondary); }
body.dark-mode .auth-submit:hover:not(:disabled) { background: var(--fx-accent); color: var(--fx-primary); }
body.dark-mode .auth-link { color: var(--fx-accent) !important; }
body.dark-mode .auth-lockup strong,
body.dark-mode .auth-cite strong { color: var(--fx-ink) !important; }
body.dark-mode .auth-sub,
body.dark-mode .auth-signup,
body.dark-mode .auth-trust,
body.dark-mode .auth-copy,
body.dark-mode .auth-check,
body.dark-mode .auth-check span,
body.dark-mode .auth-caps,
body.dark-mode .login-contact p { color: var(--fx-mute) !important; }
body.dark-mode .auth-caps { color: #D97706 !important; }
body.dark-mode .auth-shift,
body.dark-mode .auth-shift span { color: var(--fx-mute) !important; }
body.dark-mode .auth-shift .auth-clock { color: var(--fx-ink) !important; }
body.dark-mode .auth-qmark { color: var(--fx-accent) !important; }
body.dark-mode .auth-hint.ok  { color: #16A34A !important; }
body.dark-mode .auth-hint.bad { color: #DC2626 !important; }
body.dark-mode .auth-quote p { color: var(--fx-ink) !important; }
body.dark-mode .auth-seg a, body.dark-mode .auth-seg span { color: var(--fx-mute) !important; }
body.dark-mode .auth-seg .is-on { color: var(--fx-ink) !important; background: rgba(255, 255, 255, 0.07); }
body.dark-mode .auth-panel-inner .error,
body.dark-mode .auth-panel-inner .error span   { color: var(--danger) !important; }
body.dark-mode .auth-panel-inner .success,
body.dark-mode .auth-panel-inner .success span { color: var(--success) !important; }
body.dark-mode .auth-maint span { color: #ffc107 !important; }
body.dark-mode .sc-tree { fill: var(--fx-card); stroke: var(--fx-secondary); }
body.dark-mode .sc-line-2, body.dark-mode .sc-ground, body.dark-mode .sc-trunk { stroke: var(--fx-secondary); }

/* overlay follows the login palette, not the app navy */
.auth-body .action-loader { background: rgba(var(--fx-primary-rgb), 0.80); }
.auth-body .action-loader-bar::after { background: var(--fx-accent); }

/* Let's Work Together — login footer (required in every app) */
.login-contact { margin-top: 0; padding-top: 0; border-top: 0; text-align: center; }
.login-contact p { margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px; color: var(--fx-mute); }
.login-contact .developer-links { justify-content: center; gap: 8px; }
.login-contact .dev-link { padding: 7px 13px; border-radius: var(--r-card); font-size: 12px; }

@media (min-width: 1301px) {
    .auth-form-col { padding: 40px 68px 30px; }
    .auth-story { padding: 36px 60px 0; }
    .auth-scene { margin: 0 -60px -1px; width: calc(100% + 120px); }
}
/* laptop front-desk screens — 768px tall minus chrome */
@media (min-width: 901px) and (max-height: 800px) {
    .auth-panel-inner { padding: 12px 0; }
    .page-signup .auth-panel-inner { padding: 6px 0; }
    .page-signup .auth-group { margin-bottom: 10px; }
    .page-signup .auth-sub { margin-bottom: 14px; }
    .page-signup .auth-seg { margin-bottom: 14px; }
    .auth-panel h2 { font-size: 29px; }
    .auth-sub { margin-bottom: 18px; }
    .auth-quote { padding: 8px 0 14px; }
    .auth-quote p { font-size: 17px; margin: 14px 0; }
    .auth-qmark { font-size: 42px; }
}
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-story { display: none; }
    .auth-form-col { padding: 24px 22px 20px; }
    .auth-panel-inner { max-width: 420px; padding: 22px 0; }
}
@media (max-width: 480px) {
    .auth-form-col { padding: 20px 18px 16px; }
    .auth-panel h2 { font-size: 28px; }
    .login-contact .dev-link { padding: 7px 11px; font-size: 11.5px; }
    .auth-home { font-size: 0; gap: 0; padding: 0 12px; } /* icon-only pill — the label won't fit beside a long site name */
    .auth-home i { font-size: 14px; }
}

/* ===== Google Drive backup card ===== */
.gdrive-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
@media (max-width: 576px) {
    .gdrive-actions { flex-direction: column; }
    .gdrive-actions .btn { width: 100%; }
}

/* sidebar unread pill sits on the Chat nav item */
.sidebar-menu li { position: relative; }
.nav-pill {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    background: var(--danger); color: #fff; pointer-events: none;
    font-size: 10px; font-style: normal; font-weight: 700;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
/* collapsed rail has no room for a number — shrink to a dot */
.sidebar.collapsed .nav-pill {
    top: 8px; right: 12px; transform: none;
    min-width: 9px; width: 9px; height: 9px; padding: 0; font-size: 0;
}

/* bottom bar now carries up to 5 entries — tighten so nothing wraps on small phones */
.mobile-bottom-nav .mobile-nav-item { position: relative; padding: 8px 6px; min-width: 0; flex: 1; }
.mobile-nav-pill {
    position: absolute; top: 3px; right: 50%; margin-right: -20px;
    background: var(--danger); color: #fff; font-style: normal; font-weight: 700;
    font-size: 9px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 360px) {
    .mobile-bottom-nav .mobile-nav-item { font-size: 9px; padding: 8px 3px; }
}

/* chat scope segmented control — same visual language as the V/A/E/D dots */
.rbac-scope { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.rbac-scope-btn {
    padding: 4px 8px; border: 1px solid #d4d4d4; background: #fff; color: #999;
    font-size: 10px; font-weight: 700; cursor: pointer; border-radius: 0;
    transition: all .12s; white-space: nowrap;
}
.rbac-scope-btn:hover:not(:disabled) { border-color: var(--navy-accent); }
.rbac-scope-btn.on { background: var(--navy-accent); border-color: var(--navy-accent); color: var(--navy-on-accent, #fff); }
.rbac-scope-btn.locked { opacity: .45; cursor: not-allowed; }
body.dark-mode .rbac-scope-btn { background: var(--input-bg); border-color: var(--input-border); color: var(--text-muted); }
body.dark-mode .rbac-scope-btn.on { background: var(--navy-accent); border-color: var(--navy-accent); color: var(--navy-on-accent, #fff); }


/* ===== Chat — WhatsApp-style surface =====
   Page-scoped on purpose: everything here sits under .page-chat / .chat-*,
   so the navy dashboard theme is untouched everywhere else. */

body.page-chat {
    --wa-teal:      #008069;
    --wa-green:     #25d366;
    --wa-out:       #d9fdd3;   /* my bubble  */
    --wa-in:        #ffffff;   /* their bubble */
    --wa-bg:        #efeae2;   /* wallpaper base */
    --wa-panel:     #ffffff;
    --wa-head:      #f0f2f5;
    --wa-line:      #e9edef;
    --wa-txt:       #111b21;
    --wa-mut:       #667781;
    --wa-tick:      #53bdeb;
    --wa-wall-op:   .06;
}
body.page-chat.dark-mode {
    --wa-teal:      #00a884;
    --wa-out:       #005c4b;
    --wa-in:        #202c33;
    --wa-bg:        #0b141a;
    --wa-panel:     #111b21;
    --wa-head:      #202c33;
    --wa-line:      #222d34;
    --wa-txt:       #e9edef;
    --wa-mut:       #8696a0;
    --wa-wall-op:   .05;
}

.chat-banner {
    display: flex; align-items: center; gap: 10px;
    background: #fff3cd; color: #664d03;
    border-bottom: 1px solid #ffe69c;
    padding: 10px 16px; font-size: 13px;
}
body.page-chat.dark-mode .chat-banner { background: #332701; color: #ffda6a; border-bottom-color: #4a3800; }

/* thin indeterminate bar — reads and writes both drive it, never a blocking popup */
.chat-bar { height: 3px; background: transparent; overflow: hidden; }
.chat-bar.on::after {
    content: ''; display: block; height: 100%; width: 40%;
    background: var(--wa-green);
    animation: chat-bar-slide 1s linear infinite;
}
@keyframes chat-bar-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.chat-wrap {
    display: grid; grid-template-columns: 380px 1fr;
    height: calc(100vh - 220px); min-height: 460px;
    background: var(--wa-panel);
}

/* ---------- left panel ---------- */
.chat-side { display: flex; flex-direction: column; overflow: hidden; background: var(--wa-panel); }
.chat-side-head {
    display: flex; gap: 8px; align-items: center;
    padding: 8px 12px; background: var(--wa-head); border-bottom: 1px solid var(--wa-line);
}
.chat-search { position: relative; flex: 1; }
.chat-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--wa-mut); font-size: 13px; }
.chat-search input {
    width: 100%; padding: 9px 14px 9px 40px; font-size: 16px;
    background: var(--wa-panel); color: var(--wa-txt);
    border: 1px solid transparent; border-radius: var(--r-card);
}
.chat-search input::placeholder { color: var(--wa-mut); }
.chat-search input:focus { outline: none; border-color: var(--wa-teal); }
.chat-bcast-btn {
    white-space: nowrap; background: var(--wa-teal); border: none; color: #fff;
    padding: 9px 12px; border-radius: var(--r-card); font-size: 13px; cursor: pointer;
}
.chat-bcast-btn:hover { filter: brightness(1.08); }

.chat-contacts { flex: 1; overflow-y: auto; background: var(--wa-panel); }
.chat-contact {
    display: flex; align-items: center; gap: 13px; width: 100%;
    padding: 10px 14px; background: none; border: none;
    text-align: left; cursor: pointer; color: var(--wa-txt);
}
.chat-contact:hover  { background: var(--wa-head); }
.chat-contact.active { background: var(--wa-head); }
body.page-chat.dark-mode .chat-contact.active { background: #2a3942; }
/* divider is indented past the avatar, the way a messenger list reads */
.chat-contact + .chat-contact::before {
    content: ''; position: absolute; left: 74px; right: 0; top: 0; height: 1px; background: var(--wa-line);
}
.chat-contact { position: relative; }
.chat-contact img { width: 49px; height: 49px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat-contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-contact-top  { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-contact-top strong { font-size: 16px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact-time { font-size: 12px; color: var(--wa-mut); flex-shrink: 0; }
.chat-contact.has-unread .chat-contact-time { color: var(--wa-green); }
.chat-contact-sub {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 14px; color: var(--wa-mut);
}
.chat-contact-sub span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.chat-pill {
    background: var(--wa-green); color: #0b141a; font-size: 12px; font-style: normal; font-weight: 600;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-card);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- thread ---------- */
.chat-pane { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--wa-bg); }
/* doodle wallpaper — inlined so nothing is fetched from outside. it lives on the pane, not the
   scrolling message list, otherwise it would only cover the first screenful of a long thread */
.chat-pane::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMjAiIGhlaWdodD0iMjIwIiB2aWV3Qm94PSIwIDAgMjIwIDIyMCI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjEuNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMzgiPjxjaXJjbGUgY3g9IjI4IiBjeT0iMjYiIHI9IjgiLz48cGF0aCBkPSJNNjAgMjBoMTh2MTRINjB6Ii8+PHBhdGggZD0iTTEwNCAzMmM0LTEwIDE0LTEwIDE0LTIgMCA2LTcgMTAtMTQgMTYtNy02LTE0LTEwLTE0LTE2IDAtOCAxMC04IDE0IDJ6Ii8+PHBhdGggZD0iTTE1MCAxOGw0IDkgMTAgMS03IDcgMiAxMC05LTUtOSA1IDItMTAtNy03IDEwLTF6Ii8+PHBhdGggZD0iTTE5MCAyMGM2IDAgMTAgNCAxMCA5cy00IDktMTAgOWgtNGwtNiA1di01Yy00LTEtNi01LTYtOSAwLTUgNC05IDEwLTl6Ii8+PHBhdGggZD0iTTIwIDcwYzgtNiAxNiA2IDI0IDAiLz48cGF0aCBkPSJNNjIgNjRoMTZ2MTZINjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSgyMCA3MCA3MikiLz48Y2lyY2xlIGN4PSIxMTIiIGN5PSI3MiIgcj0iOSIvPjxwYXRoIGQ9Ik0xMDggNzJsMyAzIDYtNyIvPjxwYXRoIGQ9Ik0xNTAgNjR2MTZNMTQyIDcyaDE2Ii8+PHBhdGggZD0iTTE4NiA2MmwxMCAxMC0xMCAxMC0xMC0xMHoiLz48cGF0aCBkPSJNMTggMTE4YzAtNiA1LTEwIDExLTEwczExIDQgMTEgMTAtNSAxMC0xMSAxMGgtM2wtNSA0di01Yy0yLTItMy01LTMtOXoiLz48cGF0aCBkPSJNNjAgMTEwbDggMTZoLTE2eiIvPjxwYXRoIGQ9Ik0xMDAgMTA4aDIwdjhoLTIwek0xMDQgMTE2djEwTTExNiAxMTZ2MTAiLz48cGF0aCBkPSJNMTQ4IDExMmE4IDggMCAxIDEgMCAxMk0xNDggMTA2djIyIi8+PGNpcmNsZSBjeD0iMTkyIiBjeT0iMTE4IiByPSI5Ii8+PHBhdGggZD0iTTE5MiAxMTJ2Nmw0IDMiLz48cGF0aCBkPSJNMTYgMTYwaDIwbC00IDEySDIweiIvPjxwYXRoIGQ9Ik01OCAxNTZjNi00IDEyIDQgMTggMCIvPjxwYXRoIGQ9Ik01OCAxNjhjNi00IDEyIDQgMTggMCIvPjxwYXRoIGQ9Ik0xMDQgMTUybDYgMTItNiAxMi02LTEyeiIvPjxwYXRoIGQ9Ik0xNDQgMTU2aDE4djE0aC02bC00IDUtMi01aC02eiIvPjxwYXRoIGQ9Ik0xODggMTU0djE4TTE4MCAxNjNoMTYiLz48cGF0aCBkPSJNMjAgMTk4YzggMCA4IDggMTYgOCIvPjxwYXRoIGQ9Ik02NCAxOTZhNyA3IDAgMSAwIDE0IDAgNyA3IDAgMCAwLTE0IDB6TTcxIDIwM3Y2Ii8+PHBhdGggZD0iTTEwMiAxOTRoMTZ2MTJoLTE2eiIvPjxwYXRoIGQ9Ik0xMDYgMjA2bC0zIDZNMTE0IDIwNmwzIDYiLz48cGF0aCBkPSJNMTQ4IDE5Mmw4IDgtOCA4LTgtOHoiLz48cGF0aCBkPSJNMTg2IDE5NGM2IDIgOCA4IDQgMTIiLz48L2c+PC9zdmc+Cg==");
    background-repeat: repeat; background-size: 220px 220px;
    opacity: var(--wa-wall-op);
}
.chat-thread, .chat-blank { position: relative; z-index: 1; }
.chat-head, .chat-composer { position: relative; z-index: 1; }
.chat-thread[hidden], .chat-blank[hidden] { display: none; }
.chat-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.chat-blank, .chat-none {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 40px 20px; text-align: center; color: var(--wa-mut);
    background: var(--wa-bg);
}
.chat-blank i { font-size: 52px; color: var(--wa-teal); opacity: .3; }
.chat-blank h3 { color: var(--wa-txt); font-size: 22px; font-weight: 300; }
.chat-none i { font-size: 26px; opacity: .5; }
.chat-none-lg { height: 100%; background: transparent; }

.chat-head {
    display: flex; align-items: center; gap: 13px; flex-shrink: 0;
    padding: 9px 16px; background: var(--wa-head); border-bottom: 1px solid var(--wa-line);
}
.chat-head-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-head-info { display: flex; flex-direction: column; }
.chat-head-info strong { font-size: 16px; font-weight: 500; color: var(--wa-txt); }
.chat-head-info span  { font-size: 13px; color: var(--wa-mut); }
.chat-back { display: none; background: none; border: none; color: var(--wa-txt); font-size: 18px; cursor: pointer; padding: 4px 6px; }

/* ---------- messages + wallpaper ---------- */
.chat-msgs {
    flex: 1; overflow-y: auto; padding: 14px 6%;
    display: flex; flex-direction: column; gap: 2px;
    background: transparent;
}
/* doodle wallpaper, inlined so nothing is fetched from outside */

.chat-day { text-align: center; margin: 12px 0; }
.chat-day span {
    display: inline-block; padding: 5px 12px; font-size: 12.5px;
    text-transform: uppercase; color: var(--wa-mut);
    background: var(--wa-in); border-radius: 7.5px; box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
}
body.page-chat.dark-mode .chat-day span { color: var(--wa-mut); background: var(--wa-head); }

.chat-msg { display: flex; max-width: 65%; }
.chat-msg.mine { align-self: flex-end; justify-content: flex-end; }
.chat-msg + .chat-msg { margin-top: 2px; }
.chat-msg.starts-run { margin-top: 12px; }

.chat-bub {
    position: relative; padding: 6px 9px 8px; font-size: 14.2px; line-height: 19px;
    background: var(--wa-in); color: var(--wa-txt);
    border-radius: 7.5px; box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
    word-break: break-word; max-width: 100%;
}
.chat-msg.mine .chat-bub { background: var(--wa-out); }

/* the little tail — only on the first bubble of a run, like the real thing */
.chat-msg.starts-run .chat-bub::before {
    content: ''; position: absolute; top: 0; width: 8px; height: 13px;
}
.chat-msg.starts-run:not(.mine) .chat-bub { border-top-left-radius: 0; }
.chat-msg.starts-run:not(.mine) .chat-bub::before {
    left: -8px;
    background: var(--wa-in);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.chat-msg.starts-run.mine .chat-bub { border-top-right-radius: 0; }
.chat-msg.starts-run.mine .chat-bub::before {
    right: -8px;
    background: var(--wa-out);
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.chat-bub.gone { font-style: italic; color: var(--wa-mut); }
.chat-bub .chat-text { white-space: pre-wrap; }

.chat-tag {
    display: block; margin-bottom: 3px;
    font-size: 12.5px; font-weight: 600; color: var(--wa-teal);
}

/* time + ticks tuck into the last line of text, dropping to their own line when it's tight */
.chat-meta {
    float: right; margin: 8px -4px -4px 8px;
    font-size: 11px; color: var(--wa-mut); line-height: 15px; white-space: nowrap;
}
.chat-meta i { font-size: 12px; margin-left: 2px; vertical-align: -1px; }
.chat-meta i.read { color: var(--wa-tick); }
.chat-meta i.failed { color: #ea4335; }
/* optimistic bubble — on screen before the server has confirmed it */
.chat-msg.pending .chat-bub { opacity: .72; }

.chat-img img { display: block; max-width: 320px; width: 100%; border-radius: var(--r-card); margin-bottom: 2px; }
.chat-doc {
    display: flex; align-items: center; gap: 11px; margin-bottom: 3px; padding: 11px 13px;
    background: rgba(11,20,26,.05); border-radius: var(--r-card); color: inherit; text-decoration: none;
}
body.page-chat.dark-mode .chat-doc { background: rgba(255,255,255,.06); }
.chat-doc i { font-size: 24px; color: var(--wa-mut); }
.chat-doc span { display: flex; flex-direction: column; min-width: 0; }
.chat-doc strong { font-size: 13.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.chat-doc em { font-size: 11.5px; font-style: normal; color: var(--wa-mut); text-transform: uppercase; }

/* hover tools stay out of the way until you point at a bubble */
.chat-tools {
    position: absolute; top: -12px; right: 4px; display: none; gap: 2px;
    background: var(--wa-panel); border-radius: var(--r-card); padding: 2px;
    box-shadow: 0 2px 6px rgba(11,20,26,.2);
}
.chat-bub:hover .chat-tools { display: flex; }
.chat-tools button { background: none; border: none; cursor: pointer; padding: 4px 7px; font-size: 12px; color: var(--wa-mut); }
.chat-tools button:hover { color: #ea4335; }

/* ---------- composer ---------- */
.chat-composer {
    display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0;
    padding: 8px 16px; background: var(--wa-head);
}
.chat-composer textarea {
    flex: 1; resize: none; max-height: 140px; padding: 10px 14px;
    font-size: 16px; font-family: inherit; line-height: 20px;
    background: var(--wa-panel); color: var(--wa-txt);
    border: none; border-radius: var(--r-card);
}
.chat-composer textarea::placeholder { color: var(--wa-mut); }
.chat-composer textarea:focus { outline: none; }
.chat-file-hidden { display: none; }
.chat-attach, .chat-send {
    flex-shrink: 0; width: 42px; height: 42px; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; touch-action: manipulation;
}
.chat-attach { background: none; color: var(--wa-mut); font-size: 21px; }
.chat-attach:hover { color: var(--wa-txt); }
.chat-send { background: var(--wa-teal); color: #fff; font-size: 17px; }
.chat-send:hover:not(:disabled) { filter: brightness(1.08); }
.chat-send:disabled { opacity: .6; cursor: not-allowed; }
.chat-composer-off {
    justify-content: center; gap: 8px; color: var(--wa-mut); font-size: 13px; padding: 16px;
}

/* ---------- broadcast modal ---------- */
.chat-bcast-note { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.chat-bcast-input {
    width: 100%; resize: vertical; padding: 11px 12px; font-size: 16px; font-family: inherit;
    background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text-primary);
    border-radius: var(--r-card);
}
.chat-bcast-input:focus { outline: none; border-color: var(--navy-accent); }
.chat-bcast-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- skeletons ---------- */
.chat-skel {
    height: 62px; margin: 8px 14px; border-radius: 8px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ---- full screen: the shell stops scrolling, the thread owns the viewport ---- */
body.page-chat .main-content { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
body.page-chat .breadcrumb { display: none; }
body.page-chat .header {
    flex-shrink: 0; margin: 0; padding: 10px 16px; border-radius: 0; box-shadow: none;
    background: var(--wa-head); border-bottom: 1px solid var(--wa-line);
}
body.page-chat .header h1 { font-size: 18px; color: var(--wa-txt); }
body.page-chat .chat-wrap { flex: 1; height: auto; min-height: 0; }
body.page-chat .chat-side { border-right: 1px solid var(--wa-line); }

/* ---- mobile: one pane at a time ---- */
@media (max-width: 900px) {
    .chat-wrap { grid-template-columns: 1fr; }
    .chat-pane { display: none; }
    .chat-wrap.thread-open .chat-side { display: none; }
    .chat-wrap.thread-open .chat-pane { display: flex; }
    .chat-back { display: inline-block; }
    .chat-msg { max-width: 82%; }
    .chat-msgs { padding: 12px 4%; }
    .chat-img img { max-width: 240px; }
}
@media (max-width: 768px) {
    body.page-chat .main-content { padding-bottom: max(65px, calc(65px + env(safe-area-inset-bottom))); }
    body.page-chat .header { padding: 9px 14px; }
    body.page-chat .header h1 { font-size: 17px; }
}

/* ============================================================
   HOTEL — Phase 1 component layer
   overlay = writes · top bar = reads (two-signal rule)
   ============================================================ */

/* --- toggle width guard: .form-group input{width:100%} (0,1,1) beats a bare .toggle (0,1,0)
       and stretches the pill while the knob only travels 20px. These score (0,2,0) and win. --- */
.form-group .toggle,
.toggle-row .toggle { width: 44px; min-width: 44px; max-width: 44px; height: 24px; flex: 0 0 44px; padding: 0; }

/* --- top loading bar — READS only, non-blocking, content stays put --- */
.top-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10001; overflow: hidden; pointer-events: none; }
.top-loadbar > span { display: block; height: 100%; width: 38%; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, rgba(var(--navy-accent-rgb),0), var(--navy-accent), var(--navy-primary)); box-shadow: 0 0 8px rgba(var(--navy-accent-rgb),.5); animation: topLoadSlide 1.05s ease-in-out infinite; }
@keyframes topLoadSlide { 0% { transform: translateX(-105%); } 100% { transform: translateX(320%); } }
body.dark-mode .top-loadbar > span { background: linear-gradient(90deg, rgba(74,163,255,0), #4aa3ff, #9fd0ff); }

/* --- branded processing overlay — WRITES only, sits above modals --- */
.action-loader[hidden] { display: none; }
.action-loader { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(var(--navy-primary-rgb),.72); backdrop-filter: blur(3px); }
.action-loader img { width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); object-fit: cover; box-shadow: 0 6px 24px rgba(0,0,0,.35); animation: al-pulse 1.6s ease-in-out infinite; }
.action-loader-bar { width: min(260px, 60vw); height: 5px; border-radius: var(--r-card); background: rgba(255,255,255,.25); overflow: hidden; }
.action-loader-bar::after { content: ""; display: block; width: 40%; height: 100%; border-radius: var(--r-card); background: var(--navy-accent); animation: al-slide 1.1s ease-in-out infinite; }
body.dark-mode .action-loader-text { color: #fff !important; }
.action-loader-text { color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .3px; }
@keyframes al-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes al-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* --- button busy state — the double-submit guard under the overlay --- */
.btn:disabled, .btn[disabled] { opacity: .65; cursor: not-allowed; pointer-events: none; }
.btn .fa-spinner { margin-right: 6px; }
.row-busy { opacity: .55; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    .action-loader img { animation: none; }
    .action-loader-bar::after { animation-duration: 2.4s; }
    .top-loadbar > span { animation-duration: 2.4s; }
}

/* --- searchable dropdown (vanilla port) — squared 3px, never a plain select --- */
.searchable-dropdown { position: relative; }
.sd-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--input-border); border-radius: var(--r-control); background: var(--input-bg); color: var(--text-primary); font-size: 16px; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.searchable-dropdown.open .sd-trigger, .sd-trigger:focus { outline: none; border-color: var(--navy-accent, #52796F); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb),0.15); }
.sd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-label.sd-placeholder { color: var(--text-muted); }
.sd-arrow { font-size: 11px; color: var(--text-muted); transition: transform 0.2s; }
.sd-arrow.open { transform: rotate(180deg); }
.sd-panel { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--navy-accent); border-radius: var(--r-control); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.sd-search { width: 100%; padding: 10px 12px; border: none; border-bottom: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); font-size: 16px; outline: none; }
.sd-list { max-height: 220px; overflow-y: auto; }
.sd-item { padding: 9px 12px; font-size: 14px; cursor: pointer; }
.sd-item:hover { background: var(--table-hover); }
.sd-item.selected { background: rgba(var(--navy-accent-rgb),0.12); color: var(--navy-accent, #52796F); font-weight: 600; }
.sd-empty { padding: 12px; color: #999; font-size: 13px; text-align: center; }
body.dark-mode .sd-trigger, body.dark-mode .sd-panel, body.dark-mode .sd-search { background: var(--bg-card, #1e2632); color: var(--text-primary, #e6edf3); }
body.dark-mode .sd-item:hover { background: rgba(255,255,255,.06); }

/* --- chevron pipeline tabs — the ONLY place a status filter lives --- */
.pipeline-stages { display: flex; width: 100%; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pipeline-stages::-webkit-scrollbar { display: none; }
.pipeline-stage { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 20px 14px 28px; cursor: pointer; transition: filter 0.2s, opacity 0.2s; color: #fff; text-decoration: none; -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); }
.pipeline-stage:first-child { -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); padding-left: 16px; border-radius: 4px 0 0 4px; }
.pipeline-stage:last-child { -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); border-radius: 0 4px 4px 0; }
.pipeline-stage:hover { filter: brightness(1.15); }
.pipeline-stage.active { filter: brightness(1.25); box-shadow: inset 0 0 0 100px rgba(255,255,255,0.15); }
.pipeline-stage-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 0.3px; color: inherit; }
.pipeline-stage-count { font-size: 14px; font-weight: 800; color: inherit; white-space: nowrap; }
.pipeline-stage.pipeline-empty { opacity: 0.6; }
.pipeline-stage.pipeline-empty:hover { opacity: 0.85; }
@media (max-width: 992px) {
    .pipeline-stage { padding: 10px 16px 10px 24px; }
    .pipeline-stage-name { font-size: 10px; }
    .pipeline-stage-count { font-size: 12px; }
}
@media (max-width: 768px) {
    .pipeline-stage { min-width: 100px; flex-shrink: 0; flex-grow: 0; padding: 10px 14px 10px 22px; }
    .pipeline-stage-name { font-size: 9px; }
}

/* --- empty state — every list view gets one --- */
/* grid-column is ignored outside a grid, so this one line stops an empty state from being
   squeezed into a single 172px cell on EVERY grid host (room pool, room picker, tile boards) */
.rs-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 20px; text-align: center; color: #8a94a0; }
.rs-empty i { font-size: 42px; opacity: .45; }
.rs-empty h4 { margin: 0; font-size: 16px; font-weight: 600; color: #5b6673; }
.rs-empty p { margin: 0; font-size: 13.5px; max-width: 420px; }
body.dark-mode .rs-empty h4 { color: var(--text-primary, #e6edf3); }

/* --- role badges for the hotel roles (base .role-badge already defined above) --- */
.role-manager      { background: #e5d9f7; color: #4a2a86; }
.role-receptionist { background: #d1ecf1; color: #0c5460; }
.role-housekeeping { background: #ffe5cc; color: #8a4b08; }
.role-cleaner      { background: #d2f4ea; color: #0f5132; }
.role-accountant   { background: #e0dbf9; color: #3d2a8f; }

/* --- active branch — header pill beside the tools. the branch must never be ambiguous --- */
.branch-pick {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 8px 5px 13px;
    border: 1px solid var(--border-color); border-radius: var(--r-card);
    background: var(--bg-primary);
}
.branch-pick > i { flex: 0 0 auto; font-size: 13px; color: var(--navy-accent-ink, var(--navy-accent)); }
.branch-pick.is-pinned { padding: 8px 15px; }
.branch-pick-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
/* the shared dropdown, compacted into the pill */
.branch-pick .searchable-dropdown { min-width: 186px; }
.branch-pick .sd-trigger { padding: 3px 8px; border: 0; border-radius: var(--r-card); background: transparent; color: var(--text-primary); font-size: 13.5px; font-weight: 700; }
.branch-pick .searchable-dropdown.open .sd-trigger,
.branch-pick .sd-trigger:focus { border: 0; box-shadow: none; }
.branch-pick .sd-panel { left: auto; right: -8px; min-width: 250px; border-radius: var(--r-card); }
body.dark-mode .branch-pick-name,
body.dark-mode .branch-pick .sd-trigger { color: var(--text-primary) !important; }

@media (max-width: 768px) {
    .header { padding: 12px 14px; }
    .header-page-icon { flex-basis: 38px; width: 38px; height: 38px; font-size: 16px; }
    .header-actions { width: 100%; justify-content: space-between; gap: 10px; }
    .branch-pick .searchable-dropdown { min-width: 138px; }
}
@media (max-width: 480px) {
    .branch-pick { padding-left: 10px; gap: 7px; }
    .branch-pick .searchable-dropdown { min-width: 112px; }
    .branch-pick .sd-trigger { font-size: 12.5px; }
}

/* --- page-level bits used by the hotel modules --- */
.form-panel { display: none; }
.form-panel.open { display: block; }
.list-panel.hidden { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid .form-group.span-2 { grid-column: 1 / -1; }
.logo-preview { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; border: 1px solid #dfe4ea; background: #fff; }

/* sidebar group heading inside the <ul> — matches .sidebar-menu-title, collapses with the rail */
li.sidebar-group-title { list-style: none; margin: 14px 0 6px; padding: 0 14px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.45); pointer-events: none; }
.sidebar.collapsed li.sidebar-group-title { font-size: 0; margin: 10px 0; padding: 0; border-top: 1px solid rgba(255,255,255,.12); }

/* demo quick-add button — sits beside the modal close icon / section header */
.modal-head-tools { display: flex; align-items: center; gap: 2px; }
.section-header .modal-head-tools { margin-left: auto; }
.demo-seed-btn { font-size: 19px; opacity: .7; background: none; border: none; cursor: pointer; color: inherit; padding: 2px 6px; }
.demo-seed-btn:hover { opacity: 1; color: #f0ad4e; }

/* staff: designation vs linked-login role disagreement — housekeeping assignment keys off the role */
.role-mismatch { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #8a4b08; background: #ffe5cc; padding: 2px 7px; border-radius: var(--r-control); margin-left: 6px; }
.no-login { color: #8a94a0; font-style: italic; }
.role-other { background: #e9ecef; color: #495057; }

/* --- rooms: tab strip, status board, status sheet. colour arrives per element as --st from the
       PHP status map, so this file never repeats a status hex --- */
.rs-tabs { display: flex; gap: 6px; margin: 0 0 16px; border-bottom: 2px solid var(--border-color); }
.rs-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: color .2s, border-color .2s; }
.rs-tab:hover { color: var(--navy-accent, #52796F); }
.rs-tab.active { color: var(--navy-accent, #52796F); border-bottom-color: var(--navy-accent, #52796F); }

/* each floor is its own card, so a 120-room board reads as blocks instead of one long wall */
.floor-group { margin-bottom: 16px; padding: 14px 16px 16px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-primary); }
.floor-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--border-color); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-secondary); }
.floor-title i { color: var(--navy-accent-ink, var(--navy-accent)); }
.floor-count { margin-left: auto; min-width: 22px; padding: 2px 9px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); color: var(--text-secondary); font-size: 11px; font-weight: 700; text-align: center; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }

/* the status colour carries the tile — a 4px spine plus a wash of itself. deliberately NOT a
   filled pill: half the status palette is light (dirty #f0ad4e, clean #5bc0de) and white text
   on those measures ~2:1, so the colour lives in the spine, the wash and the icon while the
   label stays readable text. */
.room-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; min-height: 106px; padding: 13px 13px 12px 14px; border: 1px solid var(--border-color); border-left: 4px solid var(--st, #6c757d); border-radius: var(--r-card); background: var(--bg-card); background: color-mix(in srgb, var(--st, #6c757d) 8%, var(--bg-card)); text-align: left; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.room-tile:hover { transform: translateY(-2px); border-color: var(--st, #6c757d); box-shadow: 0 6px 18px var(--shadow-hover, rgba(0,0,0,.12)); }
.room-tile:focus-visible { outline: none; border-color: var(--st, #6c757d); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, #6c757d) 32%, transparent); }
.room-tile-no { font-size: 23px; font-weight: 800; line-height: 1; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
/* one line, always — a long type or guest name must never make one tile taller than its row */
.room-tile-type { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
/* pinned to the bottom so every tile in a row lines its status up */
.room-tile-status { margin-top: auto; padding-top: 2px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-secondary); }
.room-tile-status i { font-size: 12px; color: var(--st, #6c757d); }
/* the tile's own background shorthand was killing the shimmer — restore it here */
.room-tile.skeleton { min-height: 106px; border-left-color: var(--border-color); background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; pointer-events: none; }

/* a dark surface swallows an 8% wash — give it more */
body.dark-mode .room-tile { background: color-mix(in srgb, var(--st, #6c757d) 16%, var(--bg-card)); }
body.dark-mode .floor-title { color: var(--text-secondary) !important; }

.room-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-control); background: var(--st, #6c757d); color: #fff; font-size: 12px; font-weight: 600; }
.status-current { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary); }
.status-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.status-choice { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid var(--border-color); border-left: 5px solid var(--st, #6c757d); border-radius: var(--r-card); background: var(--bg-card); color: var(--text-primary); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.status-choice:hover { background: var(--st, #6c757d); border-color: var(--st, #6c757d); color: #fff; }
.status-choice i { color: var(--st, #6c757d); }
.status-choice:hover i { color: #fff; }

/* ===== Room 360 — the room on the left, its people and its money on the right ===== */
/* 90% of the viewport — the base .modal already says width:90%, this only lifts its 800px cap */
.r360-overlay .modal.r360 { width: 90%; max-width: none; }
.r360-body { padding: 0; }
.r360-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
/* each pane scrolls on its own: a 7-button status rail must not push the guest panel off the
   screen, and the modal must not grow tall enough to leave the short pane half empty */
.r360-left, .r360-right { max-height: calc(90vh - 62px); overflow-y: auto; }
.r360-left { padding: 20px; border-right: 1px solid var(--border-color); background: var(--bg-primary); }
.r360-right { padding: 18px 20px 22px; min-width: 0; }
.r360-loading { padding: 52px 20px; text-align: center; color: var(--text-muted); }
.r360-title-sub { font-size: 13px; font-weight: 500; color: var(--text-muted); }

.r360-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 14px; padding: 16px; border: 1px solid var(--border-color); border-left: 5px solid var(--st, #6c757d); border-radius: var(--r-card); background: var(--bg-card); }
.r360-no { font-size: 30px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.r360-hero-sub { font-size: 12.5px; color: var(--text-muted); }

.r360-note { display: flex; gap: 10px; margin-bottom: 14px; padding: 11px 13px; border-left: 4px solid #D97706; border-radius: var(--r-card); background: rgba(217, 119, 6, 0.10); font-size: 13px; color: var(--text-primary); }
.r360-note i { margin-top: 2px; color: #D97706; }
.r360-note small { display: block; margin-top: 3px; color: var(--text-muted); }

.r360-block { margin-bottom: 16px; }
.r360-block h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
.r360-block h5 i { color: var(--navy-accent-ink, var(--navy-accent)); }
.r360-block .form-group { margin-bottom: 10px; }

.r360-facts { display: grid; gap: 8px; }
.r360-fact { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-secondary); }
.r360-fact i { width: 16px; text-align: center; color: var(--navy-accent-ink, var(--navy-accent)); }
.r360-fact span { flex: 1; }
.r360-fact strong { font-weight: 700; color: var(--text-primary); }
.r360-amen { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }

.r360-tabs { margin-bottom: 14px; }
.r360-pane { min-height: 240px; }

.r360-guest { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.r360-avatar { flex: 0 0 44px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(var(--navy-accent-rgb), 0.12); color: var(--navy-accent-ink, var(--navy-accent)); font-size: 17px; }
.r360-guest strong { display: block; font-size: 16px; color: var(--text-primary); }
.r360-guest small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }

.r360-warn { display: flex; gap: 9px; margin-bottom: 12px; padding: 10px 13px; border-left: 4px solid #DC2626; border-radius: var(--r-card); background: rgba(220, 38, 38, 0.10); font-size: 13px; font-weight: 600; color: #DC2626; }

.r360-folio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.r360-folio > div { padding: 11px 13px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); }
.r360-folio span { display: block; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); }
.r360-folio strong { display: block; margin-top: 3px; font-size: 16px; color: var(--text-primary); }
.r360-folio.owes > div:last-child { border-color: #DC2626; }
.r360-folio.owes > div:last-child strong { color: #DC2626; }

.r360-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.r360-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.r360-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); }
.r360-row-main strong { display: block; font-size: 14px; color: var(--text-primary); }
.r360-row-main small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.r360-row-side { text-align: right; white-space: nowrap; }
.r360-row-side strong { font-size: 14px; color: var(--text-primary); }
.r360-row-side small { display: block; font-size: 11.5px; color: var(--text-muted); }
.r360-row-side small.owes { font-weight: 700; color: #DC2626; }

.r360-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.r360-kpi { padding: 14px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); }
.r360-kpi span { display: block; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); }
.r360-kpi strong { display: block; margin: 5px 0 2px; font-size: 22px; font-weight: 800; color: var(--navy-primary); }
.r360-kpi small { font-size: 11.5px; color: var(--text-muted); }

.r360-empty { padding: 44px 20px; text-align: center; color: var(--text-muted); }
.r360-empty i { font-size: 34px; color: var(--navy-accent-ink, var(--navy-accent)); opacity: 0.45; }
.r360-empty h4 { margin: 12px 0 4px; font-size: 15px; color: var(--text-primary); }
.r360-empty p { margin: 0; font-size: 13px; }

/* dark mode — the blanket span/div/p/label rule further up outranks any plain class here */
body.dark-mode .r360-no,
body.dark-mode .r360-fact strong,
body.dark-mode .r360-guest strong,
body.dark-mode .r360-row-main strong,
body.dark-mode .r360-row-side strong,
body.dark-mode .r360-folio strong,
body.dark-mode .r360-note { color: var(--text-primary) !important; }
body.dark-mode .r360-hero-sub,
body.dark-mode .r360-title-sub,
body.dark-mode .r360-amen,
body.dark-mode .r360-folio span,
body.dark-mode .r360-kpi span,
body.dark-mode .r360-empty p,
body.dark-mode .r360-loading,
body.dark-mode .r360-block h5 { color: var(--text-muted) !important; }
body.dark-mode .r360-kpi strong { color: var(--navy-accent-ink, var(--navy-accent)) !important; }
body.dark-mode .r360-warn,
body.dark-mode .r360-row-side small.owes,
body.dark-mode .r360-folio.owes > div:last-child strong { color: #DC2626 !important; }

/* ===== Property 360 — reuses the room-360 shell, adds only what a whole branch needs ===== */
.h360-logo { width: 46px; height: 46px; border-radius: 6px; border: 1px solid var(--border-color); object-fit: cover; }
.h360-occ strong { display: block; font-size: 30px; font-weight: 800; line-height: 1; color: var(--navy-primary); }
.h360-occ small { display: block; margin: 4px 0 8px; font-size: 12px; color: var(--text-muted); }
.h360-bar { display: block; height: 7px; border-radius: var(--r-card); background: rgba(var(--navy-primary-rgb), 0.12); overflow: hidden; }
.h360-bar i { display: block; height: 100%; border-radius: var(--r-card); background: var(--navy-accent); transition: width 0.4s; }

.h360-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.h360-leg { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--border-color); border-left: 4px solid var(--st, #6c757d); border-radius: var(--r-control); background: var(--bg-card); font-size: 12px; color: var(--text-secondary); }
.h360-leg i { color: var(--st, #6c757d); }
.h360-leg b { font-weight: 800; color: var(--text-primary); }

.h360-sec { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
.h360-sec:first-child { margin-top: 0; }
.h360-sec i { color: var(--navy-accent-ink, var(--navy-accent)); }

/* the plan is a picture of the branch, not a control surface */
.room-tile.is-static { cursor: default; }
.room-tile.is-static:hover { transform: none; box-shadow: none; border-color: var(--border-color); border-left-color: var(--st, #6c757d); }

body.dark-mode .h360-occ strong { color: var(--navy-accent-ink, var(--navy-accent)) !important; }
body.dark-mode .h360-occ small,
body.dark-mode .h360-leg,
body.dark-mode .h360-sec { color: var(--text-muted) !important; }
body.dark-mode .h360-leg b { color: var(--text-primary) !important; }

@media (min-width: 1200px) {
    .r360-grid { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
    .r360-right .r360-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; max-width: 760px; }
}
@media (max-width: 900px) {
    .r360-grid { grid-template-columns: 1fr; }
    .r360-left { border-right: 0; border-bottom: 1px solid var(--border-color); }
    .r360-folio { grid-template-columns: 1fr; }
    .r360-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .r360-row-side { text-align: left; }
}

.count-chip { display: inline-block; min-width: 22px; padding: 2px 9px; border-radius: var(--r-card); background: var(--navy-accent, #52796F); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.modal-sm { max-width: 460px; }
.hidden { display: none !important; }

@media (max-width: 480px) {
    .room-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 9px; }
    .room-tile { min-height: 94px; padding: 11px 11px 10px 12px; }
    .room-tile-no { font-size: 20px; }
    .floor-group { padding: 12px 12px 13px; }
    .rs-tab { flex: 1; justify-content: center; padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .room-tile:hover { transform: none; }
}


/* ===== phases 4-9: guests · reservations · housekeeping · billing · reports · dashboard ===== */

/* --- DaisyUI-style toggle. This base was missing, so class="toggle" rendered as a raw checkbox
       on every page that shipped one. Rule + width guard verbatim from the standards doc. --- */
.toggle { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 24px; background: #ccc; position: relative; cursor: pointer; transition: background .3s; border: none; outline: none; vertical-align: middle; }
.toggle:checked { background: var(--navy-accent); }
.toggle::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle:checked::before { transform: translateX(20px); }
.toggle:disabled { opacity: .55; cursor: not-allowed; }
/* the form rule .form-group input (0,1,1) outranks a bare .toggle (0,1,0) and stretches the
   switch across the whole form, stranding the knob. never ship the toggle without this. */
.form-group .toggle, .toggle-row .toggle { width: 44px; min-width: 44px; max-width: 44px; height: 24px; flex: 0 0 44px; padding: 0; }


/* a 3-column grid, so OR and the button land on the INPUT's row. flex-end used to align them
   with the bottom of the whole box — which is the hint line, leaving the button sitting low. */
.guest-find {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 16px;
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--navy-accent);
    border-radius: var(--r-card);
    background: rgba(var(--navy-accent-rgb), .04);
}
/* the box's children join the parent grid so they can be placed row by row */
.guest-find-box { display: contents; }
.guest-find-box > label { grid-column: 1; grid-row: 1; }
.guest-find-input { grid-column: 1; grid-row: 2; }
.guest-find-hint { grid-column: 1; grid-row: 3; }
.guest-find-or { grid-column: 2; grid-row: 2; }
.guest-find-add { grid-column: 3; grid-row: 2; }
.guest-find-box label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.guest-find-input { position: relative; display: flex; align-items: center; }
.guest-find-input > i {
    position: absolute;
    left: 14px;
    font-size: 15px;
    color: var(--navy-accent-ink, var(--navy-accent));
    pointer-events: none;
}
.guest-find-input input {
    width: 100%;
    height: 50px;
    padding: 0 44px 0 40px;
    border: 2px solid var(--input-border);
    border-radius: var(--r-control);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color .25s, box-shadow .25s;
}
.guest-find-input input:focus {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .15);
}
.guest-find-clear {
    position: absolute;
    right: 8px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--r-control);
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
}
.guest-find-clear:hover { background: var(--border-color); color: var(--text-primary); }
.guest-find-hint { display: block; margin-top: 7px; font-size: 12.5px; color: var(--text-muted); }
.guest-find-or {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.guest-find-add { height: 50px; white-space: nowrap; }
.guest-pick-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.guest-pick-banner .btn { margin-left: auto; }
@media (max-width: 768px) {
    .guest-find { grid-template-columns: 1fr; row-gap: 12px; padding: 14px; }
    .guest-find-or { grid-column: 1; grid-row: 4; }
    .guest-find-add { grid-column: 1; grid-row: 5; width: 100%; justify-content: center; }
}

.guest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.guest-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--navy-accent);
    border-radius: var(--r-card);
    background: var(--bg-card);
    transition: transform .15s, box-shadow .15s;
}
.guest-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px var(--shadow-hover); }
.guest-card-black { border-left-color: #dc3545; }
.guest-card-skel { height: 210px; border-left-color: var(--border-color); pointer-events: none; }
.guest-black {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: var(--r-control);
    background: #f8d7da;
    color: #842029;
    font-size: 12.5px;
    line-height: 1.4;
}
.guest-black-lg { margin-bottom: 16px; padding: 13px 16px; font-size: 14px; }
.guest-card-head { display: flex; align-items: center; gap: 12px; }
.guest-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(var(--navy-accent-rgb), .12);
    color: var(--navy-accent-ink, var(--navy-accent));
    font-size: 19px;
}
.guest-card-id { min-width: 0; }
.guest-name {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.guest-phone { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--navy-accent-ink, var(--navy-accent)); }
.guest-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-muted); }
.guest-meta span { display: inline-flex; align-items: center; gap: 5px; }
.guest-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.guest-stat {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2px 8px;
    padding: 8px 10px;
    border-radius: var(--r-card);
    background: rgba(var(--navy-primary-rgb), .04);
}
.guest-stat i { grid-row: span 2; color: var(--navy-accent-ink, var(--navy-accent)); font-size: 14px; opacity: .8; }
.guest-stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); }
.guest-stat-value { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.guest-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
body.dark-mode .guest-black { background: rgba(220, 53, 69, .18); color: #f5b8bf; }
body.dark-mode .guest-stat { background: rgba(255, 255, 255, .05); }
@media (max-width: 480px) {
    .guest-grid { grid-template-columns: 1fr; }
    .guest-stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .guest-card:hover { transform: none; } }

.gd-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.gd-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 104px;
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    background: var(--bg-card);
    overflow: hidden;
}
.gd-chip img { width: 100%; height: 78px; object-fit: cover; display: block; }
.gd-chip-name {
    padding: 5px 6px;
    font-size: 10.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gd-chip-rm, .gd-thumb-rm {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 53, 69, .92);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}
.gd-chip-rm:hover, .gd-thumb-rm:hover { background: #dc3545; }
.gd-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.gd-thumb {
    position: relative;
    width: 132px;
    height: 100px;
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    background: var(--bg-card);
    overflow: hidden;
}
.gd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.gd-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gd-upload .file-input { flex: 1 1 260px; }
.gd-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .82);
    cursor: zoom-out;
}
.gd-lightbox.open { display: flex; }
.gd-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: var(--r-card); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.gd-lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}
.gd-lightbox-close:hover { background: rgba(255, 255, 255, .3); }
.file-errs {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: var(--r-control);
    background: #f8d7da;
    color: #842029;
    font-size: 12.5px;
}
.file-errs div { display: flex; align-items: center; gap: 7px; }
body.dark-mode .file-errs { background: rgba(220, 53, 69, .18); color: #f5b8bf; }
@media (max-width: 480px) {
    .gd-thumb { width: 46%; height: 90px; }
    .gd-upload .file-input { flex: 1 1 100%; }
}

.guest-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    background: var(--bg-card);
    margin-bottom: 18px;
}
.guest-avatar-lg { flex: 0 0 62px; width: 62px; height: 62px; font-size: 26px; }
.guest-hero-main { flex: 1 1 260px; min-width: 0; }
.guest-hero-name { margin: 0 0 8px; font-size: 20px; font-weight: 800; color: var(--text-primary); }
.guest-hero-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-secondary); }
.guest-hero-sub span { display: inline-flex; align-items: center; gap: 6px; }
.guest-hero-sub i { color: var(--navy-accent-ink, var(--navy-accent)); opacity: .8; }
.guest-hero-notes {
    margin: 10px 0 0;
    padding: 9px 12px;
    border-left: 3px solid var(--navy-accent);
    border-radius: 0 3px 3px 0;
    background: rgba(var(--navy-accent-rgb), .06);
    font-size: 13px;
    color: var(--text-secondary);
}
.guest-hero-black {
    flex: 0 0 auto;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--r-card);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
}
.guest-hero-black i { color: #dc3545; }
.gd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.gd-stat {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2px 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--navy-accent);
    border-radius: var(--r-card);
    background: var(--bg-card);
}
.gd-stat i { grid-row: span 2; font-size: 20px; color: var(--navy-accent-ink, var(--navy-accent)); opacity: .85; }
.gd-stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); }
.gd-stat-value { font-size: 17px; font-weight: 800; color: var(--text-primary); }
.gd-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.gd-sub i { color: var(--navy-accent-ink, var(--navy-accent)); }
@media (max-width: 768px) {
    .guest-hero { padding: 14px; }
    .guest-hero-black { width: 100%; justify-content: space-between; }
}

.modal-lg { max-width: 980px; }

.rv-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.rv-step { display: flex; align-items: center; gap: 9px; flex: 1 1 180px; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.rv-step-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: var(--border-color); color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.rv-step-label { display: inline-flex; align-items: center; gap: 6px; }
.rv-step.active { border-color: var(--navy-accent); background: var(--navy-accent); color: var(--navy-on-accent, #fff); }
.rv-step.active .rv-step-no { background: #fff; color: var(--navy-accent-ink, var(--navy-accent)); }
.rv-step.done { border-color: var(--success); color: var(--success); }
.rv-step.done .rv-step-no { background: var(--success); color: #fff; }
.rv-pane { margin: 0 0 6px; }

.rv-avail-num { display: inline-block; min-width: 26px; padding: 1px 9px; margin-right: 4px; border-radius: var(--r-control); background: var(--navy-accent); color: var(--navy-on-accent, #fff); font-size: 14px; font-weight: 800; text-align: center; }

.rv-sum { margin: 14px 0; border: 1px solid var(--border-color); border-radius: var(--r-card); overflow: hidden; }
.rv-sum-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text-secondary); }
.rv-sum-row:last-child { border-bottom: none; }
.rv-sum-row > span:last-child { font-weight: 700; color: var(--text-primary); text-align: right; }
.rv-sum-row i { width: 16px; margin-right: 6px; color: var(--navy-accent-ink, var(--navy-accent)); }
.rv-sum-row.total { background: var(--navy-primary); color: #fff; font-size: 14px; }
.rv-sum-row.total > span:last-child { color: #fff; font-size: 15px; }
.rv-sum-row.total i { color: #fff; }

.rv-row > td:first-child { box-shadow: inset 4px 0 0 0 var(--st, #6c757d); }

.rv-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.rv-lines th { padding: 9px 10px; background: var(--navy-primary); color: #fff; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.rv-lines td { padding: 8px 10px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
.rv-lines tbody tr:hover td { background: var(--table-hover); }
.rv-num { text-align: right; font-weight: 700; color: var(--text-primary); white-space: nowrap; }

.rv-split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.rv-col { min-width: 0; }
.rv-col-title { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.rv-col-title i { color: var(--navy-accent-ink, var(--navy-accent)); }
.rv-bottom { margin-top: 8px; padding-top: 14px; border-top: 2px solid var(--border-color); }
@media (max-width: 820px) { .rv-split { grid-template-columns: 1fr; gap: 8px; } }

.rv-typecard { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; margin-bottom: 9px; padding: 12px 14px; border: 1px solid var(--border-color); border-left: 5px solid var(--navy-accent); border-radius: var(--r-card); background: var(--bg-card); text-align: left; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.rv-typecard:hover { transform: translateY(-2px); box-shadow: 0 4px 14px var(--shadow-hover); }
.rv-typecard.active { border-color: var(--success); background: rgba(var(--navy-accent-rgb), .08); }
.rv-typecard.rv-off { opacity: .5; border-left-color: var(--danger); cursor: not-allowed; }
.rv-typecard.rv-off:hover { transform: none; box-shadow: none; }
.rv-typecard-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.rv-typecard-rate { font-size: 14px; font-weight: 700; color: var(--navy-accent-ink, var(--navy-accent)); }
.rv-typecard-rate small { font-size: 11px; font-weight: 500; color: #8a94a0; }
.rv-typecard-av { font-size: 11.5px; color: #8a94a0; }
.rv-typecard-av i { margin-right: 3px; }
@media (prefers-reduced-motion: reduce) { .rv-typecard:hover { transform: none; } }

/* big SQUARE room cards — the number is the whole point, so it dominates the tile */
.rv-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.rv-room { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1 / 1; min-height: 110px; padding: 12px; border: 2px solid var(--border-color); border-top: 6px solid var(--success); border-radius: var(--r-card); background: var(--bg-card); text-align: center; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.rv-room:hover { background: var(--table-hover); border-color: var(--success); }
.rv-room.active { background: var(--success); border-color: var(--success); color: #fff; }
.rv-room-no { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 30px; font-weight: 900; letter-spacing: .5px; color: var(--text-primary); line-height: 1.1; }
.rv-room-no i { font-size: 14px; color: var(--text-muted); }
.rv-room-meta { font-size: 11px; color: #8a94a0; }
.rv-room.active .rv-room-no, .rv-room.active .rv-room-no i, .rv-room.active .rv-room-meta { color: #fff; }

/* highlighted room number in tables — bold navy badge, reads at a glance */
.room-no-hl { display: inline-block; padding: 2px 10px; border-radius: var(--r-control); background: var(--navy-primary); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .5px; }

/* group booking: one row per type — name pinned left, qty stepper pinned right */
.rv-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rv-grow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-color); border-left: 5px solid var(--navy-light); border-radius: var(--r-card); background: var(--bg-card); }
.rv-grow.picked { border-color: var(--navy-primary); border-left-color: var(--navy-primary); background: rgba(var(--navy-primary-rgb), .06); }
.rv-grow.rv-off { opacity: .55; }
.rv-grow-name { font-weight: 700; color: var(--text-primary); }
.rv-grow-meta { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.rv-grow-qty { display: flex; align-items: center; gap: 10px; }
.rv-grow-qty b { min-width: 22px; text-align: center; font-size: 16px; color: var(--text-primary); }
.rv-step-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); border-radius: var(--r-control); background: var(--bg-card); color: var(--text-primary); cursor: pointer; transition: background .15s; }
.rv-step-btn:hover:not(:disabled) { background: var(--navy-primary); color: #fff; border-color: var(--navy-primary); }
.rv-step-btn:disabled { opacity: .35; cursor: not-allowed; }

/* quotation line items: [type dropdown] [rooms] [rate] [line total] [remove] */
.qt-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.qt-item { display: grid; grid-template-columns: minmax(160px, 2fr) 84px minmax(110px, 1fr) minmax(90px, auto) 34px; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border-color); border-left: 5px solid var(--navy-light); border-radius: var(--r-card); background: var(--bg-card); }
/* the line inputs are NOT inside a .form-group, so the form rule never reached them and they
   rendered as raw browser boxes. same tokens as .sd-trigger so all three controls in the row
   are the same height. 16px font is deliberate — anything smaller makes iOS zoom on focus. */
.qt-item input {
    width: 100%;
    min-width: 0;              /* grid children default to their intrinsic width and overflow */
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--r-control);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    transition: border-color .2s, box-shadow .2s;
}
.qt-item input:focus {
    outline: none;
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 2px rgba(var(--navy-accent-rgb), 0.2);
}
.qt-item .qi-rooms { padding-left: 8px; padding-right: 4px; text-align: center; }
.qt-item .qi-rate  { text-align: right; }   /* money lines up with the total beside it */
.qt-item .qi-total { text-align: right; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.qt-item .qi-hold { width: 30px; }
@media (max-width: 640px) {
    .qt-item { grid-template-columns: 1fr 1fr; }
    .qt-item .qi-type-wrap, .qt-item .qi-total { grid-column: 1 / -1; }
}

.rv-newguest { margin-top: 12px; padding: 14px; border: 1px dashed var(--border-color); border-radius: var(--r-card); background: var(--bg-primary); }
.gs-results { display: flex; flex-direction: column; gap: 7px; max-height: 230px; overflow-y: auto; margin: 10px 0; }
.gs-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border: 1px solid var(--border-color); border-left: 4px solid var(--navy-accent); border-radius: var(--r-card); background: var(--bg-card); text-align: left; cursor: pointer; transition: background .15s; }
.gs-item:hover { background: var(--table-hover); }
.gs-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.gs-meta { display: block; font-size: 11.5px; color: #8a94a0; }
.gs-meta i { margin-right: 3px; }
.gs-black { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-control); background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; }
.gs-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; padding: 11px 13px; border: 1px solid var(--success); border-left: 5px solid var(--success); border-radius: var(--r-card); background: var(--bg-card); font-size: 13.5px; color: var(--text-primary); }
.gs-picked > i { color: var(--success); }
.gs-picked .btn { margin-left: auto; }

/* ===== Housekeeping (housekeeping.php) ===== */
/* cleaner screen: one big card per room, three thumb-sized buttons, nothing else */
.hk-card { padding: 16px; margin-bottom: 14px; border: 1px solid var(--border-color); border-left: 5px solid var(--st, #6c757d); border-radius: var(--r-card); background: var(--bg-card); }
.hk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hk-card-room { margin: 0; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.hk-card-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; font-size: 13px; }
.hk-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hk-card-meta i { color: var(--navy-accent, #52796F); }
.hk-arrival { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid #f0ad4e; border-radius: var(--r-control); background: rgba(240, 173, 78, .15); font-size: 13px; font-weight: 600; }
.hk-arrival i { margin-right: 7px; color: #f0ad4e; }
.hk-note { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--navy-accent, #52796F); border-radius: var(--r-control); background: rgba(var(--navy-accent-rgb), .09); font-size: 13px; white-space: pre-line; }
.hk-note i { margin-right: 7px; color: var(--navy-accent, #52796F); }
.hk-card-actions { display: grid; gap: 10px; margin-top: 16px; }
.hk-big { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px; font-size: 16px; }
.hk-card-skeleton { height: 260px; border-left-color: var(--border-color); }

/* assign pool: tap several rooms at once, dirty ones first */
.hk-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.hk-scope .info-text { margin-left: auto; } /* buttons left, hint right — not run on after the chip */
.hk-scope-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--border-color); border-radius: var(--r-control); background: var(--bg-card); color: var(--text-primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.hk-scope-btn.active { background: var(--navy-primary, #234E52); border-color: var(--navy-primary, #234E52); color: #fff; }
.hk-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; max-height: 340px; overflow-y: auto; padding: 2px; margin-bottom: 18px; }
.hk-pick { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; padding: 12px 34px 12px 12px; border: 1px solid var(--border-color); border-left: 5px solid var(--st, #6c757d); border-radius: var(--r-card); background: var(--bg-card); text-align: left; cursor: pointer; transition: box-shadow .15s, background .15s; }
.hk-pick.picked { border-color: var(--navy-accent, #52796F); background: rgba(var(--navy-accent-rgb), .08); box-shadow: inset 0 0 0 2px var(--navy-accent, #52796F); }
.hk-pick:disabled { opacity: .5; cursor: not-allowed; }
.hk-pick-no { font-size: 20px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.hk-pick-sub { font-size: 11.5px; color: #8a94a0; }
.hk-pick-arr { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.hk-pick-arr i { color: #f0ad4e; }
.hk-pick-tick { position: absolute; top: 11px; right: 11px; font-size: 15px; color: var(--border-color); }
.hk-pick.picked .hk-pick-tick { color: var(--navy-accent, #52796F); }

/* inspection queue: sorted by who is arriving, not by room number */
.hk-q-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border-color); border-left: 4px solid #5bc0de; border-radius: var(--r-card); background: var(--bg-card); }
.hk-q-main { flex: 1 1 190px; }
.hk-q-room { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.hk-q-sub { margin-top: 3px; font-size: 12px; }
.hk-q-arrival { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: var(--r-control); background: rgba(240, 173, 78, .18); font-size: 12px; font-weight: 600; }
.hk-q-arrival i { color: #f0ad4e; }
.hk-q-idle { background: rgba(138, 148, 160, .16); }
.hk-q-idle i { color: #8a94a0; }
.hk-q-acts { display: flex; flex-wrap: wrap; gap: 8px; }

@media (min-width: 641px) {
    .hk-card-actions { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .hk-card-room { font-size: 34px; }
    .hk-pool { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 300px; }
    .hk-q-acts { width: 100%; }
    .hk-q-acts .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .hk-pick { transition: none; }
}

/* --- billing: status-tinted folio rows. the status colour arrives per row as --st at runtime,
       so this file never repeats a status hex --- */
tr.bill-tint-open    > td { background: rgba(var(--navy-accent-rgb), .06); }
tr.bill-tint-partial > td { background: rgba(240, 173, 78, .12); }
tr.bill-tint-paid    > td { background: rgba(40, 167, 69, .09); }
tr.bill-tint-void    > td { background: rgba(220, 53, 69, .09); }
tr.bill-tint-void .bill-no { text-decoration: line-through; }
tr[class*="bill-tint-"] > td:first-child { box-shadow: inset 4px 0 0 0 var(--st, #6c757d); }

/* the running balance must survive a scroll — .main-content is the scrollport */
.folio-head { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 20px; padding: 16px 20px; border: 1px solid var(--border-color); border-left: 5px solid var(--st, var(--navy-accent)); border-radius: var(--r-card); background: var(--bg-card); box-shadow: 0 3px 14px var(--shadow-hover, rgba(0, 0, 0, .10)); }
.folio-head-main { flex: 1 1 320px; min-width: 0; }
.folio-head-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 19px; font-weight: 800; color: var(--text-primary); }
.folio-head-sub { margin-top: 5px; font-size: 13px; color: var(--text-secondary); }
.folio-head-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: #8a94a0; }
.folio-head-meta i { margin-right: 4px; }
.folio-void-note { margin-top: 8px; padding: 6px 10px; border-radius: var(--r-control); background: #f8d7da; color: #721c24; font-size: 12px; font-weight: 600; }

.folio-balance { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 10px 16px; border-radius: var(--r-card); background: rgba(220, 53, 69, .08); }
.folio-balance.settled { background: rgba(40, 167, 69, .10); }
.folio-balance-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-secondary); }
.folio-balance-value { font-size: 26px; font-weight: 800; line-height: 1.1; color: #dc3545; font-variant-numeric: tabular-nums; }
.folio-balance.settled .folio-balance-value { color: #28a745; }
.folio-balance-sub { font-size: 11px; color: #8a94a0; }
.folio-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.folio-block { margin: 0 0 24px; }
.folio-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.folio-block-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); }

.folio-table th, .folio-table td { padding: 10px 12px; text-align: left; font-size: 13px; }
.folio-table td:first-child { background: transparent; font-weight: 500; white-space: nowrap; }
/* room nights come from the reservation — they read as a different class of row and carry no edit control */
.folio-table tr.room-row td { background: rgba(var(--navy-accent-rgb), .05); }
.folio-table tr.room-row td:first-child { box-shadow: inset 4px 0 0 0 var(--navy-accent, #52796F); }
/* voided lines and reversed payments stay on the folio — evidence, not clutter */
.folio-table tr.void-row td { text-decoration: line-through; opacity: .55; }
.void-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-card); background: #f8d7da; color: #721c24; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; text-decoration: none; }
.type-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-card); background: var(--border-color); color: var(--text-secondary); font-size: 11px; font-weight: 700; white-space: nowrap; }

.folio-totals { max-width: 420px; margin-left: auto; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); overflow: hidden; }
.folio-total-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 16px; border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text-secondary); }
.folio-total-row:last-child { border-bottom: none; }
.folio-total-row .num { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.folio-total-row.grand { background: var(--navy-primary, #234E52); color: #fff; font-weight: 700; }
.folio-total-row.grand .num { color: #fff; }
.folio-total-row.due .num { color: #dc3545; font-size: 16px; font-weight: 800; }
.folio-total-row.settled .num { color: #28a745; font-size: 16px; font-weight: 800; }

.amount-preview { margin: 6px 0 0; padding: 10px 14px; border-radius: var(--r-control); background: rgba(var(--navy-accent-rgb), .08); font-size: 14px; color: var(--text-primary); }

/* printable invoice: hidden on screen, the only thing left standing on paper */
.rs-print-doc { display: none; }
.pr-head { display: flex; align-items: flex-start; gap: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--navy-primary); }
.pr-logo { width: 68px; height: 68px; object-fit: contain; }
.pr-brand { flex: 1; }
.pr-brand h1 { margin: 0 0 4px; font-size: 22px; }
.pr-brand p, .pr-meta p, .pr-parties p { margin: 2px 0; font-size: 12px; }
.pr-meta { text-align: right; }
.pr-meta h2 { margin: 0 0 4px; font-size: 18px; text-transform: uppercase; letter-spacing: 2px; }
.pr-parties { display: flex; gap: 30px; margin: 18px 0; }
.pr-parties > div { flex: 1; }
.pr-parties h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #555; }
.pr-table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 12px; }
.pr-table th, .pr-table td { padding: 7px 9px; border: 1px solid #ccc; text-align: left; }
.pr-table th { background: #f1f3f5; }
.pr-sub { margin: 20px 0 0; font-size: 13px; }
.pr-tot { max-width: 330px; margin-left: auto; font-size: 12px; }
.pr-tot > div { display: flex; justify-content: space-between; gap: 20px; padding: 5px 9px; border-bottom: 1px solid #e3e3e3; }
.pr-tot .pr-grand { background: #f1f3f5; font-size: 13px; font-weight: 700; }
.pr-foot { margin-top: 26px; text-align: center; font-size: 11px; color: #666; }

@media print {
    body.rs-printing > *:not(.rs-print-doc) { display: none !important; }
    body.rs-printing .rs-print-doc { display: block !important; padding: 0; background: #fff; color: #000; }
    body.rs-printing .pr-table th { background: #f1f3f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 14mm; }
}

/* right-aligned money/qty cells — must sit AFTER .folio-table td and .about-roles-table td
   (equal specificity, source order decides) */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 768px) {
    .folio-head { position: static; }
    .folio-balance { align-items: flex-start; width: 100%; }
    .folio-actions { width: 100%; }
    .folio-totals { max-width: none; }
    .folio-block-head { flex-wrap: wrap; }
}

.rp-note { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 12px; padding: 11px 14px; border: 1px solid var(--border-color); border-left: 4px solid var(--navy-accent, #52796F); border-radius: var(--r-card); background: var(--bg-primary); color: var(--text-secondary); font-size: 12.5px; line-height: 1.55; }
.rp-note i { margin-top: 2px; color: var(--navy-accent, #52796F); }

.rp-due { font-weight: 700; color: #dc3545; }
.rp-clear { color: var(--text-secondary); }

.rp-pane { margin-top: 4px; }

/* ===== AdminLTE info-box mini stats (dashboard) ===== */
.lte-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 1200px) { .lte-info-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .lte-info-grid { grid-template-columns: 1fr; } }

.info-box {
    display: flex;
    align-items: stretch;
    min-height: 84px;
    background: var(--bg-card);
    box-shadow: 0 2px 6px var(--shadow-color);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.info-box:hover { transform: translateY(-2px); box-shadow: 0 6px 16px var(--shadow-hover); color: inherit; }

.info-box-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    flex: 0 0 74px;
    font-size: 26px;
    color: #fff;
}
.info-box-icon.bg-warning { color: #1f2d3d; }

.info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 12px 16px;
    min-width: 0;
}
.info-box-text { font-size: 12px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-muted); }
.info-box-number { font-size: 22px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-box-sub { font-size: 12px; color: var(--text-secondary); }

.small-box-sup { font-size: 18px; font-weight: 700; margin-left: 2px; top: -0.4em; }

.lte-kpi-grid.lte-kpi-flush { margin-bottom: 0; }

/* --- first-run welcome tour. sizing, gradient and the dot treatment are the standards-doc values;
       the two text colours use theme tokens because this project has a dark mode --- */
.tour-modal { max-width: 430px; }
.tour-body { text-align: center; padding: 30px 26px 20px; }
.tour-ico { width: 74px; height: 74px; margin: 0 auto; border-radius: 20px; background: linear-gradient(135deg, var(--navy-accent), var(--navy-light)); color: var(--navy-on-accent, #fff); font-size: 30px; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(var(--navy-accent-rgb),.35); }
.tour-title { color: var(--navy-primary); margin: 14px 0 8px; }
.tour-text { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.tour-dots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: #dfe5ec; cursor: pointer; transition: all .2s; }
.tour-dots span.on { background: var(--navy-accent); width: 20px; border-radius: 5px; }
.tour-actions { justify-content: space-between; margin-top: 0; padding: 0 26px 24px; }
body.dark-mode .tour-title { color: var(--text-primary); }
body.dark-mode .tour-dots span { background: rgba(255,255,255,.18); }
@media (prefers-reduced-motion: reduce) { .tour-dots span, .tour-ico { transition: none; } }

/* ===== Chip-row dense table — the cell vocabulary; the grid itself is styled under .chip-table.tabulator ===== */

/* stacked chip rows in one cell */
.cell-stack { display: flex; flex-direction: column; gap: 3px; }
.chip-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 152px; white-space: nowrap; }
.cell-title { font-size: 13px; font-weight: 800; color: var(--navy-primary); margin-bottom: 2px; }

/* the chip — uniform size so values line up down the whole cell */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 21px; min-width: 100px; border-radius: var(--r-control); font-size: 10.8px; font-weight: 700; line-height: 1; white-space: nowrap; border: 1px solid transparent; flex: none; }
.chip i { font-size: 10px; width: 11px; text-align: center; }

/* palettes — named by colour/role, never by domain */
.chip-navy       { background: var(--navy-primary); color: #fff; }
.chip-link       { background: rgba(var(--navy-accent-rgb),.12); color: var(--navy-accent-ink, var(--navy-accent)); border-color: rgba(var(--navy-accent-rgb),.28); }
.chip-soft-navy  { background: rgba(var(--navy-primary-rgb),.09); color: var(--navy-primary); border-color: rgba(var(--navy-primary-rgb),.2); }
.chip-soft-green { background: #e2f6ea; color: #1b7a43; border-color: #c7eed6; }
.chip-soft-amber { background: #fdecd6; color: #9b5915; border-color: #f8dab4; }
.chip-soft-purple{ background: #ece2f9; color: #6a1b9a; border-color: #dccbf2; }
.chip-soft-tan   { background: #fbe7c6; color: #92520a; border-color: #f3d29b; }
.chip-soft-red   { background: #fdecea; color: #c0392b; border-color: #f8d3ce; }

/* values beside chips — pinned right */
.chip-row .val { font-weight: 800; font-size: 12.5px; margin-left: auto; text-align: right; }
.val-amount { color: #c44e00; }
.val-pos    { color: #1b7a43; }
.val-neg    { color: #c0392b; }
.val-navy   { color: var(--navy-primary); }
.val-muted  { color: #667685; font-weight: 700; }
.val-box    { background: rgba(var(--navy-primary-rgb),.07); color: var(--navy-primary); padding: 2px 7px; border-radius: var(--r-control); font-size: 11px; font-weight: 700; font-family: 'Courier New', monospace; letter-spacing: .2px; }

/* action icons centred in their own cell */
.actions-cell { display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: nowrap; }
.actions-cell .action-icon { margin: 0; padding: 5px 7px; font-size: 16px; }

/* the brand greens deliberately do NOT flip for dark mode, so anything painted with
   --navy-primary reads ~1.8:1 on the dark card. these re-ground it on light ink. */
body.dark-mode .cell-title { color: var(--text-primary); }
body.dark-mode .val-navy   { color: var(--text-primary); }
body.dark-mode .chip-soft-navy { background: rgba(255,255,255,.08); color: var(--text-primary); border-color: rgba(255,255,255,.16); }
body.dark-mode .chip-link      { background: rgba(var(--navy-accent-rgb),.30); color: var(--text-primary); border-color: rgba(var(--navy-accent-rgb),.45); }
body.dark-mode .val-amount { color: #f0a860; }
body.dark-mode .val-pos    { color: #6ee7a4; }
body.dark-mode .val-neg    { color: #f08a80; }
body.dark-mode .val-box { background: rgba(255,255,255,.08); color: var(--text-primary); }
body.dark-mode .chip-soft-green { background: #12301f; color: #6ee7a4; border-color: #1d4a31; }
body.dark-mode .chip-soft-amber { background: #33290d; color: #f0b866; border-color: #4a3a12; }
body.dark-mode .chip-soft-purple{ background: #2a1a3d; color: #c79bee; border-color: #3d2758; }
body.dark-mode .chip-soft-tan   { background: #33260d; color: #e0a95e; border-color: #4a3712; }
body.dark-mode .chip-soft-red   { background: #3a1a18; color: #f08a80; border-color: #542622; }
body.dark-mode .val-muted { color: #828c99; }

/* ===== PageActions: the active page publishes its buttons into the header bar ===== */
.page-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.page-actions .btn { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
.page-actions .btn i { font-size: 12px; }

@media (max-width: 1100px) {
    /* the label goes, the icon stays — a header bar must never wrap onto three rows */
    .page-actions .btn span { display: none; }
    .page-actions .btn { padding: 8px 10px; }
}
@media (max-width: 768px) {
    .header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .page-actions { order: 3; width: 100%; justify-content: flex-start; margin-top: 8px; }
    .page-actions .btn span { display: inline; }
}

/* invoice document pane — the server-rendered paper lives in its own sandboxed document, so
   neither styles.css nor the blanket dark-mode rule can repaint an invoice */
.inv-doc-frame { display: block; width: 100%; height: 62vh; min-height: 320px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: #fff; }
@media (max-width: 768px) { .inv-doc-frame { height: 70vh; } }

/* ===== Attendance — my day on the left, today's facts on the right ===== */
.att-me-section { margin-bottom: 25px; }
.att-me { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 20px; align-items: start; }
.att-me-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); }
.att-big { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px; font-size: 16px; }
.att-fence { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.att-fence i { margin-top: 2px; color: var(--navy-accent-ink, var(--navy-accent)); }
.att-me-facts { padding: 16px; border: 1px solid var(--border-color); border-left: 5px solid var(--navy-accent); border-radius: var(--r-card); background: var(--bg-card); }
.att-shift { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.att-honest { margin: 16px 0 0; }

@media (max-width: 768px) {
    .att-me { grid-template-columns: 1fr; }
}

/* payroll row tint — colour comes from the PHP status map at runtime */
.sal-row > td:first-child { box-shadow: inset 4px 0 0 0 var(--st, #6c757d); }

/* payslip print window: the .pr-* children already style themselves, this is just the sheet */
.sal-print-sheet { max-width: 820px; margin: 0 auto; padding: 26px 30px; background: #fff; color: #000; }
@media print { .sal-print-sheet { max-width: none; margin: 0; padding: 0; } }

/* ===== audit trail: who voided / reversed / cancelled, and when ===== */
.audit-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; font-size: 11.5px; color: #c0392b; text-decoration: none; }
.audit-trail small { color: #8a5a54; font-weight: 600; }
/* the void row is struck through and faded — the audit line is the one thing that must stay legible */
.folio-table tr.void-row td .audit-trail { text-decoration: none; opacity: 1; }
.actions-cell a.action-icon { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
body.dark-mode .audit-trail { color: #f08a80; }
body.dark-mode .audit-trail small { color: #cc9999; }

/* rate-plan rows: these chips sit inside a sentence, so the global 100px floor does not apply */
.r360-row-main .chip, .r360-row-side .chip { min-width: 0; }
.r360-row-side .actions-cell { justify-content: flex-end; margin-top: 6px; }

/* .toggle-row .toggle already sets a flex basis and .guest-hero-black a gap, but nothing ever
   set display:flex on the parent — so a 24px switch sat unaligned beside a 50px input */
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row label { margin: 0; cursor: pointer; }
.form-group .toggle-row { min-height: 50px; }
.form-group .info-text { margin-top: 7px; }

/* ===== PWA install chip — themed, squared, and out of the way of page content ===== */
.rs-install-chip {
    position: fixed; right: 18px; bottom: 18px; z-index: 900;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border: none; border-radius: var(--r-control);
    background: var(--navy-primary); color: #fff;
    font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.rs-install-chip:hover { background: var(--navy-hover); }

/* fixed bottom-right chrome must never sit on top of the last control on the page */
.main-content { padding-bottom: 84px; }

/* ===== folio action bar: grouped, with the destructive action held apart ===== */
.folio-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.folio-actions .folio-act-group { display: flex; flex-wrap: wrap; gap: 6px; }
.folio-actions .folio-act-group + .folio-act-group { padding-left: 8px; border-left: 1px solid var(--border-color); }
.folio-actions .folio-act-danger { margin-left: auto; }
@media (max-width: 900px) {
    .folio-actions .folio-act-group + .folio-act-group { padding-left: 0; border-left: none; }
    .folio-actions .folio-act-danger { margin-left: 0; }
}

/* ===== Quotation editor: form left, live A4 offer right ===== */
.qt-split { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 54%); padding: 0; }
.qt-form-pane { padding: 20px; overflow-y: auto; max-height: calc(90vh - 68px); border-right: 1px solid var(--border-color); }
.qt-preview-pane { display: flex; flex-direction: column; min-width: 0; background: var(--bg-primary); max-height: calc(90vh - 68px); }
.qt-paper-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.qt-paper-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
/* the sheet is a piece of paper, so it keeps a white ground and a shadow in both modes */
.qt-paper { flex: 1; overflow-y: auto; padding: 18px; }
.qt-paper .qs-sheet { background: #fff; color: #222; padding: 26px 24px; margin: 0 auto;
    box-shadow: 0 3px 16px rgba(0,0,0,.16); border: 1px solid var(--border-color);
    min-height: 0; aspect-ratio: 1 / 1.414; overflow: hidden; }
.qt-req { color: var(--danger); }

@media (max-width: 1000px) {
    .qt-split { grid-template-columns: 1fr; }
    .qt-form-pane { border-right: none; border-bottom: 1px solid var(--border-color); max-height: none; }
    .qt-preview-pane { max-height: 70vh; }
}

/* ===== staff bank accounts — one payout account per row, actions pinned right ===== */
.sba-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.sba-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--border-color); border-left: 4px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); }
.sba-row.is-primary { border-left-color: var(--success); }
.sba-row .cell-stack { flex: 1 1 auto; min-width: 0; }
.sba-row .actions-cell { flex: 0 0 auto; }
.sba-form { padding: 12px 14px; margin: 0 0 12px; border: 1px dashed var(--border-color); border-radius: var(--r-card); background: var(--bg-primary); }
.sba-form .gd-sub { margin-top: 0; }
.sba-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ===== Salary payout — the pay screen's headline and the account picker ===== */
/* real money is about to move: who, which month, and the net in large type */
.pay-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--border-color); border-left: 5px solid var(--navy-accent); border-radius: var(--r-card); background: rgba(var(--navy-accent-rgb), .07); }
.pay-hero-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pay-hero-who strong { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.pay-hero-who span { font-size: 12.5px; color: var(--text-muted); }
.pay-hero-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-left: auto; }
.pay-hero-label { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); }
.pay-hero-no { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--navy-primary); }

/* their accounts, one card each — primary preselected, click again to fall back to cash */
.pay-accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; max-height: 320px; overflow-y: auto; padding: 2px; }
.pay-accts:empty { display: none; }
.sal-acct { position: relative; display: flex; flex-direction: column; gap: 7px; width: 100%; padding: 12px 34px 12px 12px; border: 1px solid var(--border-color); border-left: 5px solid var(--border-color); border-radius: var(--r-card); background: var(--bg-card); font-family: inherit; text-align: left; cursor: pointer; transition: box-shadow .15s, background .15s, border-color .15s; }
.sal-acct:hover { border-color: var(--navy-accent); }
.sal-acct.picked { border-color: var(--navy-accent); border-left-color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .08); box-shadow: inset 0 0 0 2px var(--navy-accent); }
.sal-acct-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sal-acct-bank { font-size: 13.5px; font-weight: 800; color: var(--navy-primary); }
.sal-acct-bank i { margin-right: 5px; color: var(--navy-accent-ink, var(--navy-accent)); }
.sal-acct-tick { position: absolute; top: 11px; right: 11px; font-size: 15px; color: var(--border-color); }
.sal-acct.picked .sal-acct-tick { color: var(--navy-accent); }
/* chips in a card, not a table cell — let a long IBAN wrap instead of widening the card */
.sal-acct .chip-row { min-width: 0; gap: 10px; white-space: normal; }
.sal-acct .chip-row .val { word-break: break-all; }

body.dark-mode .pay-hero { background: rgba(var(--navy-accent-rgb), .16); }
body.dark-mode .pay-hero-no,
body.dark-mode .sal-acct-bank { color: var(--text-primary); }
body.dark-mode .sal-acct.picked { background: rgba(var(--navy-accent-rgb), .22); }

/* ============ public website (index.php + page.php + book.php + feedback.php) ============ */
/* The guest-facing side runs its own system: UI 4 "Walnut & Sand" (docs/colors.md) on a warm bone
   canvas, a serif display face against Inter for everything functional, and a lot of air. It never
   inherits the admin theme — the shared tokens are remapped on the public body classes, so
   page.php / book.php / feedback.php retone with it for free.
   Accent #C49A6C carries hairlines, eyebrows and ornament only: white on sand is 2.3:1, so every
   button that holds text sits on Primary #4E3D32 instead. */
body.page-home, body.page-site, body.page-book, body.page-feedback {
    --lx-walnut: #4E3D32;
    --lx-taupe: #7B6855;
    --lx-bone: #FAF7F2;
    --lx-card: #FFFFFF;
    --lx-sand: #C49A6C;
    --lx-line: rgba(78, 61, 50, .16);
    --lx-line-soft: rgba(78, 61, 50, .09);
    --lx-wash: rgba(78, 61, 50, .04);
    --lx-lift: 0 1px 2px rgba(78, 61, 50, .05), 0 12px 32px rgba(78, 61, 50, .09);
    --lx-serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
    --lx-sans: Inter, -apple-system, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --lx-wrap: 1240px;
    --lx-gap: 112px;

    /* shared tokens, retoned so the other public pages follow without a single extra rule */
    --navy-primary: #4E3D32;
    --navy-dark: #4E3D32;
    --navy-light: #7B6855;
    --navy-accent: #C49A6C;
    --navy-hover: #7B6855;
    --navy-primary-rgb: 78, 61, 50;
    --navy-light-rgb: 123, 104, 85;
    --navy-accent-rgb: 196, 154, 108;
    --bg-primary: #FAF7F2;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-primary: #4E3D32;
    --text-secondary: #7B6855;
    --text-muted: #7B6855;
    --border-color: rgba(78, 61, 50, .16);
    --border-light: rgba(78, 61, 50, .09);
    --input-bg: #FFFFFF;
    --input-border: rgba(78, 61, 50, .22);
    --shadow-color: rgba(78, 61, 50, .08);
    --r-control: 3px;
    --r-card: 6px;

    background: var(--lx-bone);
    color: var(--lx-walnut);
    font-family: var(--lx-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
body.page-home h1, body.page-home h2, body.page-home h3,
body.page-site h1, body.page-site h2, body.page-site h3,
body.page-book h1, body.page-book h2, body.page-feedback h1, body.page-feedback h2 {
    font-family: var(--lx-serif); font-weight: 300; letter-spacing: 0; line-height: 1.12;
}
.page-home .btn-primary, .page-site .btn-primary, .page-book .btn-primary, .page-feedback .btn-primary { background: var(--lx-walnut); color: #fff; }
.page-home .btn-primary:hover, .page-site .btn-primary:hover, .page-book .btn-primary:hover, .page-feedback .btn-primary:hover { background: var(--lx-taupe); }
.page-home .btn, .page-site .btn, .page-book .btn, .page-feedback .btn { font-family: var(--lx-sans); font-weight: 500; }
.page-home .btn-outline, .page-book .btn-outline { background: transparent; border: 1px solid var(--lx-walnut); color: var(--lx-walnut); }
.page-home .btn-outline:hover, .page-book .btn-outline:hover { background: var(--lx-wash); }

.lx-wrap { max-width: var(--lx-wrap); margin: 0 auto; padding-left: 48px; padding-right: 48px; }
.lx-sec { padding-top: var(--lx-gap); }
.lx-band { background: var(--lx-card); padding-top: var(--lx-gap); padding-bottom: var(--lx-gap); margin-top: var(--lx-gap); }
.lx-band.lx-sec { padding-top: var(--lx-gap); }
/* the nav sits over the page, so an anchor jump has to stop short of it */
#stay, #offers, #events, #dining, #guestbook, #contact { scroll-margin-top: 104px; }
html { scroll-behavior: smooth; }

/* the eyebrow is the system's signature: a hairline number, then small letterspaced caps */
.lx-eyebrow { display: inline-flex; align-items: baseline; gap: 12px; font-family: var(--lx-sans);
              font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--lx-sand); }
.lx-eyebrow em { font-style: normal; font-weight: 500; color: var(--lx-taupe); opacity: .55; letter-spacing: .12em; }
.lx-head { margin-bottom: 48px; max-width: 760px; }
.lx-head h2 { font-size: clamp(30px, 3.6vw, 46px); margin-top: 18px; color: var(--lx-walnut); }
.lx-lede { font-size: 17px; line-height: 1.7; color: var(--lx-taupe); margin-top: 16px; max-width: 620px; }
.lx-none { font-size: 16px; color: var(--lx-taupe); padding: 24px 0; }

.lx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 16px 32px;
          border: 1px solid transparent; border-radius: 3px; cursor: pointer; text-decoration: none;
          font-family: var(--lx-sans); font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.lx-btn-solid { background: var(--lx-walnut); color: #fff; }
.lx-btn-solid:hover { background: var(--lx-taupe); }
.lx-btn-quiet { background: transparent; color: var(--lx-walnut); border-color: var(--lx-line); }
.lx-btn-quiet:hover { border-color: var(--lx-walnut); background: var(--lx-wash); }
.lx-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 36px; }

/* --- top nav: floats over the hero photograph, goes solid once it is scrolled past --- */
.site-nav { position: sticky; top: 0; z-index: 60; background: var(--lx-bone); border-bottom: 1px solid var(--lx-line-soft);
            transition: background .4s ease, border-color .4s ease, box-shadow .4s ease; }
.has-hero .site-nav { position: fixed; left: 0; right: 0; background: transparent; border-bottom-color: transparent; }
.has-hero .site-nav .site-brand, .has-hero .site-nav .nav-tab, .has-hero .site-nav .nav-globe,
.has-hero .site-nav .nav-tel, .has-hero .site-nav .nav-acctbtn, .has-hero .site-nav .site-burger { color: #fff; }
.has-hero .site-nav .nav-book { color: #fff; border-color: rgba(255, 255, 255, .55); }
.has-hero .site-nav .nav-book:hover { background: #fff; color: var(--lx-walnut); border-color: #fff; }
.has-hero .site-nav.scrolled { background: var(--lx-bone); border-bottom-color: var(--lx-line-soft); box-shadow: 0 1px 24px rgba(78, 61, 50, .07); }
.has-hero .site-nav.scrolled .site-brand, .has-hero .site-nav.scrolled .nav-tab, .has-hero .site-nav.scrolled .nav-globe,
.has-hero .site-nav.scrolled .nav-tel, .has-hero .site-nav.scrolled .nav-acctbtn, .has-hero .site-nav.scrolled .site-burger { color: var(--lx-walnut); }
.has-hero .site-nav.scrolled .nav-book { color: var(--lx-walnut); border-color: var(--lx-line); }
.has-hero .site-nav.scrolled .nav-book:hover { background: var(--lx-walnut); color: #fff; border-color: var(--lx-walnut); }

.nav-inner { max-width: 1440px; margin: 0 auto; height: 88px; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--lx-walnut);
              font-family: var(--lx-serif); font-size: 24px; font-weight: 400; letter-spacing: .02em; flex: 0 0 auto; max-width: 34%; }
.site-brand img { width: 34px; height: 34px; border-radius: 3px; object-fit: cover; }
.site-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-tabs { display: flex; align-items: center; gap: 34px; }
.nav-tab { text-decoration: none; color: var(--lx-walnut); font-size: 11px; font-weight: 600; letter-spacing: .18em;
           text-transform: uppercase; padding-bottom: 3px; border-bottom: 1px solid transparent; }
.nav-tab:hover { border-bottom-color: currentColor; }
.nav-right { display: flex; align-items: center; gap: 22px; flex: 0 0 auto; }
.nav-globe, .nav-tel { color: var(--lx-walnut); font-size: 11px; font-weight: 600; letter-spacing: .14em;
                       text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.nav-tel i { margin-right: 7px; font-size: 10px; }
.nav-book { display: inline-flex; align-items: center; padding: 12px 26px; border: 1px solid var(--lx-line); border-radius: 3px;
            text-decoration: none; color: var(--lx-walnut); font-size: 11px; font-weight: 600; letter-spacing: .18em;
            text-transform: uppercase; transition: background .25s, color .25s, border-color .25s; }
.nav-book:hover { background: var(--lx-walnut); color: #fff; border-color: var(--lx-walnut); }
.nav-acct { position: relative; }
.nav-acctbtn { border: 0; background: transparent; color: var(--lx-walnut); font-size: 17px; cursor: pointer; padding: 6px; }
.nav-menu { position: absolute; right: 0; top: calc(100% + 16px); min-width: 250px; background: var(--lx-card);
            border: 1px solid var(--lx-line-soft); border-radius: 4px; box-shadow: var(--lx-lift); padding: 10px 0; z-index: 70; }
.nav-menu a { display: flex; align-items: center; gap: 14px; padding: 12px 22px; text-decoration: none;
              color: var(--lx-walnut); font-size: 14px; }
.nav-menu a:hover { background: var(--lx-wash); }
.nav-menu a i { width: 16px; color: var(--lx-sand); font-size: 13px; }
.nav-menu-split { border-top: 1px solid var(--lx-line-soft); margin-top: 10px; padding-top: 16px !important; }

.site-burger { display: none; border: 0; background: transparent; color: var(--lx-walnut); font-size: 19px; cursor: pointer; padding: 8px; }
.site-links { display: none; flex-direction: column; padding: 8px 32px 28px; background: var(--lx-bone); border-top: 1px solid var(--lx-line-soft); }
.site-links.open { display: flex; }
.site-links a { padding: 16px 0; text-decoration: none; color: var(--lx-walnut); font-size: 12px; font-weight: 600;
                letter-spacing: .16em; text-transform: uppercase; border-bottom: 1px solid var(--lx-line-soft); }
.site-links a.lx-btn { justify-content: center; margin-top: 20px; border-bottom: 0; color: #fff; }

/* --- hero --- */
.lx-hero { position: relative; min-height: 92vh; display: flex; flex-direction: column; justify-content: flex-end;
           padding: 140px 48px 120px; background: var(--lx-walnut) center / cover no-repeat; color: #fff; overflow: hidden; }
.lx-hero::after { content: ""; position: absolute; inset: 0;
                  background: linear-gradient(to bottom, rgba(48, 37, 30, .62) 0%, rgba(78, 61, 50, .18) 34%, rgba(48, 37, 30, .82) 100%); }
.lx-hero-inner { position: relative; z-index: 2; max-width: var(--lx-wrap); width: 100%; margin: 0 auto; }
.lx-kicker { display: block; font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
             color: rgba(255, 255, 255, .82); margin-bottom: 26px; }
.lx-hero h1 { font-family: var(--lx-serif); font-size: clamp(46px, 7.2vw, 92px); font-weight: 300; line-height: 1.02;
              letter-spacing: -.01em; color: #fff; max-width: 15ch; }
.lx-hero-lede { font-size: 17px; line-height: 1.7; color: rgba(255, 255, 255, .88); max-width: 46ch; margin-top: 24px; }
.lx-hero-meta { display: flex; align-items: center; gap: 16px; margin-top: 30px; font-size: 12px; font-weight: 600;
                letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.lx-hero-meta i { color: var(--lx-sand); margin-right: 6px; }
.lx-hero-meta a { color: rgba(255, 255, 255, .88); text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .4); padding-bottom: 2px; }
.lx-hero-meta a:hover { color: #fff; border-bottom-color: #fff; }
.lx-sep { width: 28px; height: 1px; background: rgba(255, 255, 255, .45); }

/* --- reservation bar, overlapping the hero edge --- */
.lx-searchwrap { position: relative; z-index: 3; max-width: var(--lx-wrap); margin: -46px auto 0; padding: 0 48px; }
.lx-search { display: flex; align-items: stretch; background: var(--lx-card); border: 1px solid var(--lx-line-soft);
             border-radius: 4px; box-shadow: var(--lx-lift); }
.lx-seg { position: relative; flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; gap: 6px;
          padding: 20px 28px; border-left: 1px solid var(--lx-line-soft); min-width: 0; }
.lx-seg:first-child { border-left: 0; }
.lx-seg-where { flex: 1.4 1 0; }
.lx-seg label { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--lx-sand); }
.lx-seg input[type="date"] { border: 0; background: transparent; padding: 0; font-family: var(--lx-sans); font-size: 15px;
                             color: var(--lx-walnut); width: 100%; min-width: 0; }
.lx-seg input[type="date"]:focus { outline: none; }
.lx-static, .lx-picker { font-size: 15px; color: var(--lx-walnut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-picker { border: 0; background: transparent; padding: 0; font-family: var(--lx-sans); text-align: left; cursor: pointer; }
.lx-pop { position: absolute; left: 14px; top: calc(100% + 8px); min-width: 280px; background: var(--lx-card);
          border: 1px solid var(--lx-line-soft); border-radius: 4px; box-shadow: var(--lx-lift); padding: 8px 0; z-index: 40; }
.lx-pop-row { display: block; padding: 12px 22px; text-decoration: none; color: var(--lx-walnut); }
.lx-pop-row:hover, .lx-pop-row.is-on { background: var(--lx-wash); }
.lx-pop-row strong { display: block; font-size: 14px; font-weight: 600; }
.lx-pop-row em { font-size: 13px; font-style: normal; color: var(--lx-taupe); }
.lx-step { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--lx-walnut); }
.lx-step-btn { width: 26px; height: 26px; flex: 0 0 26px; display: inline-flex; align-items: center; justify-content: center;
               border: 1px solid var(--lx-line); background: transparent; color: var(--lx-taupe); border-radius: 50%; cursor: pointer; font-size: 9px; }
.lx-step-btn:hover { border-color: var(--lx-walnut); color: var(--lx-walnut); }
.lx-go { flex: 0 0 auto; margin: 10px; padding: 0 34px; border: 0; border-radius: 3px; cursor: pointer;
         background: var(--lx-walnut); color: #fff; font-family: var(--lx-sans); font-size: 11px; font-weight: 600;
         letter-spacing: .18em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; }
.lx-go:hover { background: var(--lx-taupe); }

/* --- the house --- */
.lx-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; padding-top: var(--lx-gap); }
.lx-intro-copy h2 { font-size: clamp(30px, 3.4vw, 44px); margin: 20px 0 22px; color: var(--lx-walnut); }
.lx-intro-copy p { color: var(--lx-taupe); max-width: 48ch; }
.lx-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 36px; border-top: 1px solid var(--lx-line-soft); }
.lx-facts > div { padding: 18px 0; border-bottom: 1px solid var(--lx-line-soft); }
.lx-facts > div:nth-child(odd) { padding-right: 24px; }
.lx-facts dt { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--lx-sand); }
.lx-facts dd { font-family: var(--lx-serif); font-size: 26px; color: var(--lx-walnut); margin-top: 4px; }
.lx-intro-plate { aspect-ratio: 4 / 5; border-radius: 6px; background: var(--lx-wash) center / cover no-repeat; margin: 0; }

/* --- rating --- */
.lx-rate { display: flex; align-items: center; justify-content: center; gap: 40px; }
.lx-rule { flex: 1 1 0; max-width: 220px; height: 1px; background: var(--lx-sand); opacity: .55; }
.lx-rate-face { text-align: center; }
.lx-rate-face strong { display: block; font-family: var(--lx-serif); font-size: clamp(64px, 9vw, 112px); font-weight: 300;
                       line-height: 1; color: var(--lx-walnut); }
.lx-rate-of { display: block; margin-top: 10px; font-size: 10px; font-weight: 600; letter-spacing: .26em;
              text-transform: uppercase; color: var(--lx-sand); }
.lx-rate-sub { text-align: center; margin-top: 22px; color: var(--lx-taupe); font-size: 15px; }
.lx-rate-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 56px; }
.lx-stat { text-align: center; padding: 6px 12px; border-left: 1px solid var(--lx-line-soft); }
.lx-stat:first-child { border-left: 0; }
.lx-stat strong { display: block; font-family: var(--lx-serif); font-size: 34px; font-weight: 400; color: var(--lx-walnut); }
.lx-stat span { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--lx-taupe); }

/* --- category strip --- */
.lx-cats { display: flex; flex-wrap: wrap; gap: 10px; margin: -20px 0 44px; }
.lx-cat { padding: 11px 20px; border: 1px solid var(--lx-line); border-radius: 999px; background: transparent; cursor: pointer;
          font-family: var(--lx-sans); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
          color: var(--lx-taupe); white-space: nowrap; transition: background .25s, color .25s, border-color .25s; }
.lx-cat i { margin-right: 7px; color: var(--lx-sand); }
.lx-cat:hover { border-color: var(--lx-walnut); color: var(--lx-walnut); }
.lx-cat.is-on { background: var(--lx-walnut); border-color: var(--lx-walnut); color: #fff; }
.lx-cat.is-on i { color: var(--lx-sand); }

/* --- room cards: tall plate, serif name, hairline rule, nothing boxed --- */
.lx-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 56px 32px; }
.lx-room { position: relative; display: flex; flex-direction: column; }
.lx-room-plate { display: block; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden;
                 background: var(--lx-wash) center / cover no-repeat; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.lx-room-plate.is-empty { display: flex; align-items: center; justify-content: center;
                          background: linear-gradient(150deg, var(--lx-taupe), var(--lx-walnut)); color: rgba(255, 255, 255, .5); font-size: 40px; }
.lx-room:hover .lx-room-plate { transform: scale(1.015); }
.lx-tag { position: absolute; left: 16px; top: 16px; padding: 7px 14px; background: var(--lx-card); color: var(--lx-walnut);
          font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; border-radius: 2px; }
.lx-heart { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; display: flex; align-items: center;
            justify-content: center; border: 0; background: transparent; cursor: pointer; font-size: 17px; color: #fff;
            text-shadow: 0 1px 6px rgba(48, 37, 30, .5); }
.lx-heart.is-on i { font-weight: 900; color: var(--lx-sand); text-shadow: 0 1px 6px rgba(48, 37, 30, .35); }
.lx-room-body { padding-top: 22px; }
.lx-room-body h3 { font-family: var(--lx-serif); font-size: 26px; font-weight: 400; }
.lx-room-body h3 a { color: var(--lx-walnut); text-decoration: none; }
.lx-room-body h3 a:hover { color: var(--lx-taupe); }
.lx-room-line { font-size: 14px; color: var(--lx-taupe); margin-top: 6px; }
.lx-room-amen { font-size: 13px; color: var(--lx-taupe); opacity: .8; margin-top: 4px; }
.lx-room-rate { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--lx-line-soft);
                font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lx-taupe); }
.lx-room-rate strong { font-family: var(--lx-serif); font-size: 26px; font-weight: 500; letter-spacing: 0;
                       text-transform: none; color: var(--lx-walnut); margin: 0 6px; }
.lx-room-go { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; text-decoration: none;
              font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--lx-walnut); }
.lx-room-go i { font-size: 10px; color: var(--lx-sand); transition: transform .3s; }
.lx-room-go:hover i { transform: translateX(5px); }

/* --- offers --- */
.lx-amens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 72px; }
.lx-amen { display: flex; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--lx-line-soft);
           font-size: 16px; color: var(--lx-walnut); }
.lx-amen i { width: 22px; text-align: center; font-size: 15px; color: var(--lx-sand); }

/* --- halls --- */
.lx-halls { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--lx-line-soft); }
.lx-hall { padding: 40px 36px 40px 0; border-bottom: 1px solid var(--lx-line-soft); border-right: 1px solid var(--lx-line-soft); }
.lx-hall:last-child { border-right: 0; }
.lx-halls .lx-hall + .lx-hall { padding-left: 36px; }
.lx-hall h3 { font-family: var(--lx-serif); font-size: 28px; font-weight: 400; color: var(--lx-walnut); }
.lx-hall-cap { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--lx-sand); margin-top: 10px; }
.lx-hall-am { font-size: 14px; color: var(--lx-taupe); margin-top: 14px; }
.lx-hall-rate { margin-top: 18px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lx-taupe); }
.lx-hall-rate strong { font-family: var(--lx-serif); font-size: 24px; font-weight: 500; letter-spacing: 0;
                       text-transform: none; color: var(--lx-walnut); margin-right: 8px; }

/* --- the table: a printed menu, leader dots and all --- */
.lx-dine { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 72px; }
.lx-dish { display: flex; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--lx-line-soft); }
.lx-dish-pic { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 4px; background: var(--lx-wash) center / cover no-repeat;
               display: flex; align-items: center; justify-content: center; color: var(--lx-sand); font-size: 14px; }
.lx-dish-name { font-size: 16px; color: var(--lx-walnut); white-space: nowrap; }
.lx-dish-dots { flex: 1 1 auto; height: 1px; min-width: 20px; border-bottom: 1px dotted var(--lx-line); }
.lx-dish-price { font-family: var(--lx-serif); font-size: 20px; color: var(--lx-walnut); white-space: nowrap; }
.lx-dish-price em { font-family: var(--lx-sans); font-style: normal; font-size: 11px; letter-spacing: .1em;
                    text-transform: uppercase; color: var(--lx-taupe); margin-left: 6px; }

/* --- guest book --- */
.lx-revs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 72px; }
.lx-rev { margin: 0; }
.lx-rev-stars { font-size: 11px; letter-spacing: 3px; color: var(--lx-sand); }
.lx-rev blockquote { margin: 18px 0 0; font-family: var(--lx-serif); font-size: 23px; font-weight: 300; line-height: 1.45; color: var(--lx-walnut); }
.lx-rev blockquote::before { content: "\201C"; }
.lx-rev blockquote::after { content: "\201D"; }
.lx-rev figcaption { margin-top: 20px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--lx-walnut); }
.lx-rev figcaption em { display: block; font-style: normal; font-weight: 500; letter-spacing: .12em; color: var(--lx-taupe); opacity: .75; margin-top: 6px; }

/* --- visit --- */
.lx-places { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 40px; }
.lx-place h3 { font-family: var(--lx-serif); font-size: 24px; font-weight: 400; color: var(--lx-walnut); }
.lx-place p { font-size: 15px; color: var(--lx-taupe); margin-top: 8px; }
.lx-place a { display: block; font-size: 14px; color: var(--lx-walnut); text-decoration: none; margin-top: 6px; }
.lx-place a:hover { color: var(--lx-sand); }
.lx-place a i { width: 16px; color: var(--lx-sand); font-size: 11px; margin-right: 6px; }

/* --- footer: the one dark surface on the site --- */
.site-footer { margin-top: var(--lx-gap); background: var(--lx-walnut); color: rgba(255, 255, 255, .72); }
.site-footer-grid { max-width: var(--lx-wrap); margin: 0 auto; padding: 88px 48px 56px; display: grid;
                    grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; }
.lx-mark { display: block; font-family: var(--lx-serif); font-size: 30px; font-weight: 400; color: #fff; margin-bottom: 20px; }
.site-footer-col h5 { font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
                      color: var(--lx-sand); margin-bottom: 20px; }
.site-footer-col a, .site-footer-col p, .site-footer-col .site-cur { display: block; font-size: 14px; line-height: 1.6;
                      color: rgba(255, 255, 255, .72); text-decoration: none; padding: 5px 0; }
.site-footer-col a:hover { color: #fff; }
.site-footer-col a i { width: 16px; color: var(--lx-sand); font-size: 11px; margin-right: 8px; }
.site-footer-brand p { max-width: 34ch; }
.site-cur { opacity: .6; margin-top: 10px; }
.site-bottom { max-width: var(--lx-wrap); margin: 0 auto; padding: 26px 48px 40px; border-top: 1px solid rgba(255, 255, 255, .14);
               display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
               font-size: 12px; color: rgba(255, 255, 255, .55); }
.site-credit a { color: rgba(255, 255, 255, .9); text-decoration: none; border-bottom: 1px solid var(--lx-sand); }

.site-totop { position: fixed; right: 26px; bottom: 26px; z-index: 60; width: 46px; height: 46px; cursor: pointer;
              border: 1px solid var(--lx-line); border-radius: 50%; background: var(--lx-card); color: var(--lx-walnut);
              font-size: 14px; box-shadow: var(--lx-lift); }
.site-totop:hover { background: var(--lx-walnut); color: #fff; border-color: var(--lx-walnut); }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* --- shared section shell, still used by page.php / book.php / feedback.php --- */
.hm-section { padding: 72px 48px; max-width: var(--lx-wrap); margin: 0 auto; }
.hm-head { margin-bottom: 36px; }
.hm-head-kicker { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--lx-sand); }
.hm-head h2 { font-family: var(--lx-serif); font-size: clamp(28px, 3.2vw, 40px); font-weight: 300; color: var(--lx-walnut); margin: 14px 0 8px; }
.hm-sub { color: var(--lx-taupe); font-size: 16px; }
.hm-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .18em;
             text-transform: uppercase; color: var(--lx-sand); }
.hm-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hm-book { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr .7fr auto; gap: 0;
           align-items: stretch; background: var(--lx-card); border: 1px solid var(--lx-line-soft); border-radius: 4px;
           padding: 0; box-shadow: var(--lx-lift); }
.hm-book-field { padding: 18px 26px; border-left: 1px solid var(--lx-line-soft); }
.hm-book-field:first-child { border-left: 0; }
.hm-book-field label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
                       color: var(--lx-sand); margin-bottom: 8px; }
.hm-book-field label i { display: none; }
.hm-book-field input { width: 100%; padding: 0; font-size: 15px; font-family: var(--lx-sans); color: var(--lx-walnut);
                       background: transparent; border: 0; }
.hm-book-field input:focus { outline: none; }
.hm-book-go { margin: 10px; border-radius: 3px; white-space: nowrap; }
.hm-room-rate { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lx-taupe); }
.hm-room-rate strong { font-family: var(--lx-serif); font-size: 24px; font-weight: 500; letter-spacing: 0;
                       text-transform: none; color: var(--lx-walnut); }
.hm-room-amen { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-room-amen span { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--lx-taupe);
                     border: 1px solid var(--lx-line-soft); padding: 6px 12px; border-radius: 999px; }
.hm-room-amen i { display: none; }
.hm-branches { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 40px; }
.hm-branch { padding: 0; background: transparent; border: 0; border-top: 1px solid var(--lx-line); padding-top: 24px; }
.hm-branch h4 { font-family: var(--lx-serif); font-size: 24px; font-weight: 400; color: var(--lx-walnut); margin-bottom: 12px; }
.hm-branch p { font-size: 14px; color: var(--lx-taupe); margin: 6px 0; }
.hm-branch i { width: 18px; color: var(--lx-sand); font-size: 11px; }
.hm-branch a { color: var(--lx-walnut); text-decoration: none; }
.hm-branch a:hover { color: var(--lx-sand); }

/* --- composed pages (page.php) --- */
.pg-hero { background: var(--lx-card); color: var(--lx-walnut); padding: 72px 48px 40px; border-bottom: 1px solid var(--lx-line-soft); }
.pg-hero-inner { max-width: var(--lx-wrap); margin: 0 auto; }
.pg-hero h1 { font-family: var(--lx-serif); font-size: clamp(34px, 4.4vw, 56px); font-weight: 300; margin: 16px 0 6px; }
.pg-crumb { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--lx-sand);
            display: flex; align-items: center; gap: 10px; }
.pg-crumb a { color: var(--lx-sand); text-decoration: none; }
.pg-crumb a:hover { color: var(--lx-walnut); }
.pg-crumb > i { font-size: 8px; }
.pg-draft { max-width: var(--lx-wrap); margin: 20px auto -24px; padding: 14px 20px; font-size: 14px;
            color: var(--lx-walnut); background: var(--lx-wash); border: 1px solid var(--lx-line); border-radius: 4px; }
.pg-draft i { margin-right: 8px; color: var(--lx-sand); }
.pg-body { max-width: 780px; }
.pg-missing { text-align: center; padding: 48px 0 72px; }
.pg-missing i { font-size: 44px; color: var(--lx-sand); margin-bottom: 20px; }
.pg-missing h2 { font-family: var(--lx-serif); font-size: 32px; font-weight: 300; color: var(--lx-walnut); margin-bottom: 10px; }
.pg-missing p { color: var(--lx-taupe); margin-bottom: 28px; }
.pg-contact-cards { margin-top: 40px; }
.pg-contact-cta { margin-top: 28px; }

/* rendered article typography */
.prose { font-size: 17px; line-height: 1.75; color: var(--lx-taupe); }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--lx-serif); font-weight: 400; color: var(--lx-walnut); margin: 40px 0 14px; line-height: 1.2; }
.prose h1 { font-size: 38px; }
.prose h2 { font-size: 32px; }
.prose h3 { font-size: 26px; }
.prose h4 { font-size: 21px; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin: 8px 0; }
.prose a { color: var(--lx-walnut); text-decoration: none; border-bottom: 1px solid var(--lx-sand); }
.prose hr { border: 0; border-top: 1px solid var(--lx-line-soft); margin: 40px 0; }
.prose blockquote { margin: 26px 0; padding: 4px 0 4px 26px; border-left: 1px solid var(--lx-sand);
                    font-family: var(--lx-serif); font-size: 22px; font-style: italic; color: var(--lx-walnut); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--lx-line-soft); padding: 14px 12px; text-align: left; }
.prose th { color: var(--lx-walnut); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }

/* --- responsive: columns drop, rows never reflow --- */
@media (max-width: 1128px) {
    body.page-home, body.page-site, body.page-book, body.page-feedback { --lx-gap: 88px; }
    .lx-wrap, .hm-section, .lx-searchwrap, .site-footer-grid, .site-bottom, .nav-inner, .pg-hero { padding-left: 32px; padding-right: 32px; }
    .lx-hero { padding-left: 32px; padding-right: 32px; }
    .nav-tabs { gap: 24px; }
    .nav-tel { display: none; }
    .site-footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
    .site-footer-col:last-child { grid-column: span 3; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 28px; }
}
@media (max-width: 960px) {
    .lx-intro { grid-template-columns: 1fr; gap: 48px; }
    .lx-intro-plate { aspect-ratio: 16 / 10; order: -1; }
    .lx-search { flex-wrap: wrap; }
    .lx-seg { flex: 1 1 42%; }
    .lx-seg:nth-child(3) { border-left: 0; }
    .lx-go { flex: 1 1 100%; margin: 0 10px 10px; min-height: 52px; justify-content: center; }
    .hm-book { grid-template-columns: 1fr 1fr; }
    .hm-book-go { grid-column: 1 / -1; }
}
@media (max-width: 744px) {
    body.page-home, body.page-site, body.page-book, body.page-feedback { --lx-gap: 68px; }
    .site-burger { display: block; }
    .nav-tabs, .nav-right { display: none; }
    .nav-inner { height: 70px; }
    .site-brand { max-width: calc(100% - 60px); font-size: 20px; }
    .lx-hero { min-height: 82vh; padding-top: 110px; padding-bottom: 88px; }
    .lx-searchwrap { margin-top: -30px; }
    .lx-seg { flex: 1 1 100%; border-left: 0; border-top: 1px solid var(--lx-line-soft); }
    .lx-seg:first-child { border-top: 0; }
    .lx-rate { gap: 20px; }
    .lx-rule { max-width: 60px; }
    .lx-rate-stats { grid-template-columns: 1fr 1fr; gap: 28px 0; }
    .lx-stat:nth-child(odd) { border-left: 0; }
    .lx-amens, .lx-dine, .lx-revs, .lx-facts { grid-template-columns: 1fr; }
    .lx-halls { grid-template-columns: 1fr; }
    .lx-hall { padding: 32px 0; border-right: 0; }
    .lx-halls .lx-hall + .lx-hall { padding-left: 0; }
    .site-footer-grid { grid-template-columns: 1fr; gap: 36px; padding-top: 64px; }
    .site-footer-col:last-child { grid-column: auto; border-top: 0; padding-top: 0; }
    .site-bottom { flex-direction: column; }
}
@media (max-width: 540px) {
    .lx-rooms { grid-template-columns: 1fr; gap: 48px; }
    .hm-book { grid-template-columns: 1fr; }
    .lx-wrap, .hm-section, .lx-searchwrap, .site-footer-grid, .site-bottom, .nav-inner, .pg-hero, .lx-hero { padding-left: 22px; padding-right: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .lx-room:hover .lx-room-plate { transform: none; }
}

/* ============ Website Pages composer (site_pages.php) ============ */
.sp-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; margin-top: 14px; }
.sp-list { display: flex; flex-direction: column; gap: 8px; }
.sp-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 12px 13px; cursor: pointer;
           background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--r-card); transition: border-color .2s, background .2s; }
.sp-item:hover { border-color: var(--navy-accent); }
.sp-item.active { background: rgba(var(--navy-accent-rgb), .10); border-color: var(--navy-accent); }
.sp-item > i { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px;
               font-size: 14px; color: var(--navy-primary); background: rgba(var(--navy-accent-rgb), .12); border-radius: var(--r-control); }
.sp-item-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sp-item-txt strong { font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-item-txt small { font-size: 12px; color: var(--text-muted); }
.sp-item-pills { display: flex; gap: 4px; }
.sp-pill { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-control); }
.sp-pill-draft { color: #9b5915; background: rgba(217, 119, 6, .14); }
.sp-pill-nav { color: #1b7a43; background: rgba(22, 163, 74, .13); }
.sp-editor { border: 1px solid var(--border-color); border-radius: var(--r-card); padding: 20px; background: var(--bg-primary); }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.sp-flags { display: flex; gap: 26px; flex-wrap: wrap; margin: 4px 0 18px; }
.sp-flags .toggle-row { margin: 0; }
.sp-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px; background: var(--bg-card);
              border: 1px solid var(--input-border, var(--border-color)); border-bottom: 0; border-radius: var(--r-control) var(--r-control) 0 0; }
.sp-toolbar button { width: 34px; height: 32px; border: 1px solid transparent; background: transparent; color: var(--text-secondary);
                     font-size: 13px; cursor: pointer; border-radius: var(--r-control); }
.sp-toolbar button:hover { background: var(--bg-primary); color: var(--navy-primary); border-color: var(--border-color); }
.sp-toolbar button.on { background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-primary); border-color: var(--navy-accent); }
.sp-bar-sep { width: 1px; height: 20px; background: var(--border-color); margin: 0 4px; }
.sp-canvas { min-height: 340px; max-height: 60vh; overflow-y: auto; padding: 16px 18px; background: var(--input-bg, var(--bg-card));
             border: 1px solid var(--input-border, var(--border-color)); border-radius: 0 0 var(--r-control) var(--r-control);
             font-size: 15px; line-height: 1.7; }
.sp-canvas:focus { outline: none; border-color: var(--navy-accent); }
.sp-canvas h1, .sp-canvas h2, .sp-canvas h3, .sp-canvas h4 { color: var(--navy-primary); margin: 18px 0 8px; font-family: Georgia, 'Times New Roman', serif; }
.sp-canvas h2 { font-size: 22px; }
.sp-canvas h3 { font-size: 18px; }
.sp-canvas p { margin: 0 0 10px; }
.sp-canvas ul, .sp-canvas ol { margin: 0 0 12px; padding-left: 24px; }
.sp-canvas a { color: var(--navy-accent-ink, var(--navy-accent)); }
.sp-source { width: 100%; font-family: Consolas, Menlo, monospace; font-size: 13px; line-height: 1.55;
             border-radius: 0 0 var(--r-control) var(--r-control); }
.sp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.sp-actions .btn[hidden], .sp-editor[hidden], .sp-empty[hidden], .sp-source[hidden], .sp-canvas[hidden] { display: none !important; } /* .btn's display would defeat [hidden] */
.sp-del { margin-left: auto; }
.sp-empty { text-align: center; color: var(--text-muted); padding: 60px 20px; }
.sp-empty i { font-size: 44px; color: var(--navy-accent-ink, var(--navy-accent)); display: block; margin-bottom: 12px; }
body.dark-mode .sp-item-txt strong { color: var(--text-primary) !important; }
body.dark-mode .sp-canvas { color: var(--text-primary) !important; }
body.dark-mode .sp-canvas h1, body.dark-mode .sp-canvas h2, body.dark-mode .sp-canvas h3, body.dark-mode .sp-canvas h4 { color: var(--text-primary) !important; }
@media (max-width: 900px) {
    .sp-wrap { grid-template-columns: 1fr; }
    .sp-grid { grid-template-columns: 1fr; }
}

/* ============ schema drift banner ============ */
/* the live DB is behind the code — one actionable strip, never a silent broken page */
.schema-warn { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding: 13px 16px; border: 1px solid var(--warning, #f0ad4e); border-left: 4px solid var(--warning, #f0ad4e); border-radius: var(--r-card); background: color-mix(in srgb, var(--warning, #f0ad4e) 12%, var(--bg-card)); color: var(--text-primary); font-size: 13px; line-height: 1.55; }
.schema-warn > i { margin-top: 2px; font-size: 16px; color: var(--warning, #f0ad4e); }
.schema-warn code { padding: 1px 6px; border-radius: var(--r-control); background: color-mix(in srgb, var(--text-primary) 10%, transparent); font-size: 12px; }
.schema-warn a { font-weight: 700; color: var(--navy-accent); text-decoration: underline; }

/* ============ duty shift pair ============ */
.shift-pair { display: flex; align-items: center; gap: 8px; }
.shift-pair input[type="time"] { flex: 1 1 0; min-width: 0; }
.shift-pair span { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ============ room photos ============ */
/* the tile's photo band is its own hit target — click it to enlarge, click the rest for 360 */
.room-tile.has-img { padding-top: 0; overflow: hidden; }
.room-tile-img { position: relative; display: block; width: calc(100% + 27px); height: 74px; margin: 0 -13px 8px -14px; background-position: center; background-size: cover; background-repeat: no-repeat; cursor: zoom-in; }
.room-tile-img i { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-control); background: rgba(0,0,0,.55); color: #fff; font-size: 10px; }
.room-tile-img:hover i { background: var(--navy-accent); }

.chip-view-btn { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid var(--border-color); border-radius: var(--r-control); background: var(--bg-card); color: var(--navy-accent); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.chip-view-btn:hover { border-color: var(--navy-accent); background: color-mix(in srgb, var(--navy-accent) 10%, var(--bg-card)); }

.room-photo-now { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.room-photo-now img { width: 132px; height: 92px; object-fit: cover; border: 1px solid var(--border-color); border-radius: var(--r-card); }
.room-photo-now .toggle-row { gap: 10px; font-size: 12.5px; color: var(--text-secondary); }

.r360-photo { position: relative; padding: 0; overflow: hidden; border: 1px solid var(--border-color); border-radius: var(--r-card); }
.r360-photo img { display: block; width: 100%; max-height: 190px; object-fit: cover; cursor: zoom-in; }
.r360-photo-hint { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-control); background: rgba(0,0,0,.58); color: #fff; font-size: 11px; font-weight: 600; pointer-events: none; }

/* the room's own amount on the movement table reads at a glance */
.move-amt { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-primary); }

/* a room type with a photo shows it on the public card; the icon stays the fallback */
.hm-room-banner.has-img { background-position: center; background-size: cover; background-repeat: no-repeat; }
.hm-room-banner.has-img > i { display: none; }
.hm-room-banner.has-img .hm-room-occ { background: rgba(0,0,0,.55); color: #fff; }

/* ============================================
   Public booking page (book.php) — live availability, then a request. No payment.
   ============================================ */
.pg-wrap { padding-top: 44px; }

.bk-card { max-width: 1000px; margin: 0 auto 22px; padding: 22px; background: var(--bg-card);
           border: 1px solid var(--border-color); border-radius: var(--r-card); box-shadow: 0 10px 30px rgba(0,0,0,.07); }
.bk-title { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font-size: 18px; color: var(--navy-primary); }
.bk-fields { display: grid; grid-template-columns: 1fr 1fr .7fr .7fr auto; gap: 14px; align-items: end; }

.bk-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; margin-top: 22px; }
.bk-type { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-card);
           border: 1px solid var(--border-color); border-radius: var(--r-card); transition: transform .18s, box-shadow .18s; }
.bk-type:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.10); }
.bk-type-full { opacity: .62; }
.bk-type-full:hover { transform: none; box-shadow: none; }
.bk-type-banner { display: flex; align-items: center; justify-content: center; height: 128px;
                  background: var(--navy-primary); color: #fff; font-size: 34px; }
.bk-type-banner.has-img { background-position: center; background-size: cover; background-repeat: no-repeat; }
.bk-type-banner.has-img > i { display: none; }
.bk-type-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 16px; }
.bk-type-body h4 { margin: 0; font-size: 17px; color: var(--navy-primary); }
.bk-type-body .btn { margin-top: auto; }
.bk-type-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-muted); }
.bk-type-meta i { margin-right: 4px; }

.bk-avail { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: #1e7e34; }
.bk-avail em { font-style: normal; font-weight: 500; color: var(--text-muted); }
.bk-avail.bk-full { color: #c62828; }

.bk-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding: 11px 14px;
           border-left: 3px solid var(--navy-accent); border-radius: var(--r-control); font-size: 14px;
           background: color-mix(in srgb, var(--navy-accent) 8%, var(--bg-card)); color: var(--text-primary); }

.bk-done { max-width: 620px; text-align: center; }
.bk-done > i { font-size: 52px; color: #1e7e34; }
.bk-done h3 { margin: 14px 0 8px; color: var(--navy-primary); }
.bk-done p { margin-bottom: 18px; color: var(--text-secondary); }
.bk-done .btn { margin: 0 5px; }

/* honeypot: off-screen, never display:none — a bot fills what it can reach, a person never sees it */
.bk-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 820px) {
    .bk-fields { grid-template-columns: 1fr 1fr; }
    .bk-fields .hm-book-go { grid-column: 1 / -1; }
}


/* a searchable dropdown inside a dialog must not be clipped by the scrolling html container */
.swal-has-sd .swal2-html-container { overflow: visible; }
.swal-sd { margin: 6px 2px 2px; text-align: left; }

/* ==========================================================================
   2026-09 feature wave — tape chart, POS, shift close, registration card,
   public booking, feedback, guest messaging, reviews, channels, inventory.
   Tokens only; nothing here invents a colour.
   ========================================================================== */

/* ---- shared small bits ---- */
.section-note { font-size: 13px; color: var(--text-muted); }
.rs-subhead { margin: 18px 0 10px; font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.rv-crown { color: #b8860b; }
.guest-vip-note { margin-top: 6px; font-size: 13px; color: #b8860b; display: flex; align-items: center; gap: 6px; }
.rv-stars { color: #f0ad4e; letter-spacing: 2px; }
.rv-comment { color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.ch-url { font-family: monospace; font-size: 12px; word-break: break-all; color: var(--text-secondary); }
.ip-display { font-family: monospace; font-size: 12px; cursor: pointer; }
.row-toggle { cursor: pointer; }
.pu-line { border: 1px solid var(--border-light); border-radius: var(--r-card); padding: 10px; margin-bottom: 10px; background: var(--bg-primary); }

/* ---- tape chart: rooms down, dates across ----
   One grid. Column 1 is the room label, columns 2..n+1 are the days. Every item carries an
   explicit grid-row from the JS, because the stay bars are SIBLINGS of the day cells, not
   children of them — and CSS grid will not overlap two auto-placed items, it pushes the
   second onto a row of its own. That is also why the bar is a plain grid item here and not
   absolutely positioned: it has no positioned cell to hang off. */
.tc-host { overflow: auto; max-height: 72vh; padding-bottom: 6px; }
.tc-grid { display: grid; grid-template-columns: 150px repeat(var(--tc-cols), minmax(56px, 1fr)); min-width: 100%; }

/* header row — sticky against the host's own scroll box, both axes at the corner */
.tc-corner,
.tc-head {
    position: sticky; top: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: var(--navy-primary); color: #fff;
    font-size: 11px; font-weight: 700; text-align: center;
    padding: 7px 4px; border-right: 1px solid rgba(255, 255, 255, .12);
}
.tc-corner { left: 0; z-index: 4; flex-direction: row; gap: 7px; justify-content: flex-start; padding-left: 12px; }
.tc-head strong { font-size: 15px; line-height: 1.1; }
.tc-head small  { font-weight: 400; opacity: .75; }
.tc-head.weekend { background: var(--navy-light); }
.tc-head.today   { background: var(--warning); color: #3a2f00; }
.tc-head.today small { opacity: .9; }

/* room label column — sticky sideways so it survives a long date window */
.tc-room {
    position: sticky; left: 0; z-index: 1;
    display: flex; flex-direction: column; justify-content: center; gap: 2px;
    background: var(--bg-card);
    border-right: 2px solid var(--border-color); border-bottom: 1px solid var(--border-light);
    border-left: 4px solid var(--st, transparent);
    padding: 7px 12px;
}
.tc-room-no { font-weight: 800; font-size: 14px; color: var(--text-primary); line-height: 1.1; }
.tc-room small { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-room-un { border-left-color: var(--warning); }

/* a room-type separator spans the whole width */
.tc-type {
    display: flex; align-items: center; gap: 8px;
    position: sticky; left: 0;
    padding: 6px 12px; background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color); border-top: 1px solid var(--border-color);
    font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
    color: var(--text-secondary);
}

/* one cell per room per night. free cells are the booking hit-area. */
.tc-cell { border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); min-height: 44px; }
.tc-cell.weekend { background: rgba(var(--navy-primary-rgb), .035); }
.tc-cell.today   { box-shadow: inset 2px 0 0 var(--warning); }
.tc-cell.free    { cursor: pointer; }
.tc-cell.free:hover { background: rgba(var(--navy-accent-rgb), .12); box-shadow: inset 0 0 0 1px var(--navy-accent); }

/* the stay bar: a grid item spanning its nights, painted over the cells it covers because it
   comes after them in DOM order */
.tc-bar {
    position: relative; z-index: 1; min-width: 0;
    margin: 4px 2px; padding: 3px 7px;
    border-radius: var(--r-control);
    background: var(--st, var(--navy-light)); color: #fff;
    overflow: hidden; cursor: pointer;
    display: flex; flex-direction: column; justify-content: center;
}
.tc-bar:hover { filter: brightness(1.08); }
/* a stay that runs past the edge of the window is squared off on that side, so nobody reads
   a clipped bar as a stay that really starts or ends there */
.tc-bar.clip-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 3px dashed rgba(255, 255, 255, .7); }
.tc-bar.clip-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 3px dashed rgba(255, 255, 255, .7); }
.tc-bar-name { font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-bar-meta { font-size: 10px; color: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-bar-meta i { margin-right: 3px; }
.tc-bar-ooo { background: repeating-linear-gradient(45deg, var(--text-muted), var(--text-muted) 6px, transparent 6px, transparent 12px); cursor: default; }
.tc-bar-ooo:hover { filter: none; }

/* occupancy footer, one cell per day, sticky to the bottom of the scroll box */
.tc-foot {
    position: sticky; bottom: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: var(--bg-primary); border-top: 2px solid var(--border-color);
    border-right: 1px solid var(--border-light);
    padding: 6px 4px; font-size: 10px; color: var(--text-muted);
}
.tc-foot strong { font-size: 13px; color: var(--text-primary); }
.tc-foot.tc-corner { left: 0; z-index: 4; flex-direction: row; gap: 7px; justify-content: flex-start; padding-left: 12px;
                     background: var(--bg-primary); color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.tc-foot.today { box-shadow: inset 2px 0 0 var(--warning); }

/* legend in the section header */
.tc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--text-secondary); }
.tc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tc-swatch { width: 13px; height: 13px; border-radius: var(--r-control); background: var(--navy-light); display: inline-block; flex-shrink: 0; }
.tc-swatch-ooo { background: repeating-linear-gradient(45deg, var(--text-muted), var(--text-muted) 4px, transparent 4px, transparent 8px); }

@media (max-width: 768px) {
    .tc-grid { grid-template-columns: 104px repeat(var(--tc-cols), minmax(46px, 1fr)); }
    .tc-host { max-height: 65vh; }
    .tc-room { padding: 6px 8px; }
    .tc-room-no { font-size: 13px; }
}

/* ---- POS: menu left, ticket right ---- */
.pos-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.pos-menu { min-width: 0; }
.pos-menu-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pos-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pos-cat { padding: 7px 14px; border: 1px solid var(--border-color); border-radius: var(--r-control); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 600; }
.pos-cat:hover { background: var(--table-hover); }
.pos-cat.active { background: var(--navy-primary); border-color: var(--navy-primary); color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border-color); border-top: 4px solid var(--navy-light); border-radius: var(--r-card); background: var(--bg-card); cursor: pointer; text-align: left; }
.pos-item:hover { background: var(--table-hover); border-color: var(--navy-light); }
.pos-item-name { font-weight: 700; color: var(--text-primary); font-size: 13px; line-height: 1.3; }
.pos-item-price { font-weight: 800; color: var(--navy-primary); font-size: 14px; }
.pos-ticket { position: sticky; top: 12px; }
.pos-ticket-no { font-family: monospace; font-size: 13px; color: var(--text-muted); }
.pos-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 46vh; overflow-y: auto; }
.pos-line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border-light); }
.pos-line-main { font-size: 13px; font-weight: 600; color: var(--text-primary); min-width: 0; }
.pos-line-note { font-size: 11px; color: var(--text-muted); }
.pos-qty { display: flex; align-items: center; gap: 4px; }
.pos-qty button { width: 26px; height: 26px; border: 1px solid var(--border-color); border-radius: var(--r-control); background: var(--bg-card); color: var(--text-primary); cursor: pointer; }
.pos-qty button:hover { background: var(--navy-primary); border-color: var(--navy-primary); color: #fff; }
.pos-qty span { min-width: 26px; text-align: center; font-weight: 700; }
.pos-line-amt { font-weight: 800; color: var(--navy-primary); white-space: nowrap; }
.pos-empty { padding: 28px 12px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---- shift close: counted vs expected ---- */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sc-ok { color: var(--success); font-weight: 700; }
.sc-short { color: var(--danger); font-weight: 700; }
.sc-over { color: var(--warning); font-weight: 700; }

/* ---- registration card / event confirmation: one A4 sheet ---- */
.page-regcard { background: #eceff1; padding: 0; }
.rc-tools { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.rc-sheet { width: 210mm; max-width: 100%; min-height: 297mm; margin: 18px auto; padding: 16mm 14mm; background: #fff; color: #222; box-shadow: 0 2px 14px rgba(0, 0, 0, .14); }
.rc-head { width: 100%; border-collapse: collapse; }
.rc-head td { vertical-align: top; }
.rc-right { text-align: right; }
.rc-logo { max-height: 54px; margin-bottom: 6px; }
.rc-hotel { font-size: 20px; font-weight: 800; color: var(--navy-primary); }
.rc-sub { font-size: 11px; color: #555; line-height: 1.5; }
.rc-title { font-size: 15px; font-weight: 800; letter-spacing: 2px; color: var(--navy-primary); margin-bottom: 6px; }
.rc-meta { margin-left: auto; border-collapse: collapse; font-size: 11px; }
.rc-meta td { padding: 2px 0 2px 12px; }
.rc-meta td:first-child { color: #666; }
.rc-meta td:last-child { font-weight: 700; text-align: right; }
.rc-band { height: 4px; background: var(--navy-primary); margin: 10px 0 16px; }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.rc-box { border: 1px solid #d8dde0; padding: 10px 12px; }
.rc-box h4 { font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--navy-primary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.rc-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted #d8dde0; font-size: 11px; }
.rc-row:last-child { border-bottom: 0; }
.rc-row span { color: #666; }
.rc-row strong { color: #111; text-align: right; }
.rc-vip { font-style: normal; font-weight: 800; color: #b8860b; }
.rc-terms { border: 1px solid #d8dde0; padding: 10px 12px; margin-bottom: 16px; }
.rc-terms h4 { font-size: 12px; font-weight: 800; color: var(--navy-primary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.rc-terms ol { margin: 0 0 0 16px; padding: 0; }
.rc-terms li { font-size: 10.5px; line-height: 1.55; color: #444; margin-bottom: 4px; }
.rc-foot { font-size: 10.5px; color: #555; margin-top: 8px; }
.rc-sign { width: 100%; border-collapse: collapse; margin-top: 26px; }
.rc-sign td { width: 33.33%; padding: 0 10px; font-size: 11px; color: #444; text-align: center; vertical-align: top; }
.rc-sign small { color: #777; }
.rc-line { border-top: 1px solid #333; margin-bottom: 6px; }
.rc-credit { margin-top: 18px; padding-top: 8px; border-top: 1px solid #d8dde0; font-size: 10px; color: #777; text-align: center; }
@media print {
    .rc-tools { display: none !important; }
    .page-regcard { background: #fff; }
    .rc-sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
}

/* ---- public booking page ---- */
.page-book .bk-title { font-size: 22px; font-weight: 800; color: var(--navy-primary); margin-bottom: 6px; }
.bk-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-card); padding: 18px; margin-bottom: 16px; }
.bk-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.bk-full { grid-column: 1 / -1; }
.bk-avail { margin: 12px 0; }
.bk-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bk-type { border: 1px solid var(--border-color); border-top: 4px solid var(--navy-light); border-radius: var(--r-card); background: var(--bg-card); cursor: pointer; overflow: hidden; text-align: left; }
.bk-type:hover { border-color: var(--navy-light); background: var(--table-hover); }
.bk-type.active { border-color: var(--navy-primary); box-shadow: 0 0 0 2px rgba(var(--navy-primary-rgb), .18); }
.bk-type-banner { height: 110px; background: var(--bg-primary) center/cover no-repeat; }
.bk-type-body { padding: 12px; }
.bk-type-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 10px; }
.bk-type-full { opacity: .55; cursor: not-allowed; }
.bk-pick { margin: 12px 0; padding: 10px 12px; border-left: 4px solid var(--navy-primary); background: var(--bg-primary); font-size: 13px; }
.bk-done { text-align: center; padding: 36px 18px; }
.bk-done i { font-size: 46px; color: var(--success); margin-bottom: 12px; }

/* ---- feedback form ---- */
.page-feedback { background: var(--bg-primary); }
.fb-card { max-width: 620px; margin: 32px auto; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-card); padding: 22px; }
.fb-form { display: flex; flex-direction: column; gap: 16px; }
.fb-row { display: flex; flex-direction: column; gap: 6px; }
.fb-stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.fb-stars input { position: absolute; opacity: 0; width: 0; height: 0; }
.fb-label { font-size: 26px; line-height: 1; color: var(--border-color); cursor: pointer; transition: color .12s; }
.fb-stars input:checked ~ .fb-label,
.fb-label:hover,
.fb-label:hover ~ .fb-label { color: #f0ad4e; }

/* ---- guest messaging ---- */
.gm-hits { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.gm-hit { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--r-control); background: var(--bg-card); cursor: pointer; text-align: left; font-size: 13px; }
.gm-hit:hover { background: var(--table-hover); border-color: var(--navy-light); }
.gm-hit.active { border-color: var(--navy-primary); background: var(--bg-primary); }
.gm-hit-off { opacity: .6; }
.gm-preview { border: 1px solid var(--border-color); border-radius: var(--r-card); padding: 14px; background: var(--bg-card); max-height: 420px; overflow-y: auto; }

/* ---- dark mode: these carry their own colour, keep the blanket rule off them ---- */
body.dark-mode .tc-bar-name { color: #fff; }
body.dark-mode .tc-bar-meta { color: rgba(255, 255, 255, .85); }
body.dark-mode .pos-item-price,
body.dark-mode .pos-line-amt { color: var(--navy-light); }
body.dark-mode .rv-stars,
body.dark-mode .rv-crown,
body.dark-mode .rc-vip { color: #f0ad4e; }
body.dark-mode .sc-ok { color: var(--success); }
body.dark-mode .sc-short { color: var(--danger); }
body.dark-mode .sc-over { color: var(--warning); }
/* the printed sheet stays a printed sheet, whatever the screen theme is */
body.dark-mode.page-regcard .rc-sheet,
body.dark-mode .rc-sheet { background: #fff; color: #222; }

/* ---- narrow screens ---- */
@media (max-width: 900px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-ticket { position: static; }
    .rc-grid { grid-template-columns: 1fr; }
}

/* ---- chat presence: online dot + last seen ---- */
.chat-av { position: relative; display: inline-block; flex-shrink: 0; line-height: 0; }
.chat-av img { display: block; }
/* the dot rides the avatar, so one rule covers the 49px list row and the 40px header.
   the ring is the panel colour, not --bg-card — the chat runs its own --wa-* palette
   and picks up a dark one from body.page-chat.dark-mode without any extra rule here. */
.chat-dot {
    position: absolute; right: 1px; bottom: 1px;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--wa-mut, #667781);
    border: 2px solid var(--wa-panel, #fff);
    box-sizing: border-box;
}
.chat-dot.is-online { background: var(--wa-green, #25d366); }
.chat-head .chat-av .chat-dot { width: 11px; height: 11px; }
/* the header's role line turns green the moment the dot does */
#chatHeadRole.is-online { color: var(--wa-green, #25d366); }
/* hover and active rows change the row background, so the ring follows them */
.chat-contact:hover .chat-dot,
.chat-contact.active .chat-dot { border-color: var(--wa-head); }
body.page-chat.dark-mode .chat-contact.active .chat-dot { border-color: #2a3942; }
.chat-head .chat-dot { border-color: var(--wa-head); }

/* ==========================================================================
   TABULATOR 6.3.1 — the house table (docs/datatable.md + docs/css-styles.md).
   Radius tokens mapped on paste: the doc ships --r-md/--r-sm/--r-pill, this
   project is the squared UI, so surfaces take --r-card and controls --r-control.
   The doc's greys and its dark-mode block are kept verbatim — that pairing is
   the tested one and re-tokenising it would be freelancing.
   ========================================================================== */
.tb-table { margin-top: 4px; }
.tabulator { background: transparent; border: 1px solid #e6e9ef; border-radius: var(--r-card); font-size: 13px; overflow: hidden; }
.tabulator .tabulator-header { background: var(--navy-primary); border-bottom: 0; color: #fff; font-weight: 600; }
.tabulator .tabulator-header .tabulator-col { background: transparent; border-right: 1px solid rgba(255,255,255,.10); }
.tabulator .tabulator-header .tabulator-col-title { font-size: 12.5px; letter-spacing: .3px; padding: 12px 10px; }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { background: rgba(255,255,255,.08); }
.tabulator .tabulator-header .tabulator-col .tabulator-arrow { border-bottom-color: rgba(255,255,255,.6) !important; }
.tabulator .tabulator-row { border-bottom: 1px solid #f1f3f7; background: #fff; }
.tabulator .tabulator-row.tabulator-row-even { background: #fcfdff; }
.tabulator .tabulator-row:hover { background: #f5f8fc; }
.tabulator .tabulator-row.tabulator-selected { background: rgba(var(--navy-accent-rgb), .10); }
.tabulator .tabulator-cell { border-right: 0; padding: 11px 10px; color: var(--text-primary); }
.tabulator .tabulator-footer { background: #f8fafc; border-top: 1px solid #eceff4; padding: 8px 10px; }
/* the paginator ships as bare inline nodes — give it a real row so the counter, the page
   size and the buttons stop running into each other */
.tabulator .tabulator-footer .tabulator-footer-contents { display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 8px 14px; }
.tabulator .tabulator-footer .tabulator-page-counter { color: #667685; font-size: 12.5px; font-weight: 600; order: 2; }
.tabulator .tabulator-footer .tabulator-paginator { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    color: #667685; font-size: 12.5px; order: 1; }
.tabulator .tabulator-footer .tabulator-paginator label { margin: 0 2px 0 0; font-weight: 600; }
/* Tabulator's own page-size control — the one <select> the house style has to adopt */
.tabulator .tabulator-footer .tabulator-page-size { border: 1px solid #e2e8f1; background: #fff;
    color: var(--navy-primary); font-size: 12.5px; font-weight: 700; padding: 5px 26px 5px 9px;
    border-radius: var(--r-control); cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23234E52' stroke-width='1.6' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat; background-position: right 9px center; background-size: 9px; }
.tabulator .tabulator-footer .tabulator-page-size:focus { outline: 2px solid rgba(var(--navy-accent-rgb), .35); outline-offset: 1px; }
.tabulator .tabulator-footer .tabulator-page { border: 1px solid #e2e8f1; background: #fff; color: var(--navy-primary); font-size: 12.5px; padding: 5px 10px; border-radius: var(--r-control); }
.tabulator .tabulator-footer .tabulator-page.active { background: var(--navy-primary); color: #fff; border-color: var(--navy-primary); }
.tabulator .tabulator-footer .tabulator-page:disabled { opacity: .45; }
.tabulator .tabulator-placeholder .tabulator-placeholder-contents { color: #98a2b3; font-size: 13px; }

/* identity cell + pills */
.tb-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-ava { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
          background: var(--navy-accent); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.tb-uid { min-width: 0; line-height: 1.3; }
.tb-uid b { display: block; font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }
.tb-uid small { display: block; font-size: 11.5px; color: #9aa6b2; overflow: hidden; text-overflow: ellipsis; }
.tb-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-control); font-size: 11.5px; font-weight: 700; }
.tb-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tb-pill.role { background: rgba(var(--navy-accent-rgb), .14); color: var(--navy-accent); }
.tb-pill.ok { background: rgba(52,168,83,.14); color: #1e7e34; }
.tb-pill.off { background: rgba(234,67,53,.13); color: #c5221f; }
.tb-na { color: #9aa6b2; }

/* inline filter toolbar */
.tb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
              padding: 10px; margin-bottom: 10px; background: #fff; border: 1px solid #e6e9ef; border-radius: var(--r-card); }
.tb-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-search, .tb-sel { position: relative; display: flex; align-items: center; }
.tb-search > i, .tb-sel > i { position: absolute; left: 12px; font-size: 13px; color: #9aa6b2; pointer-events: none; }
.tb-search input, .tb-sel select { height: 38px; padding: 0 12px 0 34px; border: 1px solid #e2e8f1; background: #fff; color: var(--text-primary);
  font-family: inherit; font-size: 16px; font-weight: 500; border-radius: var(--r-control); transition: border-color .2s, box-shadow .2s; }
.tb-search input { width: 262px; }
.tb-sel select { padding-right: 28px; cursor: pointer; min-width: 140px; }
.tb-search input:focus, .tb-sel select:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(var(--navy-accent-rgb), .14); }
.tb-tbtn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border: 1px solid #e2e8f1; background: #fff;
           color: var(--text-primary); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: var(--r-control); transition: all .18s; }
.tb-tbtn:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.tb-tbtn.ghost { border-style: dashed; color: var(--text-muted); width: 100%; justify-content: center; margin-top: 4px; }
.tb-dot { min-width: 17px; height: 17px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
          background: var(--navy-accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: var(--r-control); }

/* shared popover shell — More Filters + Columns */
.tb-pop { position: relative; }
.tb-pop-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: #fff; border: 1px solid #e6e9ef;
               box-shadow: 0 10px 28px rgba(0,0,0,.16); border-radius: var(--r-card); padding: 10px; z-index: 400; display: none; }
.tb-pop.open .tb-pop-menu { display: block; }
.tb-pop-h { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #9aa6b2; margin-bottom: 8px; }
.tb-pop-menu label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 2px; font-size: 12.5px; font-weight: 600; color: #444; }
.tb-pop-menu label.tb-chk { justify-content: flex-start; gap: 9px; padding: 7px 8px; font-size: 13px; cursor: pointer; border-radius: var(--r-control); }
.tb-pop-menu label.tb-chk:hover { background: #f1f4f8; }
.tb-pop-menu input[type="date"] { height: 32px; padding: 0 8px; border: 1px solid #e2e8f1; background: #fff; color: var(--text-primary);
                                  font-family: inherit; font-size: 16px; border-radius: var(--r-control); }
.tb-pop-menu input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy-accent); cursor: pointer; }

/* bulk action bar — always visible, disabled at 0 selected */
.tb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
          padding: 9px 12px; margin-bottom: 10px; background: #f8fafc; border: 1px solid #eceff4; border-radius: var(--r-card); }
.tb-count { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.tb-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-all { width: 16px; height: 16px; accent-color: var(--navy-accent); cursor: pointer; }
.tb-bulk-n { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--navy-primary); margin-right: 4px; }
.tb-bulk-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid #e2e8f1; background: #fff;
               color: var(--text-primary); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: var(--r-control); transition: all .18s; }
.tb-bulk-btn:hover { border-color: var(--navy-accent); color: var(--navy-accent); }
.tb-bulk-btn.ok { background: rgba(52,168,83,.1); border-color: rgba(52,168,83,.3); color: #1e7e34; }
.tb-bulk-btn.warn { background: rgba(251,188,4,.14); border-color: rgba(251,188,4,.4); color: #8a6d02; }
.tb-bulk-btn.danger { background: rgba(234,67,53,.1); border-color: rgba(234,67,53,.3); color: #c5221f; }
.tb-bulk-btn.info { background: rgba(var(--navy-accent-rgb), .10); border-color: rgba(var(--navy-accent-rgb), .30); color: var(--navy-accent); }
.tb-bulk-btn:disabled { opacity: .45; cursor: not-allowed; }
.tb-bulk-btn:disabled:hover { border-color: #e2e8f1; }

/* ---- chip tables under Tabulator ----
   Tabulator puts .tabulator on THE SAME element you hand it, so ".chip-table .tabulator"
   never matches — it has to be ".chip-table.tabulator". */
.chip-table.tabulator { min-width: 0; }
.chip-table.tabulator .tabulator-tableholder { overflow-x: auto; }
.chip-table.tabulator .tabulator-header .tabulator-col { background: var(--navy-primary); }
.chip-table.tabulator .tabulator-header .tabulator-col-title { padding: 9px 10px; font-size: 13px; font-weight: 700; }
.chip-table.tabulator .tabulator-cell { padding: 7px 9px; font-size: 12.5px; vertical-align: middle; }
/* DataTables took className:'ctr'; Tabulator's cssClass puts it on header AND cell */
.chip-table.tabulator .ctr, .chip-table.tabulator .ctr .tabulator-col-title { text-align: center; }
/* status tint rail — rowFormatter stamps .rv-row + --st */
.chip-table.tabulator .tabulator-row.rv-row { box-shadow: inset 4px 0 0 0 var(--st, #6c757d); }
/* in-cell control wrapper — owns the click, contributes no layout */
.tabulator .cell-hit { display: contents; }
.chip-table.tabulator .col-actions { white-space: nowrap; }
/* row tints set from rowFormatter — !important beats Tabulator's own striping */
.chip-table.tabulator .tabulator-row.row-good { background: #f2fbf5 !important; }
.chip-table.tabulator .tabulator-row.row-bad  { background: #fdf3f2 !important; }
.chip-table.tabulator .tabulator-row.row-wait { background: #fffaf0 !important; }

body.dark-mode .tabulator { border-color: #333; }
body.dark-mode .tabulator .tabulator-row,
body.dark-mode .tabulator .tabulator-row.tabulator-row-even { background: #1e1e1e; border-color: #2a2a2a; }
body.dark-mode .tabulator .tabulator-row:hover { background: #262626; }
body.dark-mode .tabulator .tabulator-cell { color: #ddd; }
body.dark-mode .tabulator .tabulator-footer { background: #191919; border-color: #333; }
body.dark-mode .tabulator .tabulator-footer .tabulator-page { background: #2a2a2a; border-color: #3a3a3a; color: #ddd; }
body.dark-mode .tabulator .tabulator-footer .tabulator-page-size { background: #2a2a2a; border-color: #3a3a3a; color: #ddd; }
body.dark-mode .tabulator .tabulator-footer .tabulator-page-counter,
body.dark-mode .tabulator .tabulator-footer .tabulator-paginator { color: #9aa5b1; }
body.dark-mode .tb-uid b { color: #eee; }
body.dark-mode .tb-toolbar { background: #1e1e1e; border-color: #333; }
body.dark-mode .tb-bar { background: #191919; border-color: #2f2f2f; }
body.dark-mode .tb-search input, body.dark-mode .tb-sel select,
body.dark-mode .tb-tbtn, body.dark-mode .tb-pop-menu input[type="date"] { background: #2a2a2a; border-color: #3a3a3a; color: #ddd; }
body.dark-mode .tb-pop-menu { background: #1e1e1e; border-color: #333; }
body.dark-mode .tb-pop-menu label { color: #ccc; }
body.dark-mode .tb-pop-menu label.tb-chk:hover { background: #2a2a2a; }
body.dark-mode .tb-bulk-btn { background: #2a2a2a; border-color: #3a3a3a; color: #ddd; }
body.dark-mode .tb-bulk-n { color: #eee; }
body.dark-mode .tb-bulk-btn:disabled:hover { border-color: #3a3a3a; }
body.dark-mode .chip-table.tabulator .tabulator-row.row-good { background: #16251b !important; }
body.dark-mode .chip-table.tabulator .tabulator-row.row-bad  { background: #2a1a19 !important; }
body.dark-mode .chip-table.tabulator .tabulator-row.row-wait { background: #2a2415 !important; }

@media (max-width: 768px) {
  .tabulator { font-size: 12.5px; }
  .tb-bar, .tb-toolbar { gap: 8px; }
  .tb-bulk-btn { padding: 6px 10px; font-size: 12px; }
  .tb-tools { width: 100%; }
  .tb-search, .tb-search input, .tb-sel, .tb-sel select { flex: 1; width: auto; min-width: 0; }
}

/* ===== POS Register (pos_register.php) — a full-screen till, no sidebar ===== */
.page-register { margin: 0; background: var(--bg-primary); overflow: hidden; }
.reg-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.reg-top { background: var(--navy-primary); color: #fff; flex: 0 0 auto; }
.reg-top-row { display: flex; align-items: center; gap: 14px; padding: 9px 14px; }
.reg-back { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none;
    background: rgba(255,255,255,.12); padding: 7px 12px; border-radius: var(--r-control); font-weight: 700; font-size: 13px; }
.reg-back:hover { background: rgba(255,255,255,.22); }
.reg-title { display: flex; flex-direction: column; line-height: 1.25; }
.reg-title-main { font-size: 15px; font-weight: 800; }
.reg-title-sub { font-size: 11.5px; opacity: .75; }
.reg-types { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.reg-type { background: rgba(255,255,255,.10); color: #fff; border: 1px solid rgba(255,255,255,.16);
    padding: 8px 14px; border-radius: var(--r-control); font-weight: 700; font-size: 13px; cursor: pointer; }
.reg-type:hover { background: rgba(255,255,255,.2); }
.reg-type.active { background: #fff; color: var(--navy-primary); border-color: #fff; }
.reg-top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.reg-top-btn { background: rgba(255,255,255,.12); color: #fff; border: none; padding: 8px 12px;
    border-radius: var(--r-control); font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.reg-top-btn:hover { background: rgba(255,255,255,.24); }
.reg-clock { font-size: 13px; font-weight: 700; opacity: .9; display: inline-flex; gap: 6px; align-items: center; }
.reg-badge { background: var(--navy-accent); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 800; }

.reg-meta { display: flex; gap: 12px; padding: 0 14px 11px; flex-wrap: wrap; }
.reg-meta-block { display: flex; flex-direction: column; gap: 4px; min-width: 220px; flex: 1 1 220px; }
.reg-meta-block label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.reg-meta-block input[type="text"] { padding: 8px 10px; border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--r-control); background: rgba(255,255,255,.1); color: #fff; font-size: 13.5px; }
.reg-meta-block input::placeholder { color: rgba(255,255,255,.55); }
.reg-meta-block.reg-req label::after { content: ' *'; color: #ffb3b3; }

.reg-body { display: flex; flex: 1 1 auto; min-height: 0; }

/* left: the catalogue */
.reg-menu { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; padding: 12px; gap: 10px; }
.reg-tools { display: flex; gap: 8px; align-items: center; }
.reg-search { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--r-control); padding: 0 11px; }
.reg-search input { flex: 1 1 auto; border: none; background: none; padding: 11px 0; font-size: 14px; color: var(--text-primary); outline: none; }
.reg-quick { display: flex; align-items: center; gap: 7px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--r-control); padding: 0 11px; }
.reg-quick input { width: 96px; border: none; background: none; padding: 11px 0; font-size: 14px; font-weight: 700; color: var(--text-primary); outline: none; }
.reg-cart-toggle { display: none; }

.reg-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.reg-cat { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-primary);
    padding: 7px 14px; border-radius: var(--r-control); font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.reg-cat.active { background: var(--navy-primary); color: #fff; border-color: var(--navy-primary); }

.reg-grid { flex: 1 1 auto; overflow-y: auto; display: grid; gap: 9px;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); align-content: start;
    /* each tile keeps its own height — a photo-less tile next to a photo one must not be
       stretched to match it, or the price gets pushed down and leaves a hole in the middle */
    align-items: start; }
.reg-tile { position: relative; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--r-card); padding: 13px 11px; text-align: left; cursor: pointer;
    display: flex; flex-direction: column; gap: 5px; min-height: 88px; transition: transform .08s, box-shadow .12s; }
.reg-tile:hover { border-color: var(--navy-accent); box-shadow: 0 3px 10px rgba(0,0,0,.09); }
.reg-tile:active { transform: scale(.97); }
.reg-tile-code { position: absolute; top: 7px; right: 8px; font-size: 10.5px; font-weight: 800;
    color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .1); padding: 1px 6px; border-radius: var(--r-control); }
.reg-tile-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.reg-tile-price { font-size: 14px; font-weight: 800; color: var(--navy-primary); margin-top: auto; }
.reg-tile-tag { font-size: 10.5px; font-weight: 700; color: #667685; }
.reg-tile-mod { position: absolute; bottom: 9px; right: 9px; color: var(--navy-accent); }
.reg-skel { height: 88px; border-radius: var(--r-card); background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%);
    background-size: 200% 100%; animation: regshimmer 1.2s infinite; }
@keyframes regshimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.reg-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; color: #8a94a2; }
.reg-empty i { font-size: 30px; opacity: .35; }
.reg-empty p { margin: 9px 0 3px; font-weight: 700; color: var(--text-primary); }
.reg-empty small { font-size: 12px; }
.reg-empty-sm { padding: 26px 14px; }

/* right: the ticket */
.reg-cart { flex: 0 0 380px; display: flex; flex-direction: column; background: var(--bg-card);
    border-left: 1px solid var(--border-color); min-height: 0; }
.reg-cart-head { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--border-color); }
.reg-cart-head h4 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.reg-cart-head .reg-ico { margin-left: auto; }
.reg-cart-head .reg-ico + .reg-ico { margin-left: 0; }
.reg-ico { background: none; border: 1px solid var(--border-color); color: var(--text-primary);
    width: 30px; height: 30px; border-radius: var(--r-control); cursor: pointer; font-size: 13px; }
.reg-ico:disabled { opacity: .4; cursor: not-allowed; }
.reg-ico:hover:not(:disabled) { border-color: var(--navy-accent); color: var(--navy-accent); }
.reg-cart-hide { display: none; }

.reg-lines { flex: 1 1 auto; overflow-y: auto; padding: 8px 10px; min-height: 90px; }
.reg-line { border-bottom: 1px solid var(--border-color); padding: 9px 2px; }
.reg-line-top { display: flex; justify-content: space-between; gap: 10px; }
.reg-line-name { font-weight: 700; font-size: 13.5px; color: var(--text-primary); }
.reg-line-amt { font-weight: 800; font-size: 13.5px; color: var(--navy-primary); white-space: nowrap; }
.reg-line-sub { font-size: 11.5px; color: #667685; margin-top: 2px; }
.reg-line-bot { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.reg-line-unit { font-size: 11.5px; color: #8a94a2; }
.reg-line-del { margin-left: auto; }
.reg-qty { display: inline-flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--r-control); overflow: hidden; }
.reg-qty button { width: 28px; height: 26px; border: none; background: var(--bg-primary); cursor: pointer; font-size: 15px; font-weight: 700; color: var(--navy-primary); }
.reg-qty button:hover { background: var(--navy-primary); color: #fff; }
.reg-qty b { min-width: 30px; text-align: center; font-size: 13px; }

.reg-checkout { border-top: 1px solid var(--border-color); padding: 10px 12px; overflow-y: auto; flex: 0 1 auto; }
.reg-chiprow { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.reg-chiplbl { font-size: 11px; font-weight: 700; color: #667685; text-transform: uppercase; letter-spacing: .4px; margin-right: 2px; }
.reg-chip { background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--navy-primary);
    padding: 5px 10px; border-radius: var(--r-control); font-size: 12px; font-weight: 700; cursor: pointer; }
.reg-chip:hover { background: var(--navy-primary); color: #fff; border-color: var(--navy-primary); }
.reg-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 9px; }
.reg-cell { display: flex; flex-direction: column; gap: 3px; }
.reg-cell label { font-size: 10.5px; font-weight: 700; color: #667685; text-transform: uppercase; letter-spacing: .4px; }
.reg-cell input { padding: 7px 9px; border: 1px solid var(--border-color); border-radius: var(--r-control); font-size: 13px; width: 100%; }
.reg-cell input[readonly] { background: var(--bg-primary); color: #667685; }

.reg-tot { border-top: 1px dashed var(--border-color); padding-top: 8px; }
.reg-tot-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.reg-tot-thin { font-size: 12.5px; color: #667685; }
.reg-tot-grand { border-top: 1px solid var(--navy-primary); margin-top: 6px; padding-top: 7px;
    font-size: 16px; font-weight: 800; color: var(--navy-primary); }

.reg-cash { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; margin-top: 9px; }
.reg-cash label { font-size: 10.5px; font-weight: 700; color: #667685; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 3px; }
.reg-cash input { padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--r-control); font-size: 14px; width: 100%; font-weight: 700; }
.reg-cash-out span { font-size: 16px; font-weight: 800; color: #28a745; white-space: nowrap; }
.reg-cash-out span.reg-short { color: #dc3545; }
.reg-notes-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.reg-notes { margin-top: 9px; }
.reg-notes label { font-size: 10.5px; font-weight: 700; color: #667685; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 3px; }
.reg-notes textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--r-control); font-size: 13px; resize: vertical; }

.reg-actions { border-top: 1px solid var(--border-color); padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; flex: 0 0 auto; }
.reg-pay { font-size: 15px; font-weight: 800; padding: 13px; }
.reg-actions-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.reg-actions-row .btn { padding: 9px 6px; font-size: 12px; }
.reg-actions kbd, .reg-hint kbd { background: rgba(0,0,0,.18); border-radius: 3px; padding: 0 4px; font-size: 10px; margin-left: 4px; }

/* pickers */
.reg-pick { max-width: 560px; }
.reg-grp + .reg-grp { margin-top: 13px; }
.reg-grp-head { font-size: 12px; font-weight: 800; color: var(--navy-primary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.reg-req-tag { background: rgba(220,53,69,.1); color: #dc3545; font-size: 10px; padding: 1px 6px; border-radius: var(--r-control); }
.reg-opts { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.reg-opts-wide { grid-template-columns: 1fr; }
.reg-opt { display: flex; align-items: center; gap: 9px; background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--r-control); padding: 10px 11px; cursor: pointer; text-align: left; font-size: 13px; }
.reg-opt:hover { border-color: var(--navy-accent); }
.reg-opt.is-on { background: var(--navy-primary); color: #fff; border-color: var(--navy-primary); }
.reg-opt.is-def { border-color: var(--navy-accent); }
.reg-opt span { flex: 1 1 auto; font-weight: 600; }
.reg-opt b { font-weight: 800; white-space: nowrap; }
.reg-opt kbd { background: rgba(0,0,0,.12); border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 800; }
.reg-opt.is-on kbd { background: rgba(255,255,255,.25); }
.reg-hint { padding: 8px 16px; font-size: 11.5px; color: #8a94a2; border-top: 1px solid var(--border-color); }

body.dark-mode .reg-tile,
body.dark-mode .reg-cart { background: #1e1e1e; }
body.dark-mode .reg-skel { background: linear-gradient(90deg, #242424 25%, #2c2c2c 50%, #242424 75%); background-size: 200% 100%; }

@media (max-width: 900px) {
    .reg-cart { position: fixed; inset: 0 0 0 auto; width: min(380px, 92vw); z-index: 60;
        transform: translateX(100%); transition: transform .2s; box-shadow: -6px 0 22px rgba(0,0,0,.18); }
    .reg-cart.is-open { transform: none; }
    .reg-cart-hide, .reg-cart-toggle { display: inline-flex; align-items: center; gap: 6px; }
    .reg-cart-toggle { background: var(--navy-primary); color: #fff; border: none; padding: 10px 13px;
        border-radius: var(--r-control); font-weight: 700; cursor: pointer; }
    .reg-types { order: 3; width: 100%; margin-left: 0; }
    .reg-top-right { order: 2; }
}

/* ===== Extras: the sizes + option-group editors inside the item form ===== */
.ex-sub { border-top: 1px solid var(--border-color); margin-top: 14px; padding-top: 12px; }
.ex-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ex-sub-head h4 { margin: 0; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.ex-none { font-style: italic; opacity: .8; }
.ex-row { display: grid; grid-template-columns: 1fr 120px auto auto; gap: 7px; align-items: center; margin-bottom: 6px; }
.ex-row input[type="text"], .ex-row input[type="number"] {
    padding: 7px 9px; border: 1px solid var(--border-color); border-radius: var(--r-control); font-size: 13px; width: 100%; }
.ex-def { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #667685; white-space: nowrap; }
.ex-def input { margin: 0; }
.ex-grouppick { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ex-gchk { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-color);
    border-radius: var(--r-control); padding: 8px 10px; cursor: pointer; font-size: 13px; }
.ex-gchk input { margin: 0; }
.ex-gchk span { font-weight: 700; }
.ex-gchk small { margin-left: auto; color: #8a94a2; font-size: 11px; }
.ex-gchk:has(input:checked) { border-color: var(--navy-accent); background: rgba(var(--navy-accent-rgb), .06); }

@media (max-width: 560px) {
    .ex-row { grid-template-columns: 1fr auto; }
    .ex-row .ex-def { grid-column: 1 / -1; }
}

/* ===== Attendance Live Map (attendance_map.php) ===== */
.amap-warn { margin-bottom: 14px; }
.amap-asof { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); }

.amap-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.amap-day { display: flex; align-items: center; gap: 6px; }
.amap-date { padding: 7px 10px; border: 1px solid var(--input-border); border-radius: var(--r-control);
    background: var(--input-bg); color: var(--text-primary); font-size: 16px; font-weight: 700; }
.amap-live { margin: 0; }
.amap-live span { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }

/* the four counters: what the day looks like before anyone opens a single pin */
.amap-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.amap-kpi { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-color);
    border-left-width: 3px; border-radius: var(--r-card); background: var(--bg-card); }
.amap-kpi i { font-size: 17px; opacity: .9; }
.amap-kpi strong { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; color: var(--text-primary); }
.amap-kpi span { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.amap-kpi.k-navy  { border-left-color: var(--navy-primary); } .amap-kpi.k-navy i  { color: var(--navy-primary); }
.amap-kpi.k-green { border-left-color: #16A34A; } .amap-kpi.k-green i { color: #16A34A; }
.amap-kpi.k-red   { border-left-color: #DC2626; } .amap-kpi.k-red i   { color: #DC2626; }
.amap-kpi.k-grey  { border-left-color: #6B7280; } .amap-kpi.k-grey i  { color: #6B7280; }

.amap-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 12px; align-items: stretch; }
.amap-canvas-wrap { position: relative; }
.amap-canvas { position: relative; height: 560px; border: 1px solid var(--border-color); border-radius: var(--r-card); overflow: hidden; z-index: 1; }
.amap-legend { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 12px;
    padding: 7px 10px; background: rgba(255,255,255,.94); border: 1px solid var(--border-color);
    border-radius: var(--r-card); font-size: 11.5px; font-weight: 700; color: #45505c; }
.amap-legend i { font-size: 9px; margin-right: 4px; }
.amap-dot-in { color: #16A34A; } .amap-dot-out { color: #DC2626; }
.amap-dot-exit { color: #0EA5E9; } .amap-dot-prop { color: #B45309; font-size: 11px !important; }

/* side list — every mark of the day, including the ones with no pin to fly to */
.amap-side { display: flex; flex-direction: column; border: 1px solid var(--border-color);
    border-radius: var(--r-card); background: var(--bg-card); min-height: 0; }
.amap-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.amap-side-head h3 { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--navy-primary);
    display: flex; align-items: center; gap: 7px; }
.amap-count { background: rgba(var(--navy-primary-rgb), .1); color: var(--navy-primary);
    font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.amap-list { flex: 1; overflow-y: auto; max-height: 520px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.amap-row { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid var(--border-light);
    border-left: 3px solid #6B7280; border-radius: var(--r-control); cursor: pointer; transition: background .15s, transform .15s; }
.amap-row:hover { background: var(--table-hover); transform: translateX(2px); }
.amap-row.is-in   { border-left-color: #16A34A; }
.amap-row.is-out  { border-left-color: #DC2626; background: rgba(220, 38, 38, .04); }
.amap-row.is-none { border-left-color: var(--navy-light); }
.amap-row.no-fix  { cursor: default; opacity: .72; }
.amap-row.no-fix:hover { background: transparent; transform: none; }
.amap-av { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--navy-primary); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .3px; }
.amap-row-txt { flex: 1; min-width: 0; }
.amap-row-txt .cell-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amap-row-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amap-row-sub i { font-size: 10px; opacity: .8; }
.amap-tag { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--text-secondary);
    background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.amap-row.is-out .amap-tag { color: #DC2626; border-color: #f3c2c2; background: #fdeaea; }
.amap-honest { margin-top: 12px; }

/* markers are DivIcons, so no Leaflet image ever has to resolve */
.amap-pin { display: grid; place-items: center; border-radius: 50%; background: #6B7280; color: #fff;
    font-size: 11.5px; font-weight: 800; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.amap-pin.is-in   { background: #16A34A; }
.amap-pin.is-out  { background: #DC2626; }
.amap-pin.is-none { background: var(--navy-primary); }
.amap-exit { display: grid; place-items: center; background: #0EA5E9; color: #fff; font-size: 10px;
    border: 2px solid #fff; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,.3); }
.amap-prop { display: grid; place-items: center; background: #B45309; color: #fff; font-size: 13px;
    border: 2px solid #fff; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

.leaflet-container { font: inherit; }
.amap-popup .leaflet-popup-content-wrapper { border-radius: var(--r-card); padding: 2px; }
.amap-popup .leaflet-popup-content { margin: 10px 12px; min-width: 210px; }
.amap-pop h4 { margin: 0 0 2px; font-size: 13.5px; font-weight: 800; color: var(--navy-primary);
    display: flex; align-items: center; gap: 6px; }
.amap-pop-sub { font-size: 11.5px; color: #6b7685; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.amap-pop-act { display: flex; gap: 6px; margin-top: 9px; }
.amap-pop-act .btn { flex: 1; justify-content: center; font-size: 11.5px; padding: 6px 8px; }

body.dark-mode .amap-legend { background: rgba(30, 30, 63, .94); color: var(--text-secondary); }
body.dark-mode .leaflet-tile { filter: brightness(.78) contrast(1.08) saturate(.85); }
body.dark-mode .amap-popup .leaflet-popup-content-wrapper,
body.dark-mode .amap-popup .leaflet-popup-tip { background: var(--bg-card); color: var(--text-primary); }
body.dark-mode .amap-pop h4 { color: var(--text-primary); }
body.dark-mode .amap-row.is-out { background: rgba(220, 38, 38, .12); }
body.dark-mode .amap-row.is-out .amap-tag { background: rgba(220, 38, 38, .18); border-color: rgba(220,38,38,.35); color: #fca5a5; }

@media (max-width: 1100px) {
    .amap-wrap { grid-template-columns: 1fr; }
    .amap-canvas { height: 52vh; min-height: 340px; }
    .amap-list { max-height: 320px; }
}
@media (max-width: 720px) {
    .amap-kpis { grid-template-columns: repeat(2, 1fr); }
    .amap-bar { gap: 8px; }
    .amap-day { flex: 1 1 100%; }
    .amap-date { flex: 1; }
    .amap-legend { position: static; margin-top: 8px; }
}

/* ===== Booking wizard — spacing between the decisions on a pane ===== */
/* the grid, the group switch and the availability line were stacking with no air between them,
   so the pane read as one dense block. padding only shows on a surface, hence the tint. */
#bookModal #bkGroupRow {
    margin: 18px 0; padding: 12px 14px; border: 1px solid var(--border-light);
    border-radius: var(--r-card); background: var(--bg-primary);
}
#bookModal #bkGroupRow label { margin: 0; cursor: pointer; }
#bookModal #bkAvail:not(:empty)      { margin: 16px 0 6px; }
#bookModal #bkGroupHost:not(.hidden) { margin: 16px 0; }
#bookModal #bkOverGrp:not(.hidden)   { margin-top: 16px; }
#bookModal .rv-pane                  { margin-bottom: 10px; }
#bookModal .form-actions             { margin-top: 26px; padding-bottom: 4px; }

/* ===== Booking wizard — room pre-assignment ===== */
/* the wizard now carries a room grid, so it runs on viewport % instead of the 980px cap —
   wide enough that the free doors are all visible without scrolling the modal */
#bookModal .modal { width: 94%; max-width: 1280px; }

.rv-pick { margin: 16px 0 6px; }
.rv-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rv-pick-head h4 { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--navy-primary); display: flex; align-items: center; gap: 7px; }
.rv-pick-opt { background: rgba(var(--navy-primary-rgb), .09); color: var(--navy-primary); font-size: 10.5px;
    font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 999px; }
.rv-pick-note { font-size: 12px; color: var(--text-muted); }
.rv-pick-note strong { color: var(--warning); }

/* compact variant of the walk-in tiles: twenty doors have to fit without burying the buttons */
.rv-rooms-sm { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 9px;
    max-height: 272px; overflow-y: auto; padding: 2px 4px 2px 2px; margin-bottom: 0; }
.rv-rooms-sm .rv-room { aspect-ratio: auto; min-height: 0; gap: 3px; padding: 10px 8px; border-top-width: 5px; }
.rv-rooms-sm .rv-room-no { font-size: 19px; flex-direction: row; gap: 6px; }
.rv-rooms-sm .rv-room-no i { font-size: 11px; }
.rv-room-state { font-size: 10.5px; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.rv-room.active .rv-room-state { color: #fff; }

.rv-room-auto { border-style: dashed; border-top-color: var(--navy-primary); }
.rv-room-auto:hover { border-color: var(--navy-primary); }
.rv-room-auto.active { background: var(--navy-primary); border-color: var(--navy-primary); border-style: solid; }
.rv-room-held, .rv-room-blocked { cursor: not-allowed; opacity: .6; background: var(--bg-primary); }
.rv-room-held:hover, .rv-room-blocked:hover { background: var(--bg-primary); }
.rv-room-held { border-top-color: var(--danger); }
.rv-room-held:hover { border-color: var(--danger); }
.rv-room-blocked { border-top-color: #6B7280; }
.rv-room-blocked:hover { border-color: #6B7280; }
.rv-room-held .rv-room-state { color: var(--danger); }

body.dark-mode .rv-room-held, body.dark-mode .rv-room-blocked { background: rgba(0, 0, 0, .18); }

@media (max-width: 760px) {
    #bookModal .modal { width: 96%; }
    .rv-rooms-sm { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); max-height: 220px; }
    .rv-rooms-sm .rv-room-no { font-size: 17px; }
}

/* ===== KPI figures must never be sliced ===== */
/* the old clamp sized the number off the VIEWPORT, but the sidebar and the column count are what
   decide how wide a card actually is — on a 1366 laptop four cards land at ~253px while
   "$ 248,000.00" at 32px needs ~255px, so the figure was cut mid-digit under overflow:hidden.
   sizing off the grid fixes that, and an absurd number now ellipsises instead of vanishing. */
.lte-kpi-grid { container-type: inline-size; }
.small-box .inner h3 { font-size: clamp(20px, 2.6cqw, 32px); overflow: hidden; text-overflow: ellipsis; }

/* ===== Finance: one tab strip instead of a second header row ===== */
/* the window stamp rides on the right of the strip — a separate .section-header above the tabs
   would be a third line of the same information the page header already carries */
.rs-tabs-note { margin-left: auto; align-self: center; padding-bottom: 10px; font-size: 12px; white-space: nowrap; }
#paneChart .chart-container { height: 340px; }

@media (max-width: 720px) {
    .rs-tabs { flex-wrap: wrap; }
    .rs-tabs-note { margin-left: 0; width: 100%; padding: 0 0 8px; white-space: normal; }
    #paneChart .chart-container { height: 260px; }
}

/* ===== Row actions: never silently clip ===== */
/* a Tabulator cell hides its overflow, so an action column one icon too narrow simply eats the
   last button — the user cannot even see that Delete exists. wrapping makes a too-narrow column
   look wrong instead of quietly dropping an action. Widths are set per page so this never fires. */
.actions-cell { flex-wrap: wrap; row-gap: 2px; }

/* ===== Searchable dropdown: own your ink ===== */
/* the panel is rendered wherever the field sits, and the POS register's field sits inside
   .reg-top { color:#fff } — so every option inherited white on a white panel and the list read
   as blank space. only the selected row was visible, because that rule sets a colour of its own.
   A floating panel must never inherit text colour from whatever it happens to be placed in. */
.sd-panel { color: var(--text-primary); }
.sd-item  { color: var(--text-primary); }
.sd-item.selected { color: var(--navy-accent-ink, var(--navy-accent)); }

/* ===== Users: the add/edit dialog runs the width of the screen ===== */
/* it carries two whole sections — employment and login — so the shared 980px cap made it a long
   scroll. no max-width here: 90% means 90%, whatever the monitor is. */
#userModal .modal { width: 90%; max-width: none; }
/* …but a form is not a spreadsheet. auto-fit would lay six thin columns across a 1700px dialog,
   so past tablet width the grid is pinned to three; .span-2 still takes the whole row. */
@media (min-width: 1100px) { #userModal .form-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { #userModal .modal { width: 96%; } }

/* a badge on a submenu PARENT: the <li> is as tall as the open submenu, so centring on it would
   drop the pill somewhere in the middle of the sub-rows. pin it to the parent row and clear the
   chevron. the collapsed rail's own rule is more specific, so it still wins and shows a dot. */
.nav-pill-parent { top: 24px; right: 36px; }

/* an action the row's state forbids: visible, explained on hover, and not clickable */
.action-icon.is-locked { opacity: .32; cursor: not-allowed; }
.action-icon.is-locked:hover { background: transparent; transform: none; }

/* ===== Dashboard: charts left, what-needs-answering right ===== */
/* the rail is a fixed 360px because its rows are a fixed shape; the chart side takes whatever is
   left, so 2x2 stays 2x2 on a laptop instead of collapsing the moment the sidebar opens. */
.dash-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; margin-bottom: 20px; }
.dash-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dash-charts .lte-card { margin-bottom: 0; }
.dash-chart { height: 260px; }
.dash-rail { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-rail .lte-card { margin-bottom: 0; }
.dash-rail-body { padding: 6px; max-height: 420px; overflow-y: auto; }
.dash-rail-count { font-style: normal; background: var(--danger); color: #fff; font-size: 11px;
    font-weight: 800; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }

.lte-card-link { font-size: 12px; font-weight: 700; color: var(--navy-accent-ink, var(--navy-accent));
    text-decoration: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lte-card-link:hover { text-decoration: underline; }

/* one rail row: a date block, the who/what, and an optional tag on the right */
.rail-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-control);
    text-decoration: none; color: inherit; transition: background .15s; }
.rail-row:hover { background: var(--table-hover); }
.rail-row + .rail-row { border-top: 1px solid var(--border-light); }
.rail-day { flex: 0 0 42px; height: 42px; border-radius: var(--r-control); background: rgba(var(--navy-primary-rgb), .08);
    color: var(--navy-primary); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.rail-day strong { font-size: 16px; font-weight: 800; }
.rail-day small  { font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; opacity: .75; }
.rail-day.is-new { background: rgba(217, 119, 6, .12); color: #B45309; font-size: 15px; }
.rail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-title { font-size: 13px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-sub { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-tag { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--navy-primary);
    background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.rail-tag.is-wait { color: #B45309; background: rgba(217, 119, 6, .1); border-color: rgba(217, 119, 6, .25); }

body.dark-mode .rail-day { background: rgba(255, 255, 255, .07); color: var(--text-primary); }

@media (max-width: 1400px) { .dash-split { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) {
    .dash-split  { grid-template-columns: 1fr; }
    .dash-rail   { flex-direction: row; flex-wrap: wrap; }
    .dash-rail .lte-card { flex: 1 1 320px; }
}
@media (max-width: 700px) {
    .dash-charts { grid-template-columns: 1fr; }
    .dash-chart  { height: 230px; }
}

/* ===== New Booking — one screen: pick on the left, the deal on the right ===== */
.bk-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; align-items: stretch; }
/* .bk-pane, not .bk-pick — book.php already owns .bk-pick in two of its own blocks, and one of
   them is display:flex, which laid this whole pane out as a centred row */
.bk-pane { min-width: 0; padding-right: 22px; }
/* the divider is the rail's own border, so the two columns stay the same height */
.bk-rail { min-width: 0; padding-left: 22px; border-left: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 18px; }
.bk-rail-title { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--navy-primary);
    display: flex; align-items: center; gap: 7px; }
.bk-rail-block .form-grid { grid-template-columns: 1fr; gap: 12px; }
.bk-rail-block .form-group.span-2 { grid-column: auto; }

/* month line + the week strip */
.bk-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
    font-size: 13.5px; color: var(--text-secondary); }
.bk-month strong { color: var(--text-primary); font-weight: 700; }
.bk-month-nav button { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary);
    width: 28px; height: 28px; border-radius: var(--r-control); cursor: pointer; margin-left: 5px; }
.bk-month-nav button:hover { border-color: var(--navy-accent); color: var(--navy-accent); }

.bk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.bk-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 12px 4px; border: 2px solid transparent; background: var(--bg-primary); border-radius: var(--r-card);
    cursor: pointer; transition: border-color .15s, background .15s; }
.bk-day small  { font-size: 11px; color: var(--text-muted); }
.bk-day strong { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.bk-day:hover  { background: var(--table-hover); }
/* the chosen day is outlined, not filled — the filled treatment belongs to the room you pick */
.bk-day.is-on  { border-color: var(--navy-primary); background: var(--bg-card); }
.bk-day.is-off { opacity: .38; cursor: not-allowed; }
.bk-day.is-off:hover { background: var(--bg-primary); }

/* the footer: what is about to happen, and the one button that does it */
.bk-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.bk-foot-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.bk-foot-line i { color: var(--navy-accent-ink, var(--navy-accent)); }
.bk-foot-act { display: flex; gap: 10px; }

@media (max-width: 1000px) {
    .bk-split { grid-template-columns: 1fr; }
    .bk-pane  { padding-right: 0; }
    .bk-rail  { padding-left: 0; border-left: none; border-top: 1px solid var(--border-color); padding-top: 18px; margin-top: 18px; }
    .bk-rail-block .form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 640px) {
    .bk-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .bk-foot { flex-direction: column; align-items: stretch; }
    .bk-foot-act .btn { flex: 1; justify-content: center; }
}

/* ===== Printed documents: A4 booking voucher + 80mm thermal receipt ===== */
/* both are real pages, not popup strings, so the house rule holds: no <style> in the .php */
.doc-body { background: #eef1f0; margin: 0; padding: 24px 16px 60px; }
.doc-tools { max-width: 210mm; margin: 0 auto 16px; display: flex; gap: 10px; justify-content: flex-end; }
.doc-sheet { max-width: 210mm; margin: 0 auto; background: #fff; padding: 18mm 16mm;
    box-shadow: 0 2px 16px rgba(0,0,0,.12); color: #222; font-size: 12.5px; line-height: 1.55; }

.bv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
    border-bottom: 3px solid var(--navy-primary); padding-bottom: 14px; margin-bottom: 18px; }
.bv-brand { display: flex; gap: 14px; align-items: flex-start; }
.bv-logo { width: 58px; height: 58px; object-fit: contain; }
.bv-hotel { font-size: 19px; font-weight: 800; color: var(--navy-primary); }
.bv-addr { font-size: 11px; color: #667; line-height: 1.5; }
.bv-meta { text-align: right; }
.bv-doc { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: #667; }
.bv-no { font-size: 17px; font-weight: 800; color: var(--navy-primary); }
.bv-stat { display: inline-block; margin-top: 4px; font-size: 10.5px; font-weight: 800;
    color: #fff; background: var(--st, #6c757d); border-radius: 999px; padding: 2px 10px; }
.bv-issued { font-size: 10.5px; color: #8a94a0; margin-top: 4px; }

.bv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.bv-box { border: 1px solid #e3e8e6; border-radius: 4px; padding: 12px 14px; }
.bv-box h4 { margin: 0 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #8a94a0; }
.bv-name { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.bv-kv { width: 100%; border-collapse: collapse; }
.bv-kv td { padding: 2px 0; vertical-align: top; }
.bv-kv td:first-child { color: #8a94a0; width: 34%; }

.bv-money { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.bv-money th { background: var(--navy-primary); color: #fff; font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .6px; padding: 8px 10px; text-align: left; }
.bv-money td { padding: 8px 10px; border-bottom: 1px solid #eef1f0; }
.bv-money .r { text-align: right; }
.bv-money tfoot td { border: none; padding: 5px 10px; }
.bv-due td { border-top: 2px solid var(--navy-primary); font-size: 14px; font-weight: 800; color: var(--navy-primary); }
.bv-note { font-size: 11px; color: #8a94a0; margin: 0 0 16px; }

.bv-terms { border: 1px solid #e3e8e6; border-radius: 4px; padding: 12px 14px; margin-bottom: 22px; }
.bv-terms h4 { margin: 0 0 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #8a94a0; }
.bv-terms p { margin: 0 0 6px; font-size: 11.5px; }
.bv-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 18px; }
.bv-sign div { font-size: 11px; color: #667; }
.bv-sign span { display: block; border-top: 1px solid #888; margin-bottom: 5px; height: 42px; }
.bv-foot { text-align: center; font-size: 10.5px; color: #8a94a0; border-top: 1px solid #eef1f0; padding-top: 10px; }

/* --- 80mm roll: same page box as the POS ticket so one printer serves both --- */
.tr-body { padding: 20px 10px 50px; }
.tr-tools { max-width: 80mm; }
.tr-slip { width: 72mm; max-width: 72mm; margin: 0 auto; background: #fff; padding: 6mm 4mm; color: #000;
    font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.45; box-shadow: 0 2px 14px rgba(0,0,0,.14); }
.tr-hotel { text-align: center; font-size: 15px; font-weight: 700; }
.tr-sub { text-align: center; font-size: 10.5px; }
.tr-title { text-align: center; font-weight: 700; letter-spacing: 2px; margin: 4px 0; }
.tr-rule { border-top: 1px dashed #000; margin: 6px 0; }
.tr-line { display: flex; justify-content: space-between; gap: 8px; }
.tr-line span:first-child { color: #000; }
.tr-big { font-size: 13.5px; font-weight: 700; margin: 3px 0; }
.tr-note { font-size: 10px; margin-top: 8px; }
.tr-foot { text-align: center; font-size: 10.5px; }

/* NO @page here on purpose. It is document-wide, so one declared in this shared stylesheet
   silently retunes the invoice and quotation print margins that were set further up. Each
   document loads its own page box instead: a4.css for the voucher, thermal.css for the roll. */
@media print {
    .doc-body, .tr-body { background: #fff; padding: 0; }
    .doc-tools { display: none; }
    .doc-sheet { box-shadow: none; max-width: none; padding: 0; }
    /* the slip NEVER loses its width — stretching it to the sheet is what broke the roll */
    .tr-slip   { box-shadow: none; padding: 0; margin: 0; }
}

/* ===== Booking 360 — rides the room-360 shell (90% modal, split, own scroll) ===== */
.b360-guest { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.b360-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.b360-kv { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 12.5px; }
.b360-kv td { padding: 4px 0; vertical-align: top; border-bottom: 1px solid var(--border-light); }
.b360-kv td:first-child { color: var(--text-muted); width: 42%; }
.b360-kv tr:last-child td { border-bottom: none; }
.b360-docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.b360-docs .btn { flex: 1 1 auto; justify-content: center; }
.b360-table { font-size: 12.5px; }
.b360-table .r { text-align: right; }
/* a voided line or a reversed receipt stays visible — struck through, never deleted */
.b360-table tr.is-void td { opacity: .5; text-decoration: line-through; }
.r360-right .bk-rail-title { margin-top: 18px; }
.r360-right .rv-sum { margin-bottom: 4px; }

/* ===== Searchable dropdown: the panel must outrank whatever it opens inside ===== */
/* sdInit switches it to position:fixed while open so no scrollable ancestor can clip it — a
   modal body is exactly such an ancestor, and the list was being cut off at the modal's edge.
   Fixed means it must also sit above the modal (1000) and the sticky sidebar (1001). */
.searchable-dropdown.open .sd-panel { z-index: 1200; display: flex; flex-direction: column; overflow: hidden; }
/* the panel is given a max-height from the space actually available, so the list shrinks to fit
   instead of overflowing it */
.searchable-dropdown.open .sd-list { flex: 1 1 auto; min-height: 0; max-height: none; }
.searchable-dropdown.open .sd-search { flex: 0 0 auto; }

/* ===== Toggle switches stay round ===== */
/* the squared-input pass (".data-section input:not([type=file]) … { border-radius: 2px !important }")
   also matches a checkbox, so every toggle inside a data section was being squared into a little
   rectangle with a round knob rattling inside it. The pill is not an input box — it keeps its shape. */
.toggle,
.form-group .toggle,
.toggle-row .toggle { border-radius: 24px !important; }
.toggle::before { border-radius: 50% !important; }

/* ===== Check-in dialog: the room grid is the whole point, so give it the screen ===== */
/* it shipped as .modal-sm, which fits the summary but squeezes the room tiles into two columns —
   on a floor of twenty rooms that is a scroll instead of a glance. */
#assignModal .modal { width: 90%; max-width: none; }
@media (max-width: 760px) { #assignModal .modal { width: 96%; } }

/* ===== Dialogs wear the app's clothes ===== */
/* app.js swaps window.Swal for a branded mixin, so these classes land on every popup in the
   codebase without editing a single Swal.fire() call. buttonsStyling is off — the actions are
   our own .btn, so a dialog's buttons and a form's buttons can never drift apart. */
.rs-swal { border-radius: var(--r-card) !important; padding: 0 0 18px !important;
    background: var(--bg-card) !important; color: var(--text-primary) !important;
    box-shadow: 0 18px 50px rgba(0,0,0,.22) !important; }
.rs-swal-title { font-size: 17px !important; font-weight: 800 !important; color: var(--navy-primary) !important;
    padding: 20px 22px 6px !important; text-align: left !important; }
.rs-swal-body { font-size: 13.5px !important; color: var(--text-secondary) !important;
    padding: 0 22px !important; text-align: left !important; margin: 0 !important; }
.rs-swal .swal2-icon { margin: 16px auto 6px !important; }
.rs-swal-actions { padding: 0 22px !important; margin: 18px 0 0 !important; justify-content: flex-end !important; gap: 10px; }
.rs-swal-actions .btn { min-width: 108px; justify-content: center; }
body.dark-mode .rs-swal-title { color: var(--text-primary) !important; }

/* ===== POS: take payment in one tap ===== */
.pay-total { font-size: 26px; font-weight: 800; color: var(--navy-primary); text-align: center; margin: 4px 0 14px; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.pay-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 92px; padding: 12px 8px; border: 2px solid var(--border-color); border-radius: var(--r-card);
    background: var(--bg-card); color: var(--text-primary); cursor: pointer; transition: border-color .15s, background .15s; }
.pay-tile i { font-size: 20px; color: var(--navy-accent-ink, var(--navy-accent)); }
.pay-tile span { font-size: 13px; font-weight: 700; }
.pay-tile small { font-size: 10.5px; color: var(--text-muted); }
.pay-tile:hover { border-color: var(--navy-accent); background: var(--table-hover); }
/* charging the room is not "taking" money — it is deferring it, so it does not look like the rest */
.pay-tile.is-folio { border-style: dashed; border-color: var(--navy-primary); }
.pay-tile.is-folio i { color: var(--navy-primary); }
.pay-hint { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; }
body.dark-mode .rs-swal .pay-tile { background: rgba(255,255,255,.04); }

/* ===== Guest login handed over once ===== */
.gl-note { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; }
.gl-cred { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border-color);
    border-radius: var(--r-control); background: var(--bg-primary); }
.gl-cred span { font-size: 12px; color: var(--text-muted); }
.gl-cred b { font-family: 'Courier New', monospace; font-size: 15px; letter-spacing: .5px; color: var(--navy-primary); }
body.dark-mode .gl-cred b { color: var(--text-primary); }

/* ===== My Stay — the guest's own side of the app ===== */
/* deliberately not the staff shell: a sidebar with every item hidden reads as a broken app */
.ms-body { background: var(--bg-primary); margin: 0; min-height: 100vh; }
.ms-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 14px 22px; background: var(--navy-primary); color: #fff; }
.ms-brand { font-size: 16px; font-weight: 800; display: inline-flex; align-items: center; gap: 9px; }
.ms-who { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.ms-vip { font-style: normal; background: rgba(255,255,255,.16); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; }

.ms-wrap { max-width: 980px; margin: 0 auto; padding: 26px 16px 60px; }
.ms-hello h1 { margin: 0 0 4px; font-size: 24px; color: var(--navy-primary); }
.ms-hello p { margin: 0 0 20px; color: var(--text-muted); font-size: 13.5px; }

.ms-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 26px; }
.ms-kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-left: 3px solid var(--navy-accent); border-radius: var(--r-card); }
.ms-kpi i { font-size: 19px; color: var(--navy-accent-ink, var(--navy-accent)); }
.ms-kpi strong { display: block; font-size: 19px; font-weight: 800; line-height: 1.15; color: var(--text-primary); }
.ms-kpi span { font-size: 11.5px; color: var(--text-muted); }
.ms-kpi.is-due { border-left-color: var(--danger); }
.ms-kpi.is-due i, .ms-kpi.is-due strong { color: var(--danger); }

.ms-sect { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
    margin: 26px 0 12px; font-weight: 800; }
.ms-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-card);
    margin-bottom: 14px; overflow: hidden; }
.ms-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 13px 16px; border-bottom: 1px solid var(--border-light); background: var(--bg-primary); }
.ms-no { font-weight: 800; color: var(--navy-primary); margin-right: 10px; }
.ms-hotel { font-size: 12px; color: var(--text-muted); }
.ms-card-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; padding: 16px; }
.ms-fact span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.ms-fact b { display: block; font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 2px 0; }
.ms-fact small { font-size: 11.5px; color: var(--text-muted); }
.ms-fact.is-due b { color: var(--danger); }
.ms-card-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border-light); }

.ms-empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.ms-empty i { font-size: 44px; opacity: .4; }
.ms-empty h3 { margin: 12px 0 6px; color: var(--text-primary); }
.ms-foot { margin-top: 26px; text-align: center; font-size: 12.5px; color: var(--text-muted); }

/* ===== Item photos: the till and the store room ===== */
/* the tile keeps its old shape — the picture sits above the name and collapses to nothing when
   there is no file, so a catalogue with half the photos filled in still lines up */
/* ===== Till tiles ===== */
/* the picture band leads the tile and collapses to nothing when there is no file, so a catalogue
   with half its photos filled in still lines up. The tile keeps its own padding for the text. */
.reg-tile.has-pic { padding: 0 0 11px; overflow: hidden; }
.reg-tile.has-pic > :not(.reg-tile-pic):not(.reg-tile-code):not(.reg-tile-mod) { margin-left: 11px; margin-right: 11px; }
.reg-tile-pic { display: block; width: 100%; height: 84px; background: var(--bg-primary); overflow: hidden; }
.reg-tile-pic img { width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .25s; }
.reg-tile:hover .reg-tile-pic img { transform: scale(1.05); }
/* the code sits over the photo when there is one, in the card's own corner when there is not */
.reg-tile.has-pic .reg-tile-code { top: 8px; right: 8px; background: rgba(0, 0, 0, .55); color: #fff; }

/* name over two lines maximum, then the price is pinned to the bottom — every tile the same
   height whatever the name does, which is what makes a grid scannable at speed */
.reg-tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; }
.reg-tile-price { display: flex; align-items: baseline; gap: 6px; font-size: 15px; }
.reg-tile.has-pic { min-height: 168px; }
.reg-tile .reg-tile-tag:not(.reg-tile-mod) { align-self: flex-start; background: var(--bg-primary);
    border: 1px solid var(--border-light); border-radius: 999px; padding: 1px 8px; }
.reg-tile-mod { bottom: 10px; right: 10px; background: var(--bg-card); border-radius: 50%;
    width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.14); font-size: 11px; }

/* the picture leads the row. 64px is the smallest a towel and a bedsheet can be told apart at,
   which is the whole point of putting it there. */
.inv-row { display: flex; align-items: flex-start; gap: 12px; }
.inv-row-txt { min-width: 0; flex: 1; }
.inv-pic { flex: 0 0 64px; width: 64px; height: 64px; border-radius: var(--r-card); overflow: hidden;
    border: 1px solid var(--border-light); background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center; }
.inv-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* no photo yet, or the file went missing — the category icon keeps every row the same shape */
.inv-pic.is-empty, .inv-pic i { color: var(--text-muted); font-size: 22px; }
@media (max-width: 560px) { .inv-pic { flex-basis: 48px; width: 48px; height: 48px; } }

/* the "current photo" block both forms share */
.room-photo-now img { max-width: 220px; border-radius: var(--r-card); border: 1px solid var(--border-color); display: block; margin-bottom: 10px; }
