/* Cascais Studio — Design System (Finanzsurfer Brand) */
:root {
    --bg: #EDE6DE;
    --surface: #FAF7F4;
    --text: #1a1a1a;
    --text-muted: #7a6e63;
    --border: #d9cfc5;
    --accent: #8D5F4E;
    --accent-light: #e8d5cc;
    --green: #059669;
    --green-light: #d1fae5;
    --red: #dc2626;
    --red-light: #fee2e2;
    --yellow: #d97706;
    --yellow-light: #fef3c7;
    --orange: #FE805A;
    --orange-light: #fde0d5;
    --navy: #1F3B4D;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(31,59,77,0.08);
    --shadow-lg: 0 4px 12px rgba(31,59,77,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Nav */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--navy);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand a { color: white; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.nav-subtitle { font-size: 0.75rem; opacity: 0.7; margin-left: 0.75rem; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    transition: all 0.15s;
}
.nav-links a:hover { background: rgba(255,255,255,0.15); color: white; }
.nav-links a.active { background: rgba(255,255,255,0.2); color: white; font-weight: 600; }

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 2px;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255,255,255,0.25);
}
.lang-option {
    text-decoration: none;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.15s;
    opacity: 0.5;
}
.lang-option:hover { opacity: 0.8; background: rgba(255,255,255,0.1); }
.lang-active { opacity: 1; background: rgba(255,255,255,0.15); }

/* Main */
.main { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem; }

/* Page Header */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.btn:hover { opacity: 0.9; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-active { background: var(--navy); color: white !important; font-weight: 600; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

/* Selector groups: non-active buttons look muted */
.scenario-selector .btn-sm:not(.btn-active),
.model-toggle .btn-sm:not(.btn-active) {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.scenario-selector .btn-sm:not(.btn-active):hover,
.model-toggle .btn-sm:not(.btn-active):hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { color: var(--red) !important; }
.btn-danger:hover { border-color: var(--red) !important; background: var(--red-light) !important; }

/* Hero Cards (Dashboard) */
.hero-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.hero-card--primary { border-color: var(--navy); border-width: 2px; }
.hero-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.hero-card-header h3 { font-size: 1.1rem; }
.badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: rgba(31,59,77,0.1);
    color: var(--navy);
    border-radius: 99px;
    font-weight: 600;
}
.hero-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.hero-metric { display: flex; flex-direction: column; }
.hero-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.hero-value { font-size: 1.2rem; font-weight: 700; }
.hero-value.profit { color: var(--green); }
.hero-value.loss { color: var(--red); }
.hero-value.cost { color: var(--text-muted); }
.hero-card-footer { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.pillar {
    text-align: center;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.pillar-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.pillar h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.pillar p { font-size: 0.8rem; color: var(--text-muted); }

/* Model Layout */
.model-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; align-items: start; }
.model-toggle { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.toggle-label { font-size: 0.85rem; color: var(--text-muted); }

/* Parameters Panel */
.model-params {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    position: sticky;
    top: 60px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}
.model-params details { margin-bottom: 0.5rem; }
.model-params summary {
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--bg);
}
.model-params summary:hover { background: var(--border); }
.param-group { padding: 0.75rem 0.5rem; }
.param-group h4 { font-size: 0.8rem; color: var(--accent); margin: 0.5rem 0 0.25rem; }
.param-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.param-group label span { min-width: 3rem; text-align: right; font-weight: 600; color: var(--text); }
.param-group input[type="range"] { flex: 1; min-width: 80px; accent-color: var(--accent); }
.param-group input[type="number"],
.param-group select {
    width: 90px;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
}
.param-group input[type="checkbox"] { width: auto; }
.param-calc {
    margin-top: 0.5rem;
    padding: 0.45rem 0.6rem;
    background: rgba(31,59,77,0.06);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--navy);
    line-height: 1.6;
    font-weight: 500;
}

/* Scenario selector */
.scenario-selector { display: flex; gap: 0.3rem; margin-top: 0.5rem; flex-wrap: wrap; }

/* Results Panel */
.model-results { min-width: 0; }
.results-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 0.75rem; }
.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.result-card.result-positive { }
.result-card.result-positive .result-value { color: var(--green); }
.result-card.result-negative { border-color: var(--red); background: var(--red-light); }
.result-card.result-negative .result-value { color: var(--red); }
.result-card { position: relative; }
.result-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; display: block; }

