/* ============================================================
   Digital Workplace Hub — Design System
   Corporate Light Theme · Endress+Hauser Color DNA
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* E+H Brand Colors */
    --primary: #004B87;
    --primary-light: #00A0E3;
    --primary-lighter: #E8F4FD;
    --primary-dark: #003560;
    --accent: #00A0E3;

    /* Semantic */
    --success: #64A70B;
    --success-light: #EFF8E5;
    --warning: #E8A317;
    --warning-light: #FDF6E3;
    --danger: #D32F2F;
    --danger-light: #FDECEC;
    --info: #00A0E3;
    --info-light: #E8F4FD;

    /* Neutrals */
    --bg: #F5F6F8;
    --bg-card: #FFFFFF;
    --bg-sidebar: #004B87;
    --bg-hover: #F0F1F3;
    --bg-active: rgba(0, 75, 135, 0.06);

    --text: #1A1D23;
    --text-secondary: #5A6170;
    --text-muted: #8C92A0;
    --text-on-primary: #FFFFFF;
    --text-on-sidebar: rgba(255, 255, 255, 0.85);

    --border: #E2E5EA;
    --border-light: #ECEEF2;
    --divider: #E2E5EA;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

    /* Layout */
    --sidebar-width: 264px;
    --header-height: 56px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;

    /* Type */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    /* Chart colors */
    --chart-1: #004B87;
    --chart-2: #00A0E3;
    --chart-3: #64A70B;
    --chart-4: #E8A317;
    --chart-5: #D32F2F;
    --chart-6: #7C3AED;
    --chart-7: #0891B2;
    --chart-8: #DB2777;
}

