/* Intento Command Center — premium dark glassmorphism theme */

:root {
    --bg-0: #060a14;
    --bg-1: #0b1120;
    --bg-2: #101a2e;
    --bg-grad-a: #0e1a33;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.09);
    --text-hi: #eef2fb;
    --text-mid: #9aa7c2;
    --text-lo: #647089;
    --accent: #3b82f6;
    --accent-2: #06b6d4;
    --gold: #f0b90b;
    --green: #22c55e;
    --amber: #f59e0b;
    --red: #ef4444;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --chart-text: #9aa7c2;
    --chart-grid: rgba(255,255,255,0.06);
    --option-bg: #10182b;
    --sidebar-bg: rgba(6,10,20,0.6);
    --menu-btn-bg: rgba(11,17,32,0.85);
}

:root[data-theme="light"] {
    --bg-0: #eef1f7;
    --bg-1: #e4e9f2;
    --bg-2: #dbe1ec;
    --bg-grad-a: #f7f9fd;
    --glass: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(20, 30, 60, 0.10);
    --text-hi: #10192e;
    --text-mid: #4b5670;
    --text-lo: #6b7690;
    --shadow: 0 8px 28px rgba(30, 40, 70, 0.10);
    --chart-text: #4b5670;
    --chart-grid: rgba(20,30,60,0.08);
    --option-bg: #ffffff;
    --sidebar-bg: rgba(255,255,255,0.92);
    --menu-btn-bg: rgba(255,255,255,0.92);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: radial-gradient(circle at 15% 0%, var(--bg-grad-a) 0%, var(--bg-0) 55%),
                linear-gradient(160deg, var(--bg-0), var(--bg-1));
    color: var(--text-hi);
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background .2s ease, color .2s ease;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(20,30,60,0.15); }

a { color: inherit; text-decoration: none; }

.glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

/* ---------- Login ---------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(59,130,246,0.18), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(6,182,212,0.15), transparent 45%),
        var(--bg-0);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    text-align: center;
}

.login-brand {
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px;
}

.login-sub {
    color: var(--text-mid);
    font-size: 14px;
    margin-bottom: 28px;
}

.field {
    text-align: left;
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--text-mid);
    margin-bottom: 6px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-hi);
    font-size: 14px;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.btn-primary {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .5px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.35); }

.error-msg {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
}

.demo-hint {
    margin-top: 22px;
    font-size: 12px;
    color: var(--text-lo);
    line-height: 1.6;
}

/* ---------- App Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--glass-border);
    background: var(--sidebar-bg);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 6px 6px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--accent-2));
    box-shadow: 0 0 10px var(--gold);
}

.nav-item {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--text-mid);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.nav-item.active, .nav-item:hover {
    background: rgba(59,130,246,0.14);
    color: var(--text-hi);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 22px 28px 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
    font-weight: 700;
}

.topbar .meta { color: var(--text-mid); font-size: 12.5px; margin-top: 2px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
}

.user-chip .role { color: var(--text-mid); font-size: 11.5px; }

.logout-link { color: var(--red); font-size: 12.5px; margin-left: 10px; }

/* ---------- KPI Grid ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(6,182,212,0.03));
    pointer-events: none;
}

.kpi-label {
    font-size: 11.5px;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.kpi-value .unit { font-size: 14px; color: var(--text-mid); font-weight: 500; }

.kpi-trend { margin-top: 8px; font-size: 12px; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend.flat { color: var(--text-mid); }

/* ---------- Panels / Charts ---------- */
.panel {
    padding: 20px;
    margin-bottom: 20px;
}

.panel h2 {
    font-size: 15px;
    margin: 0 0 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }

@media (max-width: 980px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Project Table ---------- */
table.projects {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.projects th {
    text-align: left;
    color: var(--text-mid);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
}

table.projects td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}

table.projects tr:hover td { background: rgba(255,255,255,0.03); }
table.projects tr.clickable-row { cursor: pointer; }

/* ---------- Analytics ---------- */
.analytics-page h3 { margin: 26px 0 10px; font-size: 14.5px; }
.analytics-page h3:first-child { margin-top: 4px; }
.ai-summary-box {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.25);
}
.ai-summary-box .ai-summary-title {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--accent-2);
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-summary-box ul { margin: 0; padding-left: 18px; }
.ai-summary-box li { font-size: 13px; color: var(--text-hi); margin-bottom: 5px; line-height: 1.45; }
.ai-summary-box li:last-child { margin-bottom: 0; }
table.analytics { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
table.analytics th {
    text-align: right; color: var(--text-mid); font-weight: 600; font-size: 10.5px;
    text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px;
    border-bottom: 1px solid var(--glass-border);
}
table.analytics th:first-child { text-align: left; }
table.analytics td { text-align: right; padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
table.analytics td:first-child { text-align: left; color: var(--text-hi); }
table.analytics tr.total-row td { font-weight: 700; border-top: 1px solid var(--glass-border); border-bottom: none; }
.analytics-chart-wrap { position: relative; }

/* ---------- Productivity / schedule tables ---------- */
.schedule-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--glass-border); }
table.schedule { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
table.schedule th {
    text-align: left; color: var(--text-mid); font-weight: 600; font-size: 10.5px;
    text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px;
    background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--glass-border);
    position: sticky; top: 0;
}
table.schedule th.num, table.schedule td.num { text-align: right; }
table.schedule td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); }
table.schedule tr.wbs-root td { background: rgba(59,130,246,0.22); font-weight: 700; color: var(--text-hi); }
table.schedule tr.wbs-activity td { background: rgba(34,197,94,0.10); }
table.schedule tr.wbs-activity:hover td { background: rgba(34,197,94,0.18); }
table.schedule .expand-icon { display: inline-block; width: 14px; color: var(--text-mid); }
table.schedule td.act-name { display: flex; align-items: center; gap: 4px; }
.schedule-caveat { font-size: 11px; color: var(--text-lo); margin-top: 8px; font-style: italic; }

