:root {
    --font: "DM Sans", system-ui, -apple-system, sans-serif;
    --bg-deep: #050810;
    --bg-panel: rgba(15, 23, 42, 0.72);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #6366f1;
    --success: #34d399;
    --danger: #f87171;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --radius: 18px;
}

[data-bs-theme="light"] {
    --bg-deep: #f1f5f9;
    --bg-panel: rgba(255, 255, 255, 0.82);
    --border: rgba(15, 23, 42, 0.08);
    --text: #0f172a;
    --muted: #64748b;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-deep);
    margin: 0;
}

.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

/* Login */
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.login-bg,
.app-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.22), transparent 35%),
        radial-gradient(circle at 85% 10%, rgba(14, 165, 233, 0.18), transparent 30%),
        radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.12), transparent 35%),
        linear-gradient(160deg, #050810 0%, #0f172a 45%, #050810 100%);
}

[data-bs-theme="light"] .login-bg,
[data-bs-theme="light"] .app-bg {
    background:
        radial-gradient(circle at 20% 15%, rgba(99, 102, 241, 0.12), transparent 35%),
        radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.1), transparent 30%),
        linear-gradient(180deg, #eef2ff 0%, #f8fafc 50%, #e2e8f0 100%);
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100vw - 2rem));
    padding: 1rem;
}

.login-card {
    padding: 2rem;
}

.login-brand {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.login-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.35);
}

.login-eyebrow {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.login-title {
    margin: 0.15rem 0 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.login-sub {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.login-form .form-control {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--text);
}

[data-bs-theme="light"] .login-form .form-control {
    background: #fff;
}

.login-form .form-control:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #0ea5e9 100%);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.35);
}

.btn-premium:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    color: #fff;
}

.login-foot {
    margin: 1.25rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
}

.login-foot a {
    color: #38bdf8;
}

/* Dashboard layout */
.dashboard-body {
    min-height: 100vh;
}

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 0.75rem 1rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Top navbar */
.app-navbar {
    position: sticky;
    top: 0.65rem;
    z-index: 200;
    padding: 0;
    overflow: hidden;
    margin-bottom: 1rem;
}

.navbar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
}

.navbar-row--main {
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

@media (min-width: 992px) {
    .navbar-row--main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        flex-wrap: nowrap;
    }

    .navbar-row--main > .navbar-brand {
        grid-column: 1;
        justify-self: start;
    }

    .navbar-row--main > .navbar-depts {
        grid-column: 2;
        justify-self: center;
        flex: none;
        max-width: min(100%, 920px);
    }

    .navbar-row--main > .navbar-tools {
        grid-column: 3;
        justify-self: end;
        margin-left: 0;
    }
}

.navbar-row--sub {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding-top: 0.55rem;
    padding-bottom: 0.65rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.navbar-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6366f1, #14b8a6);
    color: #fff;
    font-size: 1rem;
}

.navbar-brand-text strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.2;
}

.navbar-brand-text small {
    color: var(--muted);
    font-size: 0.72rem;
}

.navbar-toggle {
    margin-left: auto;
}

.navbar-depts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
}

.navbar-depts::-webkit-scrollbar {
    height: 4px;
}

.navbar-depts::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.nav-dept-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-dept-link i {
    font-size: 0.95rem;
    opacity: 0.85;
}

