/* Layout B – top navigation, dark green, denser. Loaded after app.css only when this layout is
   selected (button in the top bar). Overrides only; all templates are shared with layout A. */

:root {
    --bg: #f3f6f4;
    --surface: #ffffff;
    --surface-2: #ecf2ee;
    --border: #d8e2db;
    --text: #13201a;
    --muted: #56685d;
    --accent: #1d5c3f;
    --accent-strong: #154630;
    --accent-soft: #e1efe6;
    --on-accent: #ffffff;
    --chart: #2e7d55;
    --shadow: 0 1px 2px rgba(12, 36, 22, .06);
    --radius: 6px;
    --radius-sm: 4px;
    --header-bg: #10291c;
    --header-text: rgba(255, 255, 255, .72);
    --header-hover: rgba(255, 255, 255, .07);
    --header-accent: #6fcf97;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #09130e;
        --surface: #0f1d16;
        --surface-2: #15281e;
        --border: #22392c;
        --text: #e4ede7;
        --muted: #91a698;
        --accent: #6cc49a;
        --accent-strong: #9adbb9;
        --accent-soft: #0f2e1f;
        --on-accent: #05130b;
        --chart: #6cc49a;
        --shadow: none;
        --header-bg: #06100a;
    }
}
:root[data-theme="dark"] {
    --bg: #09130e;
    --surface: #0f1d16;
    --surface-2: #15281e;
    --border: #22392c;
    --text: #e4ede7;
    --muted: #91a698;
    --accent: #6cc49a;
    --accent-strong: #9adbb9;
    --accent-soft: #0f2e1f;
    --on-accent: #05130b;
    --chart: #6cc49a;
    --shadow: none;
    --header-bg: #06100a;
}

body { font-size: 14px; }
h1 { font-size: 1.45rem; font-weight: 600; }
h2 { font-size: .95rem; font-weight: 650; }

/* ---------- header: the sidebar becomes a horizontal bar on wide screens ---------- */
@media (min-width: 861px) {
    .shell { flex-direction: column; }
    .sidebar {
        position: sticky; top: 0; z-index: 20;
        width: 100%; height: 56px;
        flex-direction: row; align-items: stretch; gap: 20px;
        padding: 0 24px;
        background: var(--header-bg);
        border-right: 0;
    }
    .brand { display: flex; align-items: center; padding: 0; }
    .brand img { height: 48px; width: auto; padding: 3px 6px; }
    .sidebar nav { flex-direction: row; gap: 0; }
    .sidebar .nav-link {
        border-radius: 0; padding: 0 14px; gap: 8px;
        color: var(--header-text);
        border-top: 3px solid transparent; border-bottom: 3px solid transparent;
    }
    .sidebar .nav-link .icon { width: 18px; height: 18px; }
    .sidebar .nav-link:hover { background: var(--header-hover); color: #fff; }
    .sidebar .nav-link.active { background: transparent; color: #fff; border-bottom-color: var(--header-accent); }
    .sidebar-foot { flex-direction: row; margin: 0 0 0 auto; padding: 0; border-top: 0; }

    .topbar {
        position: static; height: 48px;
        background: var(--surface); backdrop-filter: none;
    }
    .customer { font-size: .95rem; }
    .content { max-width: 1400px; padding-top: 24px; }
}
@media (min-width: 861px) and (max-width: 1180px) {
    .sidebar { gap: 8px; padding: 0 12px; }
    .sidebar .nav-link { padding: 0 10px; }
    .sidebar-foot .nav-link span { display: none; }
}
@media (min-width: 861px) and (max-width: 1000px) {
    .sidebar nav .nav-link .icon { display: none; }
}
/* mobile drawer keeps the A behaviour, just in the header colours */
@media (max-width: 860px) {
    .sidebar { background: var(--header-bg); border-right: 0; }
    .sidebar .nav-link { color: var(--header-text); }
    .sidebar .nav-link:hover { background: var(--header-hover); color: #fff; }
    .sidebar .nav-link.active { background: var(--header-hover); color: #fff; box-shadow: inset 3px 0 0 var(--header-accent); }
    .sidebar-foot { border-top-color: rgba(255, 255, 255, .12); }
}

/* ---------- building blocks ---------- */
.card { padding: 16px 18px; }
.stat { border-top: 3px solid var(--accent); padding: 14px 16px; }
.stat-alert { border-top-color: var(--bad); }
.stat-value { font-size: 1.65rem; font-weight: 600; }
.btn { min-height: 34px; padding: 0 14px; font-weight: 600; }
.btn-sm { min-height: 28px; }
.input { min-height: 34px; padding: 6px 10px; }
.badge { border-radius: 4px; padding: 1px 8px; }
.segmented, .segmented a { border-radius: 4px; }
.toolbar { padding: 10px 12px; }

.table { font-size: .88rem; }
.table th, .table td { padding: 7px 12px; }
.table th { background: transparent; border-bottom: 2px solid var(--border); font-size: .74rem; }
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tenant-table tbody tr:nth-child(even) { background: transparent; }

.tabs a.active { color: var(--text); }

/* ---------- login ---------- */
body.guest { background: linear-gradient(160deg, var(--header-bg) 0 38%, var(--bg) 38%); }
.guest-card { border-radius: 8px; box-shadow: 0 12px 32px rgba(8, 26, 16, .18); }
.guest-foot { color: var(--muted); }