.proj-name { font-weight: 600; }
.proj-sub { color: var(--text-lo); font-size: 11.5px; }

.health-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 8px currentColor;
}

.health-green { color: var(--green); }
.health-amber { color: var(--amber); }
.health-red { color: var(--red); }

.progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.tab-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-mid);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
}

.tab-btn.active, .tab-btn:hover {
    background: rgba(59,130,246,0.14);
    color: var(--text-hi);
}

.filter-select {
    background: rgba(255,255,255,0.05);
    color: var(--text-hi);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

:root[data-theme="light"] .filter-select {
    background: rgba(20,30,60,0.04);
}

select.filter-select option,
select option {
    background: var(--option-bg);
    color: var(--text-hi);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.03);
    color: var(--text-mid);
    font-size: 13px;
    cursor: pointer;
}
.theme-toggle-btn:hover { color: var(--text-hi); }
:root[data-theme="light"] .theme-toggle-btn { background: rgba(20,30,60,0.04); }

/* ---------- Mobile hamburger + collapsible sidebar ---------- */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 60;
    width: 42px; height: 42px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--menu-btn-bg);
    backdrop-filter: blur(10px);
    color: var(--text-hi);
    font-size: 18px;
    cursor: pointer;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 45;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .mobile-menu-btn { display: block; }

    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: 240px;
        height: 100vh;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        padding: 66px 16px 16px;
        z-index: 50;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }

    .sidebar-brand { display: none; }
    .nav-item { width: auto; height: auto; padding: 10px 12px; justify-content: flex-start; }
    .nav-item span.label { display: inline; }
    .main { padding: 70px 14px 16px; }
    table.projects { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- Desktop sidebar collapse (separate from the mobile hamburger above) ---------- */
.sidebar-collapse-btn {
    margin-left: auto;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-mid);
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover { color: var(--text-hi); border-color: var(--accent); }

.sidebar-expand-btn {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 60;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--menu-btn-bg);
    backdrop-filter: blur(10px);
    color: var(--text-hi);
    font-size: 16px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

@media (min-width: 861px) {
    html.sidebar-collapsed .sidebar { display: none; }
    html.sidebar-collapsed .sidebar-expand-btn { display: flex; }
}

/* ---- 3D (Beta) element viewer ---- */
.beta-legend-chip {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 3px;
    margin: 0 4px 0 10px;
    vertical-align: middle;
}

.beta-viewer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
}

@media (max-width: 760px) {
    .beta-viewer-row { grid-template-columns: minmax(0, 1fr); }
}

.beta-element-panel {
    border-left: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.02);
    overflow-y: auto;
    max-height: 60vh;
    min-height: 400px;
}

.beta-element-panel .field input {
    padding: 9px 12px;
    font-size: 13px;
}

.beta-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.beta-field-grid .field { min-width: 0; }

@media (max-width: 420px) {
    .beta-field-grid { grid-template-columns: 1fr; }
}