/* KPI Help Icon */
.kpi-help {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: all 0.15s;
    line-height: 1;
}
.kpi-help:hover { background: var(--navy); color: white; }
.kpi-help::after {
    content: attr(data-tooltip);
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--navy);
    color: white;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: 260px;
    text-transform: none;
    text-align: left;
    z-index: 50;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}
.kpi-help:hover::after { display: block; }
.result-value { font-size: 1.4rem; font-weight: 700; display: block; margin: 0.25rem 0; }
.result-sub { font-size: 0.75rem; color: var(--text-muted); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; }
.data-table .sub-row td { padding-left: 1.5rem; color: var(--text-muted); font-size: 0.8rem; }
.data-table .total-row { background: var(--bg); }
.data-table-sm td, .data-table-sm th { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.row-negative { color: var(--red); }
.profit { color: var(--green); }
.loss { color: var(--red); }

.results-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.results-section h3 { font-size: 1rem; margin-bottom: 0.75rem; }

/* Cash Flow Chart */
.cf-chart { display: flex; gap: 0; margin: 0.75rem 0 0.5rem; }
.cf-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 20px; /* align with plot area, leaving room for x-labels */
    min-width: 60px;
    text-align: right;
    padding-right: 8px;
}
.cf-y-label { font-size: 0.65rem; color: var(--text-muted); line-height: 1; }
.cf-plot-area { flex: 1; position: relative; min-width: 0; }
.cf-gridlines { position: absolute; inset: 0; bottom: 20px; pointer-events: none; }
.cf-gridline {
    position: absolute;
    left: 0; right: 0;
    border-bottom: 1px dashed var(--border);
}
.cf-bars {
    display: flex;
    gap: 2px;
    height: 200px;
    align-items: stretch;
    position: relative;
}
.cf-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.cf-bar-stack {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}
.bar { width: 100%; border-radius: 2px 2px 0 0; min-height: 1px; transition: height 0.3s; }
.bar-revenue { background: rgba(31,59,77,0.15); border: 1px solid var(--navy); }
.bar-profit { background: var(--green-light); border: 1px solid var(--green); position: absolute; bottom: 0; width: 100%; border-radius: 2px 2px 0 0; }
.cf-x-label { font-size: 0.6rem; color: var(--text-muted); margin-top: 2px; height: 16px; flex-shrink: 0; }

/* Tooltip */
.cf-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: white;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: nowrap;
    z-index: 50;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}