.nav-dept-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.nav-dept-link.is-active {
    color: #fff;
    background: color-mix(in srgb, var(--dept-accent, #6366f1) 22%, transparent);
    border-color: color-mix(in srgb, var(--dept-accent, #6366f1) 45%, transparent);
    box-shadow: 0 0 20px color-mix(in srgb, var(--dept-accent, #6366f1) 25%, transparent);
}

.navbar-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.navbar-user {
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--muted);
    max-width: 140px;
}

.navbar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 10px;
    font-size: 0.78rem;
}

.navbar-page-title h1 {
    margin: 0;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 700;
}

.navbar-page-title p {
    margin: 0.1rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.navbar-live-tools {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}

.content-wrap {
    padding: 0;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    color: var(--text);
}

.btn-icon.spin i {
    animation: spin 0.6s linear;
}

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

.refresh-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.refresh-time {
    color: var(--text);
    font-weight: 600;
}

.dept-grid {
    display: grid;
    gap: 1.25rem;
}

.dept-card[hidden] {
    display: none !important;
}

.dept-card.is-active {
    display: block;
}

.dept-card {
    padding: 1.15rem 1.25rem 1.35rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dept-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.dept-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.dept-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.dept-card-head--report {
    position: relative;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    margin-bottom: 1.15rem;
}

.dept-report-logo-wrap {
    flex-shrink: 0;
    z-index: 1;
}

.dept-report-logo {
    display: block;
    height: 72px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.dept-card-head--report .dept-report-heading {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
    white-space: nowrap;
    pointer-events: none;
}

.dept-card-head--report .dept-status {
    margin-left: auto;
    z-index: 1;
}

@media (max-width: 575.98px) {
    .dept-report-logo {
        height: 52px;
        max-width: 100px;
    }

    .dept-card-head--report .dept-report-heading {
        font-size: 1.05rem;
    }
}

.dept-card-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.dept-card-head p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.dept-status {
    margin-left: auto;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.dept-status.is-ok {
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.08);
}

.dept-status.is-error {
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
}

.kpi-tile,
.kpi-mini {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    min-height: 78px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.kpi-tile:hover,
.kpi-mini:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.kpi-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.chart-box {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.85rem;
    background: rgba(0, 0, 0, 0.12);
}

[data-bs-theme="light"] .chart-box {
    background: rgba(255, 255, 255, 0.65);
}

.chart-box-head {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: var(--muted);
}

.chart-canvas-wrap {
    position: relative;
    min-height: 240px;
}

.chart-canvas-wrap canvas {
    width: 100% !important;
    height: 240px !important;
}

.chart-skeleton {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    z-index: 2;
}

.chart-canvas-wrap.is-ready .chart-skeleton {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.skeleton-block {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.skeleton-block::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

@media (max-width: 991.98px) {
    .navbar-row--main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 0.55rem 0.75rem;
    }

    .navbar-brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .navbar-tools {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
    }

    .navbar-toggle {
        display: none;
    }

    .navbar-depts {
        display: flex;
        grid-column: 1 / -1;
        grid-row: 2;
        order: unset;
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
        padding: 0.35rem 0 0.15rem;
        border-top: 1px solid var(--border);
        mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    }

    .navbar-depts.is-open {
        display: flex;
    }

    .nav-dept-link {
        justify-content: center;
        border-radius: 999px;
        flex-shrink: 0;
        scroll-snap-align: start;
        min-height: 40px;
        touch-action: manipulation;
    }

    .navbar-row--sub {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .navbar-live-tools {
        margin-left: auto;
        justify-content: flex-end;
    }

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

@media (max-width: 575.98px) {
    .app-shell {
        padding: 0.5rem 0.65rem 1.5rem;
    }

    .app-shell--embed-full {
        padding-left: max(0.35rem, env(safe-area-inset-left));
        padding-right: max(0.35rem, env(safe-area-inset-right));
        padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    }

    .navbar-brand-text small {
        display: none;
    }

    .navbar-user {
        display: none !important;
    }

    .navbar-row {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .nav-dept-link {
        padding: 0.42rem 0.72rem;
        font-size: 0.76rem;
    }

    .nav-dept-link i {
        font-size: 0.88rem;
    }

    .refresh-pill .refresh-label {
        display: none;
    }

    .refresh-pill .refresh-time {
        font-size: 0.72rem;
    }

    .btn-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }

    .login-shell {
        width: min(440px, calc(100vw - 1.25rem));
        padding: 0.65rem;
        padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    }

    .login-card {
        padding: 1.35rem 1.15rem;
    }
}

/* F&B live snapshot — mirrors F&B/report.php Charts tab */
.fnb-live-report,
.fo-live-report {
    margin-top: 0.25rem;
}

.fnb-live-skeleton .fnb-skel-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.fnb-live-skeleton .fnb-skel-row--4 {
    grid-template-columns: repeat(2, 1fr);
}

.fnb-live-skeleton .fnb-skel-card {
    min-height: 88px;
    border-radius: 16px;
}

.fnb-live-skeleton .fnb-skel-panel {
    min-height: 200px;
    border-radius: 16px;
}

@media (min-width: 1200px) {
    .fnb-live-skeleton .fnb-skel-row {
        grid-template-columns: repeat(8, 1fr);
    }
    .fnb-live-skeleton .fnb-skel-row--4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.fnb-live-content {
    animation: fnbFadeIn 0.45s ease;
}

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

.fnb-stat-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.fnb-stat-grid--8 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fnb-stat-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .fnb-stat-grid--8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .fnb-stat-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .fnb-stat-grid--8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

.fnb-stat {
    display: flex;
    flex-direction: column;
    min-height: 88px;
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(0, 0, 0, 0.85));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="light"] .fnb-stat {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9));
}

.fnb-stat__label {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}

.fnb-stat__value {
    margin: 0.35rem 0 0;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.fnb-stat__value--xl {
    font-size: 2rem;
}

.fnb-stat__sub {
    margin: 0.25rem 0 0;
    font-size: 0.68rem;
    opacity: 0.65;
}

.fnb-stat--indigo { border-color: rgba(99, 102, 241, 0.25); }
.fnb-stat--indigo .fnb-stat__label { color: #a5b4fc; }
.fnb-stat--emerald { border-color: rgba(16, 185, 129, 0.25); }
.fnb-stat--emerald .fnb-stat__label { color: #6ee7b7; }
.fnb-stat--rose { border-color: rgba(244, 63, 94, 0.25); }
.fnb-stat--rose .fnb-stat__label { color: #fda4af; }
.fnb-stat--fuchsia { border-color: rgba(217, 70, 239, 0.25); }
.fnb-stat--fuchsia .fnb-stat__label { color: #f0abfc; }
.fnb-stat--sky { border-color: rgba(14, 165, 233, 0.25); }
.fnb-stat--sky .fnb-stat__label { color: #7dd3fc; }
.fnb-stat--amber { border-color: rgba(245, 158, 11, 0.25); }
.fnb-stat--amber .fnb-stat__label { color: #fcd34d; }
.fnb-stat--cyan { border-color: rgba(6, 182, 212, 0.25); }
.fnb-stat--cyan .fnb-stat__label { color: #67e8f9; }
.fnb-stat--yellow { border-color: rgba(234, 179, 8, 0.25); }
.fnb-stat--yellow .fnb-stat__label { color: #fde047; }
.fnb-stat--orange { border-color: rgba(249, 115, 22, 0.25); }
.fnb-stat--orange .fnb-stat__label { color: #fdba74; }
.fnb-stat--violet { border-color: rgba(139, 92, 246, 0.25); }
.fnb-stat--violet .fnb-stat__label { color: #c4b5fd; }
.fnb-stat--teal { border-color: rgba(20, 184, 166, 0.25); }
.fnb-stat--teal .fnb-stat__label { color: #5eead4; }

.fnb-stat--em {
    min-height: 120px;
}

.fnb-em-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.fnb-em-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.fnb-em-staff {
    margin: 0.5rem 0 0;
    font-size: 0.72rem;
    opacity: 0.8;
}

.fnb-leave-section {
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.75), rgba(0, 0, 0, 0.8));
}

.fnb-leave-headbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.fnb-leave-headbar h3 {
    margin: 0;
    font-size: 0.9rem;
}

.fnb-leave-headbar p {
    margin: 0.2rem 0 0;
    font-size: 0.72rem;
    color: var(--muted);
}

.fnb-from-db {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.3);
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.35), rgba(13, 148, 136, 0.35));
}

.fnb-leave-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 992px) {
    .fnb-leave-grid { grid-template-columns: 1fr 1fr; }
}

.fnb-leave-panel {
    padding: 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(2, 6, 23, 0.45);
}

.fnb-leave-panel__title {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fnb-leave-panel__hint {
    margin: 0.15rem 0 0.5rem;
    font-size: 0.65rem;
    color: var(--muted);
}

.fnb-leave-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fnb-leave-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.fnb-leave-table th,
.fnb-leave-table td {
    padding: 0.45rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.fnb-leave-head--amber {
    background: linear-gradient(90deg, rgba(120, 53, 15, 0.9), rgba(136, 19, 55, 0.85));
    color: #fff;
}

.fnb-leave-head--violet {
    background: linear-gradient(90deg, rgba(76, 29, 149, 0.9), rgba(15, 118, 110, 0.85));
    color: #fff;
}

.fnb-leave-row--a { background: rgba(15, 23, 42, 0.45); }
.fnb-leave-row--b { background: rgba(30, 41, 59, 0.35); }
.fnb-leave-empty { color: var(--muted); padding: 1rem !important; }

.fnb-outlets-section {
    margin-top: 0.85rem;
}

.fnb-outlets-title {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.fnb-outlet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 992px) {
    .fnb-outlet-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.fnb-outlet-card {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
}

.fnb-outlet-name {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.fnb-outlet-total {
    margin: 0.35rem 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.fnb-outlet-parts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    font-size: 0.65rem;
}

.fnb-outlet-parts strong {
    display: block;
    font-size: 0.78rem;
}

.fnb-outlet-parts span {
    opacity: 0.7;
}

.dept-card[data-dept="fnb"] {
    border-color: rgba(245, 158, 11, 0.15);
}

.fnb-charts-section {
    margin-top: 0.85rem;
}

.fnb-charts-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 1200px) {
    .fnb-charts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.fnb-chart-card {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
}

.fnb-chart-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fnb-chart-card__head h3 {
    margin: 0;
    font-size: 0.85rem;
}

.fnb-chart-card__hint {
    margin: 0.35rem 0 0.5rem;
    font-size: 0.68rem;
    color: var(--muted);
}

.fnb-chart-badge {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.fnb-chart-badge--sky { color: #7dd3fc; border-color: rgba(14, 165, 233, 0.35); }
.fnb-chart-badge--violet { color: #c4b5fd; border-color: rgba(139, 92, 246, 0.35); }
.fnb-chart-badge--teal { color: #5eead4; border-color: rgba(20, 184, 166, 0.35); }

.fnb-chart-canvas {
    position: relative;
    height: 220px;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(2, 6, 23, 0.45);
}

.fnb-report-grid {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.85rem;
}

@media (min-width: 1200px) {
    .fnb-report-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.fnb-report-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.fnb-report-panel {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
}

.fnb-report-panel__title {
    margin: 0;
    font-size: 0.85rem;
}

.fnb-report-panel__hint {
    margin: 0.25rem 0 0.55rem;
    font-size: 0.68rem;
    color: var(--muted);
}

.fnb-leave-head--sky {
    background: linear-gradient(90deg, rgba(12, 74, 110, 0.9), rgba(76, 29, 149, 0.85));
    color: #fff;
}

.fnb-leave-head--teal {
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.9), rgba(30, 58, 138, 0.85));
    color: #fff;
}

.fnb-leave-head--amber {
    background: linear-gradient(90deg, rgba(120, 53, 15, 0.9), rgba(136, 19, 55, 0.85));
    color: #fff;
}

.fnb-cocktail-cell {
    font-weight: 600;
    color: #fcd34d;
    text-align: left !important;
}

/* Front Office live snapshot */
.fo-live-skeleton .fo-skel-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.fo-live-skeleton .fo-skel-row--6 {
    grid-template-columns: repeat(2, 1fr);
}

.fo-live-skeleton .fo-skel-card {
    min-height: 100px;
    border-radius: 16px;
}

.fo-live-skeleton .fo-skel-charts {
    min-height: 280px;
    border-radius: 16px;
}

@media (min-width: 768px) {
    .fo-live-skeleton .fo-skel-row--6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.fo-live-content {
    animation: fnbFadeIn 0.45s ease;
}

.fo-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.85rem;
    font-size: 0.72rem;
    color: var(--muted);
}

.fo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

@media (min-width: 992px) {
    .fo-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.fo-kpi-card {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
}

.fo-kpi-card__title {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.fo-kpi-card--emerald { border-color: rgba(52, 211, 153, 0.2); }
.fo-kpi-card--rose { border-color: rgba(244, 114, 182, 0.2); }
.fo-kpi-card--violet { border-color: rgba(167, 139, 250, 0.2); }
.fo-kpi-card--sky { border-color: rgba(56, 189, 248, 0.2); }
.fo-kpi-card--amber { border-color: rgba(251, 191, 36, 0.2); }
.fo-kpi-card--teal { border-color: rgba(45, 212, 191, 0.2); }

.fo-kpi-metric {
    display: grid;
    gap: 0.35rem;
}

.fo-kpi-metric__row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.fo-kpi-metric__label {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.fo-kpi-metric__value {
    font-weight: 600;
}

.fo-kpi-occ {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
    text-align: center;
}

.fo-kpi-occ__pct {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.fo-kpi-occ__pct small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.fo-kpi-trip-line {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.fo-kpi-meals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.fo-kpi-meal {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    font-size: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.fo-kpi-meal--ai { background: rgba(59, 130, 246, 0.15); }
.fo-kpi-meal--fb { background: rgba(16, 185, 129, 0.15); }
.fo-kpi-meal--hb { background: rgba(245, 158, 11, 0.15); }
.fo-kpi-meal--hp { background: rgba(139, 92, 246, 0.15); }

.fo-section-title {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.fo-charts-section {
    margin-top: 0.5rem;
}

.fo-charts-subsection {
    margin-bottom: 0.85rem;
}

.fo-charts-subsection__label {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.fo-charts-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 992px) {
    .fo-charts-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.dept-card[data-dept="frontoffice"] {
    border-color: rgba(14, 165, 233, 0.15);
}

.dept-card[data-dept="reservations"] {
    border-color: rgba(167, 139, 250, 0.15);
}

.dept-card[data-dept="transport"] {
    border-color: rgba(20, 184, 166, 0.15);
}

.dept-card[data-dept="hod"] {
    border-color: rgba(168, 85, 247, 0.15);
}

.dept-card[data-dept="engineering"] {
    border-color: rgba(249, 115, 22, 0.15);
}

.dept-card[data-dept="housekeeping"] {
    border-color: rgba(20, 184, 166, 0.15);
}

.dept-card[data-dept="kitchen"] {
    border-color: rgba(239, 68, 68, 0.15);
}

.dept-card[data-dept="hr"] {
    border-color: rgba(236, 72, 153, 0.15);
}

/* Reservations snapshot */
.res-live-skeleton .res-skel-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.res-live-skeleton .res-skel-card {
    min-height: 100px;
    border-radius: 16px;
}

.res-live-skeleton .res-skel-charts {
    min-height: 280px;
    border-radius: 16px;
}

.res-kpi-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

/* Transport snapshot */
.tr-live-skeleton .tr-skel-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .tr-live-skeleton .tr-skel-row { grid-template-columns: repeat(4, 1fr); }
}

.tr-live-skeleton .tr-skel-card {
    min-height: 88px;
    border-radius: 16px;
}

.tr-live-skeleton .tr-skel-tables,
.tr-live-skeleton .tr-skel-charts {
    min-height: 180px;
    border-radius: 16px;
    margin-bottom: 0.75rem;
}

.tr-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 992px) {
    .tr-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.tr-tables-section {
    margin: 0.85rem 0;
}

.tr-tables-grid {
    display: grid;
    gap: 0.85rem;
}

@media (min-width: 992px) {
    .tr-tables-grid { grid-template-columns: 1fr 1fr; }
}

.tr-alert {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    font-size: 0.78rem;
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.25);
    background: rgba(120, 53, 15, 0.2);
}

.res-live-report,
.tr-live-report {
    margin-top: 0.25rem;
}

/* Embedded live department reports */
.dept-grid--embed {
    gap: 0;
}

.dept-card--embed {
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
}

.dept-card--embed .dept-embed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.35);
}

.dept-embed-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.dept-embed-wrap {
    height: calc(100vh - 220px);
    min-height: 640px;
    background: #050810;
}

.dept-report-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}

@media (max-width: 767.98px) {
    .dept-embed-wrap {
        height: calc(100vh - 260px);
        min-height: 520px;
    }
}

.dashboard-embed-body,
.dashboard-embed-main {
    background: transparent;
}

.dept-status.is-loading {
    color: var(--muted);
}

#manualRefresh.is-spinning i {
    animation: spin 0.8s linear infinite;
}

/* Full-page embedded reports — iframe fills viewport below navbar */
.dashboard-body--embed-full {
    overflow: hidden;
    min-height: 100dvh;
}

.dashboard-body--embed-full .app-shell--embed-full {
    max-width: none;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    padding: 0.45rem;
    padding-top: max(0.45rem, env(safe-area-inset-top));
    padding-left: max(0.45rem, env(safe-area-inset-left));
    padding-right: max(0.45rem, env(safe-area-inset-right));
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.dashboard-body--embed-full .app-navbar {
    flex-shrink: 0;
    margin-bottom: 0.45rem;
    top: 0;
    position: relative;
    border-radius: 14px;
}

.dashboard-body--embed-full .navbar-row--main {
    padding: 0.55rem 0.75rem 0.45rem;
}

.dashboard-body--embed-full .navbar-row--sub {
    padding: 0.35rem 0.75rem 0.45rem;
    justify-content: flex-end;
}

.dashboard-body--embed-full .navbar-page-title {
    display: none;
}

.dashboard-body--embed-full .content-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-body--embed-full .dept-grid--embed {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-body--embed-full .dept-card--embed {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
}

.dashboard-body--embed-full .dept-card--embed.is-active {
    display: flex;
}

.dashboard-body--embed-full .dept-card--embed:hover {
    transform: none;
    box-shadow: none;
}

.dashboard-body--embed-full .dept-embed-toolbar {
    display: none;
}

.dashboard-body--embed-full .dept-embed-wrap {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
    border-radius: 8px;
}

.dashboard-body--embed-full .dept-report-iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
}

@media (max-width: 991.98px) {
    .dashboard-body--embed-full .navbar-row--sub {
        padding-top: 0.25rem;
        padding-bottom: 0.35rem;
    }

    .dashboard-body--embed-full .app-navbar {
        border-radius: 12px;
    }
}

@media (max-width: 767.98px) {
    .dashboard-body--embed-full .app-shell--embed-full {
        padding: 0.35rem;
        padding-top: max(0.35rem, env(safe-area-inset-top));
        padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    }

    .dashboard-body--embed-full .navbar-row--main {
        padding: 0.5rem 0.65rem 0.35rem;
    }

    .dashboard-body--embed-full .navbar-row--sub {
        padding: 0.25rem 0.65rem 0.35rem;
    }

    .dashboard-body--embed-full .dept-embed-wrap {
        min-height: 0;
    }
}

@media (min-width: 992px) {
    .dashboard-body--embed-full .navbar-row--main {
        padding: 0.65rem 1rem 0.55rem;
    }

    .dashboard-body--embed-full .nav-dept-link {
        padding: 0.48rem 0.9rem;
    }
}

@media (min-width: 1200px) {
    .dashboard-body--embed-full .app-shell--embed-full {
        padding: 0.55rem;
    }
}

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