.beta-modal {
    position: fixed;
    inset: 0;
    background: rgba(5,10,20,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.beta-modal-card {
    width: 100%;
    max-width: 760px;
    padding: 20px;
    border-radius: 14px;
}

/* ---- Automated Workflow demo page ---- */
.wf-hero {
    position: relative;
    overflow: hidden;
    padding: 32px 28px;
    text-align: center;
}
.wf-hero::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 20%, rgba(59,130,246,0.25), transparent 55%),
                radial-gradient(circle at 75% 70%, rgba(6,182,212,0.22), transparent 55%),
                radial-gradient(circle at 50% 100%, rgba(240,185,11,0.12), transparent 60%);
    animation: wfDrift 14s ease-in-out infinite alternate;
    z-index: 0;
}
@keyframes wfDrift {
    0% { transform: translate(-3%, -2%) scale(1); }
    100% { transform: translate(3%, 2%) scale(1.08); }
}
.wf-hero > * { position: relative; z-index: 1; }
.wf-hero-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--gold);
    border: 1px solid rgba(240,185,11,0.4);
    background: rgba(240,185,11,0.1);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
    animation: wfPulseGlow 2.4s ease-in-out infinite;
}
@keyframes wfPulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240,185,11,0.35); }
    50% { box-shadow: 0 0 0 6px rgba(240,185,11,0); }
}
.wf-hero-title {
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 800;
    margin: 0 0 10px;
    line-height: 1.25;
}
.wf-gradient-text {
    background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--gold), var(--accent));
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: wfGradientMove 6s linear infinite;
}
@keyframes wfGradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}
.wf-hero-sub {
    color: var(--text-mid);
    font-size: 14px;
    max-width: 620px;
    margin: 0 auto 20px;
}
.wf-play-btn {
    width: auto;
    padding: 13px 30px;
    font-size: 14.5px;
    border-radius: 999px;
    box-shadow: 0 0 0 0 rgba(59,130,246,0.5);
    animation: wfBtnPulse 2.6s ease-in-out infinite;
}
@keyframes wfBtnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.45); }
    50% { box-shadow: 0 0 0 10px rgba(59,130,246,0); }
}
.wf-steps-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.wf-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    transition: transform .3s ease, background .3s ease;
}
.wf-step-icon {
    font-size: 22px;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    transition: all .35s ease;
}
.wf-step.active .wf-step-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 18px rgba(59,130,246,0.55);
    transform: scale(1.12);
}
.wf-step.done .wf-step-icon {
    background: linear-gradient(135deg, var(--green), var(--accent-2));
}
.wf-step-label { font-size: 11.5px; color: var(--text-mid); font-weight: 600; white-space: nowrap; }
.wf-step.active .wf-step-label, .wf-step.done .wf-step-label { color: var(--text-hi); }
.wf-step-line {
    width: 40px; height: 2px;
    background: var(--glass-border);
    position: relative;
    overflow: hidden;
}
.wf-step-line.filled::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    animation: wfLineFill .5s ease forwards;
}
@keyframes wfLineFill { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.wf-upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 14px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .25s ease, background .25s ease, transform .25s ease;
    position: relative;
}
.wf-upload-zone:hover, .wf-upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(59,130,246,0.06);
}
.wf-upload-zone.dragover { transform: scale(1.01); }
.wf-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: inline-block;
    transition: transform .3s ease;
}
.wf-upload-zone:hover .wf-upload-icon { transform: translateY(-4px); }
.wf-upload-icon.flying {
    animation: wfFlyIn 1.4s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes wfFlyIn {
    0% { transform: translate(-140px, -60px) rotate(-25deg) scale(0.6); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: translate(0,0) rotate(0deg) scale(1); }
}

.wf-progress-wrap {
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
    margin-top: 14px;
}
.wf-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    background-size: 200% 100%;
    animation: wfShimmer 1.2s linear infinite;
    transition: width .25s ease;
}
@keyframes wfShimmer { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

.wf-check-pop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--green);
    color: #04140a;
    font-size: 12px;
    font-weight: 800;
    transform: scale(0);
    animation: wfPop .4s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes wfPop { to { transform: scale(1); } }

.wf-counter { font-variant-numeric: tabular-nums; }

.wf-device-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    padding: 20px 0;
}
.device-frame {
    background: #05070d;
    border: 6px solid #1a2030;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.04);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.device-frame.phone {
    width: 240px; height: 500px;
    border-radius: 34px;
}
.device-frame.phone::before {
    content: '';
    position: absolute;
    top: 8px; left: 50%; transform: translateX(-50%);
    width: 70px; height: 16px;
    background: #05070d;
    border-radius: 10px;
    z-index: 2;
}
.device-frame.tablet {
    width: 360px; height: 480px;
    border-radius: 20px;
}
.device-frame iframe {
    border: 0;
    display: block;
    background: #0b1120;
}
.device-frame.phone iframe { width: 375px; height: 780px; transform: scale(0.64); transform-origin: top left; }
.device-frame.tablet iframe { width: 900px; height: 1200px; transform: scale(0.4); transform-origin: top left; }
.device-caption { text-align: center; font-size: 12.5px; color: var(--text-mid); margin-top: 10px; font-weight: 600; }

.wf-element-panel {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
}

.wf-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}
.wf-sync-badge.synced { background: rgba(34,197,94,0.15); color: var(--green); }
.wf-sync-badge.syncing { background: rgba(240,185,11,0.15); color: var(--gold); animation: wfPulseGlow 1s ease-in-out infinite; }
.wf-sync-badge.pending { background: rgba(255,255,255,0.08); color: var(--text-mid); }

@media (max-width: 640px) {
    .device-frame.tablet { display: none; }
}

/* ---------- Sidebar groups (Planning / BIM) ---------- */
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '▸'; margin-left: auto; font-size: 11px; opacity: .7; transition: transform .15s; }
.nav-group[open] > summary::after { transform: rotate(90deg); }
.nav-sub { margin: 4px 0 0 14px; font-size: 12.5px; }