.cf-tooltip .profit { color: #6ee7b7; }
.cf-tooltip .loss { color: #fca5a5; }
.cf-bar-group:hover .cf-tooltip { display: block; }
.cf-bar-group:hover .bar-revenue { background: var(--accent); opacity: 0.7; }
.cf-bar-group:hover .bar-profit { background: var(--green); opacity: 0.7; }

/* Legend & Cumulative */
.cf-legend { display: flex; gap: 1rem; margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-color { width: 12px; height: 12px; border-radius: 2px; }
.legend-revenue { background: rgba(31,59,77,0.15); border: 1px solid var(--navy); }
.legend-profit { background: var(--green-light); border: 1px solid var(--green); }
.cf-cumulative {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.cf-cum-label { color: var(--text-muted); }
.cf-cum-value { font-weight: 700; font-size: 1.1rem; }

/* Month 0 card */
.cf-month0-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.65rem 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--navy);
}
.cf-month0-items { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* Centered bars (positive up, negative down) */
.cf-bars-centered { height: 180px; }
.cf-bar-stack-centered {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}
.cf-bar-positive {
    position: absolute;
    bottom: 50%;
    width: 100%;
    background: var(--green-light);
    border: 1px solid var(--green);
    border-radius: 2px 2px 0 0;
    min-height: 1px;
}
.cf-bar-negative {
    position: absolute;
    top: 50%;
    width: 100%;
    background: var(--red-light);
    border: 1px solid var(--red);
    border-radius: 0 0 2px 2px;
    min-height: 1px;
}
.cf-zero-line { border-bottom: 2px solid var(--text-muted) !important; opacity: 0.4; }

/* Payback row highlight */
.row-payback { background: var(--green-light); }
.row-payback td { font-weight: 600; }
.row-month0 { background: var(--bg); font-style: italic; }

/* Compare */
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.compare-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.compare-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.compare-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.compare-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.compare-metric { display: flex; flex-direction: column; }
.compare-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.compare-value { font-size: 1rem; font-weight: 700; }

/* Knowledge Base */
.knowledge-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.knowledge-article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.knowledge-article h2 { font-size: 1.2rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.article-content h1 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.article-content h2 { font-size: 1rem; margin: 0.75rem 0 0.5rem; border: none; padding: 0; }
.article-content h3 { font-size: 0.9rem; margin: 0.75rem 0 0.25rem; }
.article-content p { margin-bottom: 0.5rem; }
.article-content ul, .article-content ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.article-content li { margin-bottom: 0.25rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
.article-content table th, .article-content table td { padding: 0.4rem; border: 1px solid var(--border); font-size: 0.85rem; }

/* Decisions */
.decision-form { margin-bottom: 1.5rem; }
.decision-form .form-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.decision-form input[type="text"],
.decision-form textarea {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}
.input-lg { font-size: 1rem !important; }
.decision-form select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.decision-form textarea { width: 100%; resize: vertical; }
.decision-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.decision-open { border-left: 3px solid var(--yellow); }
.decision-decided { border-left: 3px solid var(--green); }
.decision-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.decision-category {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: var(--bg);
    border-radius: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.decision-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.decision-resolve { display: flex; gap: 0.4rem; }
.decision-resolve input { flex: 1; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; }
.decision-result { font-weight: 600; color: var(--green); font-size: 0.9rem; }
.decision-card time { font-size: 0.75rem; color: var(--text-muted); }

/* Team / Org Chart */
.team-view-toggle {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1.25rem;
}
.team-view-toggle .btn-sm:not(.btn-active) {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.team-view-toggle .btn-sm:not(.btn-active):hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Org Tree (hierarchical view) */
.org-tree-container {
    overflow-x: auto;
    padding: 1.5rem 0;
}

/* Reset all list styles */
.org-tree,
.org-tree ul {
    display: flex !important;
    justify-content: center;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative;
}
.org-tree > li {
    list-style: none !important;
}
.org-tree li {
    list-style: none !important;
    position: relative;
    padding: 0 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.org-tree li::marker { display: none; content: ''; }

/* Child levels: spacing + vertical connector from parent */
.org-tree ul {
    margin-top: 2rem !important;
    padding-top: 0 !important;
}
.org-tree ul::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 50%;
    width: 2px;
    height: 1rem;
    background: var(--border);
}

/* Horizontal connector between siblings */
.org-tree ul > li::before,
.org-tree ul > li::after {
    content: '';
    position: absolute;
    top: -1rem;
    width: 50%;
    height: 2px;
    background: var(--border);
}
.org-tree ul > li::before { left: 0; }
.org-tree ul > li::after { right: 0; }
.org-tree ul > li:first-child::before { left: 50%; }
.org-tree ul > li:last-child::after { right: 50%; }
.org-tree ul > li:only-child::before,
.org-tree ul > li:only-child::after { display: none; }

/* Vertical line from horizontal connector down to node */
.org-tree ul > li > .tree-node::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 1rem;
    background: var(--border);
}

/* Tree node card */
.tree-node {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    min-width: 190px;
    max-width: 260px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, border-color 0.15s;
    z-index: 1;
}
.tree-node:hover { box-shadow: var(--shadow-lg); }

/* Department color coding on tree nodes */
.tree-dept-management { border-left: 4px solid var(--navy); }
.tree-dept-jiujitsu { border-left: 4px solid var(--red); }
.tree-dept-yoga { border-left: 4px solid #8b5cf6; }
.tree-dept-gym { border-left: 4px solid var(--accent); }
.tree-dept-cafe { border-left: 4px solid var(--yellow); }
.tree-dept-operations { border-left: 4px solid var(--green); }
.tree-dept-other { border-left: 4px solid var(--text-muted); }

/* Faded style for planned/open */
.tree-st-planned { opacity: 0.8; border-style: dashed; }
.tree-st-open { opacity: 0.6; border-style: dotted; }

.tree-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem;
    flex-shrink: 0;
}
.tree-info { flex: 1; min-width: 0; }
.tree-info strong { font-size: 0.85rem; display: block; line-height: 1.2; }
.tree-role { font-size: 0.72rem; color: var(--text-muted); display: block; }
.tree-resp { font-size: 0.65rem; color: var(--text-muted); display: block; margin-top: 0.2rem; line-height: 1.3; }
.tree-node .org-status-badge { font-size: 0.55rem; padding: 0.1rem 0.3rem; flex-shrink: 0; margin-top: 0.15rem; }

/* Tree legend */
.tree-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.tree-legend-item { display: flex; align-items: center; gap: 0.3rem; }
.tree-legend-dot { width: 14px; height: 4px; border-radius: 2px; }
.tree-legend-management { background: var(--navy); }
.tree-legend-jiujitsu { background: var(--red); }
.tree-legend-yoga { background: #8b5cf6; }
.tree-legend-gym { background: var(--accent); }
.tree-legend-cafe { background: var(--yellow); }
.tree-legend-operations { background: var(--green); }

.team-add-form { margin-bottom: 1.5rem; }
.team-add-form > summary { list-style: none; cursor: pointer; }
.team-add-form > summary::-webkit-details-marker { display: none; }
.team-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 0.75rem;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.form-field label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.2rem; text-transform: uppercase; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
}
.form-field textarea { resize: vertical; }
.form-field-wide { grid-column: 1 / -1; }
.dept-checkboxes { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; }
.dept-check { display: flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--text); cursor: pointer; }
.dept-check input[type="checkbox"] { width: auto; margin: 0; }

.org-department { margin-bottom: 1.5rem; }
.org-dept-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.75rem;
}
.org-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; }

.org-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s;
}
.org-card:hover { box-shadow: var(--shadow-lg); }
.org-status-open { border-left: 3px solid var(--yellow); }
.org-status-planned { border-left: 3px solid var(--accent); }
.org-status-active { border-left: 3px solid var(--green); }

.org-card-header { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.65rem; }
.org-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
}
.org-card-info { flex: 1; min-width: 0; }
.org-card-info h3 { font-size: 0.95rem; line-height: 1.2; }
.org-role { font-size: 0.8rem; color: var(--text-muted); }

.org-status-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 99px;
    font-weight: 600;
    flex-shrink: 0;
}
.org-badge-active { background: var(--green-light); color: var(--green); }
.org-badge-planned { background: var(--accent-light); color: var(--accent); }
.org-badge-open { background: var(--yellow-light); color: var(--yellow); }