html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---- Layout Shell ---- */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    background: var(--bg-sidebar);
    color: var(--text-on-sidebar);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 8px;
}
.brand-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.brand-icon i { width: 20px; height: 20px; }
.brand-text {
    font-size: 1.14rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.brand-accent { color: var(--primary-light); font-weight: 300; }

.sidebar-section { padding: 4px 12px; }
.sidebar-label {
    font-size: 0.71rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    padding: 16px 8px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    position: relative;
    margin-bottom: 1px;
}
.nav-item i { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.75; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
    font-weight: 500;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 2px 2px 0;
}
.nav-item-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-item-label { font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item-desc { font-size: 0.71rem; color: rgba(255,255,255,0.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.71rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.78rem; color: #fff;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-weight: 600; font-size: 0.86rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.71rem; color: rgba(255,255,255,0.45); }

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    height: var(--header-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.07rem; font-weight: 600; color: var(--text);
}
.header-title i { color: var(--primary); width: 20px; height: 20px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-search {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
    min-width: 200px;
}
.header-search i { width: 16px; height: 16px; }
.header-search input {
    border: 0; background: transparent; outline: none;
    color: var(--text); font-family: inherit; font-size: inherit; width: 100%;
}
.header-icon-btn {
    width: 36px; height: 36px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer;
    transition: all 0.15s;
}
.header-icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.header-icon-btn i { width: 18px; height: 18px; }

.content-area {
    padding: 24px 28px;
    flex: 1;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 16px;
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 0.86rem; color: var(--text-muted); margin-top: 2px; }
.card-icon {
    width: 36px; height: 36px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}

/* ---- KPI Cards ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 3px;
}
.kpi-card[data-color="blue"]::before { background: var(--primary); }
.kpi-card[data-color="green"]::before { background: var(--success); }
.kpi-card[data-color="orange"]::before { background: var(--warning); }
.kpi-card[data-color="red"]::before { background: var(--danger); }
.kpi-card[data-color="purple"]::before { background: #7C3AED; }
.kpi-card[data-color="cyan"]::before { background: var(--accent); }
.kpi-label {
    font-size: 0.71rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.kpi-value { font-size: 1.71rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.kpi-change { font-size: 0.78rem; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-change.neutral { color: var(--text-muted); }
.kpi-icon {
    position: absolute; top: 14px; right: 16px;
    width: 36px; height: 36px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); background: var(--bg);
}
.kpi-icon i { width: 18px; height: 18px; }

/* ---- Section Header ---- */
.section-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 20px;
}
.section-title { font-size: 1.21rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); width: 22px; height: 22px; }
.section-desc { color: var(--text-secondary); font-size: 0.93rem; margin-top: 4px; }

/* ROI Impact Badge */
.roi-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--success-light);
    color: #3D6B06;
    border: 1px solid #C5E1A5;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.roi-badge i { width: 14px; height: 14px; }

/* ---- Grids ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-sidebar { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.grid-sidebar-wide { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    line-height: 1.4;
}
.btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-lighter); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #568C09; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B71C1C; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 10px 22px; font-size: 0.93rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; min-width: 36px; }
.btn-group { display: flex; gap: 8px; }
.text-btn {
    background: none; border: none; color: var(--primary);
    cursor: pointer; font-size: 0.86rem; font-weight: 500; font-family: inherit;
    padding: 4px 0;
}
.text-btn:hover { text-decoration: underline; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.86rem; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 8px 12px;
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit; font-size: 0.93rem;
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,75,135,0.1); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.range-input { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--border); outline: none; }
.range-input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); cursor: pointer; border: 2px solid #fff; box-shadow: var(--shadow); }
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--border); border-radius: 11px;
    cursor: pointer; transition: 0.2s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    left: 3px; bottom: 3px;
    width: 16px; height: 16px;
    background: #fff; border-radius: 50%;
    transition: 0.2s; box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---- Tables ---- */
.table-container { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.data-table th {
    text-align: left; padding: 10px 14px;
    font-weight: 600; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table .table-cell-primary { font-weight: 600; color: var(--text); }
.data-table .table-cell-mono { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-secondary); }

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.71rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-blue { background: var(--primary-lighter); color: var(--primary); }
.badge-green { background: var(--success-light); color: #3D6B06; }
.badge-yellow { background: var(--warning-light); color: #8B6914; }
.badge-red { background: var(--danger-light); color: #B71C1C; }
.badge-purple { background: #F3E8FF; color: #6D28D9; }
.badge-cyan { background: #E8F4FD; color: #0369A1; }
.badge-orange { background: #FFF3E0; color: #C77800; }
.badge-gray { background: #F0F1F3; color: var(--text-secondary); }
.badge-outline { background: transparent; border: 1px solid currentColor; }

/* Status indicators */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }
.status-dot.blue { background: var(--primary); }
.status-dot.gray { background: var(--text-muted); }
.status-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.86rem; }

/* Traffic lights */
.traffic-light { display: flex; gap: 6px; }
.traffic-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--border); opacity: 0.3;
}
.traffic-dot.active-green { background: var(--success); opacity: 1; }
.traffic-dot.active-yellow { background: var(--warning); opacity: 1; }
.traffic-dot.active-red { background: var(--danger); opacity: 1; }

/* ---- Tabs ---- */
.tabs {
    display: flex; gap: 0; margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}
.tab {
    padding: 10px 18px; background: none; border: none;
    color: var(--text-secondary); font-family: inherit;
    font-size: 0.86rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Progress ---- */
.progress-bar {
    width: 100%; height: 6px; border-radius: 3px;
    background: var(--border-light); overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 3px;
    transition: width 0.6s ease;
    background: var(--primary);
}
.progress-fill.green { background: var(--success); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-fill.purple { background: #7C3AED; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 4px; }
.progress-label-text { font-size: 0.86rem; color: var(--text); }
.progress-label-value { font-size: 0.86rem; font-weight: 600; color: var(--text); }

/* ---- Chips ---- */
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.78rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
    font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Activity Feed ---- */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.71rem; color: #fff;
    flex-shrink: 0;
}
.activity-content { min-width: 0; }
.activity-text { font-size: 0.86rem; color: var(--text); line-height: 1.4; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.71rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Leaderboard ---- */
.leaderboard { display: flex; flex-direction: column; }
.leaderboard-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border-light);
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-rank {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.78rem; flex-shrink: 0;
    background: var(--bg); color: var(--text-secondary);
}
.leaderboard-rank.gold { background: #FEF3C7; color: #92400E; }
.leaderboard-rank.silver { background: #F1F5F9; color: #475569; }
.leaderboard-rank.bronze { background: #FED7AA; color: #9A3412; }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 600; font-size: 0.93rem; }
.leaderboard-dept { font-size: 0.78rem; color: var(--text-muted); }
.leaderboard-score { font-weight: 700; font-size: 1rem; color: var(--primary); }

/* ---- Charts ---- */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { width: 100% !important; }

/* ---- Instrument Cards ---- */
.instrument-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.instrument-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.instrument-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.instrument-card.status-good { border-left: 3px solid var(--success); }
.instrument-card.status-warning { border-left: 3px solid var(--warning); }
.instrument-card.status-critical { border-left: 3px solid var(--danger); }
.instrument-type { font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 500; }
.instrument-name { font-weight: 600; font-size: 1rem; margin: 4px 0; color: var(--text); }
.instrument-location { font-size: 0.78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.instrument-location i { width: 12px; height: 12px; }
.instrument-health { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.instrument-metrics { flex: 1; }
.metric-row { display: flex; justify-content: space-between; padding: 2px 0; }
.metric-label { font-size: 0.78rem; color: var(--text-muted); }
.metric-value { font-size: 0.78rem; font-weight: 600; color: var(--text); }

/* Health Ring SVG */
.health-ring {
    position: relative; width: 48px; height: 48px; flex-shrink: 0;
}
.health-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.health-ring .health-bg { fill: none; stroke: var(--border); stroke-width: 4; }
.health-ring .health-fill { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.health-ring span {
    position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
}

/* ---- Workflow Canvas ---- */
.workflow-canvas {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-height: 400px;
    padding: 24px;
    position: relative;
    background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 20px 20px;
}
.workflow-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 16px;
    box-shadow: var(--shadow);
    position: relative;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}
.workflow-block:hover { box-shadow: var(--shadow-md); }
.block-palette {
    display: flex; flex-direction: column; gap: 8px;
}
.palette-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 14px;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.86rem; font-weight: 500; color: var(--text);
}
.palette-block:hover { border-color: var(--primary); background: var(--primary-lighter); }
.palette-icon {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.palette-icon i { width: 16px; height: 16px; }

/* ---- Matrix (scatter quadrants) ---- */
.matrix-container { position: relative; }

/* ---- Quiz ---- */
.quiz-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all 0.15s; background: var(--bg-card);
}
.quiz-option:hover { border-color: var(--primary); background: var(--primary-lighter); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-lighter); }
.quiz-option.correct { border-color: var(--success); background: var(--success-light); }
.quiz-option.incorrect { border-color: var(--danger); background: var(--danger-light); }
.quiz-letter {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg); display: flex; align-items: center;
    justify-content: center; font-weight: 600; font-size: 0.78rem;
    color: var(--text-secondary); flex-shrink: 0;
}
.quiz-text { font-size: 0.86rem; color: var(--text); }

/* ---- Scanner ---- */
.scanner-container {
    position: relative; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg); min-height: 300px; padding: 20px;
}
.scanner-line {
    position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    animation: scanDown 2.5s ease-in-out infinite;
}
.scan-item {
    padding: 12px 16px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card);
    opacity: 0; animation: fadeIn 0.4s ease forwards;
}

/* ---- Comparison Grid ---- */
.comparison-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
.comparison-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
}
.comparison-card.before { border-left: 3px solid var(--danger); }
.comparison-card.after { border-left: 3px solid var(--success); }
.comparison-divider {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.comparison-divider i { width: 24px; height: 24px; }

/* ---- Report ---- */
.report-section {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); margin-bottom: 16px;
    overflow: hidden;
}
.report-section-header {
    padding: 14px 20px;
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 0.93rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.report-section-header i { width: 18px; height: 18px; color: var(--primary); }
.report-section-body { padding: 16px 20px; }

/* ---- Achievement Badges ---- */
.achievement-badge {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    text-align: center; opacity: 0.5; transition: all 0.3s;
}
.achievement-badge.earned { opacity: 1; border-color: var(--success); }
.achievement-badge.locked { opacity: 0.4; filter: grayscale(1); }
.achievement-icon { font-size: 1.5rem; margin-bottom: 8px; }
.achievement-name { font-weight: 600; font-size: 0.86rem; }
.achievement-desc { font-size: 0.71rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Tags ---- */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
    padding: 2px 8px; border-radius: 4px;
    font-size: 0.71rem; font-weight: 500;
    background: var(--bg); color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { margin-bottom: 12px; color: var(--text-muted); }
.empty-icon i { width: 40px; height: 40px; }
.empty-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-desc { font-size: 0.86rem; color: var(--text-muted); }

/* ---- Stat Row ---- */
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 0.86rem; color: var(--text-secondary); }
.stat-value { font-size: 0.86rem; font-weight: 600; color: var(--text); }

/* ---- Hero Number ---- */
.hero-number {
    font-size: 3rem; font-weight: 800; line-height: 1;
    color: var(--primary);
    letter-spacing: -0.03em;
}

/* ---- Divider ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 560px; max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95); transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-weight: 600; font-size: 1.07rem; display: flex; align-items: center; gap: 8px; }
.modal-title i { width: 20px; height: 20px; color: var(--primary); }
.modal-close {
    width: 32px; height: 32px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; transition: all 0.15s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-close i { width: 18px; height: 18px; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ---- Landing Page ---- */
.landing-hero {
    text-align: center;
    padding: 48px 40px 32px;
    max-width: 720px;
    margin: 0 auto;
}
.landing-hero-eyebrow {
    font-size: 0.78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--primary-light);
    margin-bottom: 12px;
}
.landing-hero-title {
    font-size: 2rem; font-weight: 800;
    color: var(--text); line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}
.landing-hero-roi {
    font-size: 3.2rem; font-weight: 900;
    color: var(--success);
    margin: 16px 0;
    letter-spacing: -0.04em;
}
.landing-hero-subtitle {
    font-size: 1.07rem; color: var(--text-secondary);
    line-height: 1.6; max-width: 560px; margin: 0 auto 24px;
}
.landing-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; max-width: 900px; margin: 0 auto 32px;
}
.landing-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    text-align: left; cursor: pointer;
    transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.landing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary); }
.landing-card-icon {
    width: 40px; height: 40px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px; color: #fff;
}
.landing-card-title { font-weight: 600; font-size: 0.93rem; margin-bottom: 4px; }
.landing-card-savings { font-size: 1.14rem; font-weight: 700; color: var(--success); margin-bottom: 4px; }
.landing-card-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }

.landing-footer-note {
    text-align: center; font-size: 0.78rem;
    color: var(--text-muted); padding: 24px 0;
    border-top: 1px solid var(--border); margin-top: 16px;
    max-width: 600px; margin-left: auto; margin-right: auto;
}
.landing-footer-note a { color: var(--primary); text-decoration: none; }
.landing-footer-note a:hover { text-decoration: underline; }

/* ---- Notification Toast ---- */
.notification-container { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.notification {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 16px;
    box-shadow: var(--shadow-md); max-width: 320px;
    display: flex; align-items: flex-start; gap: 10px;
    animation: slideInRight 0.3s ease;
}
.notification-icon { flex-shrink: 0; width: 20px; height: 20px; }
.notification-icon.success { color: var(--success); }
.notification-icon.error { color: var(--danger); }
.notification-icon.info { color: var(--primary); }
.notification-body { flex: 1; }
.notification-title { font-weight: 600; font-size: 0.86rem; }
.notification-text { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* ---- Utilities ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 0.86rem; }
.text-xs { font-size: 0.71rem; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.relative { position: relative; }

/* ---- Animations ---- */
.animate-in { animation: fadeIn 0.3s ease; }
.animate-slide-up { animation: slideUp 0.4s ease both; }
.animate-delay-1 { animation-delay: 0.08s; }
.animate-delay-2 { animation-delay: 0.16s; }
.animate-delay-3 { animation-delay: 0.24s; }
.animate-delay-4 { animation-delay: 0.32s; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes scanDown { 0% { top: 0; } 100% { top: 100%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: 200% center; } }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-sidebar { grid-template-columns: 1fr; }
    .grid-sidebar-wide { grid-template-columns: 1fr; }
    .comparison-grid { grid-template-columns: 1fr; }
    .comparison-divider { transform: rotate(90deg); }
}
@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }
    .sidebar { transform: translateX(-100%); }
    .grid-3 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .landing-hero-title { font-size: 1.5rem; }
    .landing-hero-roi { font-size: 2.2rem; }
}