.org-responsibilities { font-size: 0.8rem; margin-bottom: 0.4rem; }
.org-responsibilities strong { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); }
.org-responsibilities p { margin-top: 0.15rem; }
.org-reports-to { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.org-location { font-size: 0.75rem; color: var(--text-muted); }
.org-notes { font-size: 0.75rem; color: var(--text-muted); font-style: italic; margin-top: 0.3rem; }

.org-card-actions { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.org-edit-toggle > summary { list-style: none; cursor: pointer; display: inline; }
.org-edit-toggle > summary::-webkit-details-marker { display: none; }
.org-edit-form { margin-top: 0.75rem; }
.org-edit-form .form-grid { gap: 0.5rem; }
.org-edit-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Sections */
.section { margin-bottom: 2rem; }
.section h2 { font-size: 1.1rem; margin-bottom: 1rem; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state code { background: var(--bg); padding: 0.2rem 0.4rem; border-radius: 4px; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 380px; padding: 1rem; }
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.login-brand { font-size: 1.5rem; color: var(--navy); margin-bottom: 0.25rem; }
.login-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.login-error {
    background: var(--red-light);
    color: var(--red);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.login-form { text-align: left; }
.login-field { margin-bottom: 1rem; }
.login-field label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 0.3rem; }
.login-field input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.login-field input:focus { outline: none; border-color: var(--navy); }
.login-btn { width: 100%; justify-content: center; padding: 0.65rem; font-size: 0.9rem; background: var(--navy); }
.login-lang { margin-top: 1.25rem; display: flex; justify-content: center; gap: 0.5rem; }

/* Logout button in nav */
.nav-user { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.5rem; padding-left: 0.75rem; border-left: 1px solid rgba(255,255,255,0.25); }
.nav-user-name { font-size: 0.75rem; color: rgba(255,255,255,0.7); }
.nav-logout {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.nav-logout:hover { color: white; border-color: rgba(255,255,255,0.5); }

/* Footer */
.footer { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--border); margin-top: 2rem; }

/* Responsive */
@media (max-width: 900px) {
    .model-layout { grid-template-columns: 1fr; }
    .model-params { position: static; max-height: none; }
    .results-hero { grid-template-columns: 1fr 1fr; }
    .pillars { grid-template-columns: repeat(3, 1fr); }
    .nav { flex-direction: column; gap: 0.5rem; }
}
@media (max-width: 600px) {
    .main { padding: 1rem; }
    .results-hero { grid-template-columns: 1fr; }
    .pillars { grid-template-columns: 1fr 1fr; }
    .hero-cards { grid-template-columns: 1fr; }
}
