/* ================================================================
   koba360° – Corporate Design System
   Koller & Baur Finanzberatung
   ================================================================ */

/* ─── 1. Variables ──────────────────────────────────────────────── */
:root {
    --color-primary:      #e2001a;
    --color-primary-dark: #b8001e;
    --color-secondary:    #004494;
    --color-dark:         #003652;
    --color-bg:           #0d1b2e;
    --color-surface:      #1a2d42;
    --color-surface-2:    #243d57;
    --color-surface-3:    #2d4d6e;
    --color-border:       rgba(77,166,255,0.12);
    --color-border-hover: rgba(77,166,255,0.3);
    --color-text:         #e8f0f8;
    --color-text-muted:   #8ea8c3;
    --color-text-dim:     #4a6880;
    --color-accent:       #4da6ff;
    --color-success:      #22c55e;
    --color-warning:      #f59e0b;
    --color-error:        #ef4444;
    --color-info:         #06b6d4;

    --sidebar-width:      260px;
    --topbar-height:      60px;

    --radius-xs:  4px;
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 9999px;

    --shadow-sm:  0 1px 4px rgba(0,0,0,0.3);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(226,0,26,0.25);

    --transition: 200ms ease;
    --transition-slow: 350ms ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── 2. Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--color-bg); color: var(--color-text); line-height: 1.6; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #7dc4ff; }
img, svg { display: block; }
input, select, textarea, button { font-family: inherit; }
ul { list-style: none; }

/* ─── 3. Layout: App ────────────────────────────────────────────── */
.layout-app { overflow: hidden; height: 100vh; display: flex; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-dark);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width var(--transition-slow);
    position: relative;
    z-index: 100;
}
.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.brand-link { display: inline-block; }
.brand-koba { font-size: 26px; font-weight: 800; color: var(--color-text); letter-spacing: -0.5px; }
.brand-deg  { font-size: 26px; font-weight: 800; color: var(--color-primary); letter-spacing: -0.5px; }

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-3) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--color-surface-3); border-radius: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--color-text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap;
}
.nav-item:hover { color: var(--color-text); background: rgba(255,255,255,0.04); border-left-color: var(--color-border-hover); }
.nav-item.active { color: var(--color-text); background: rgba(226,0,26,0.1); border-left-color: var(--color-primary); }

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Nav Groups */
.nav-group { overflow: hidden; }
.nav-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--color-text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap;
    user-select: none;
}
.nav-group-header:hover { color: var(--color-text); background: rgba(255,255,255,0.04); }
.nav-group-header.active { color: var(--color-text); border-left-color: var(--color-primary); }

.nav-chevron { width: 14px; height: 14px; margin-left: auto; flex-shrink: 0; transition: transform var(--transition); }
.nav-group.open .nav-group-header > .nav-chevron { transform: rotate(180deg); }

.nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    background: rgba(0,0,0,0.15);
}
.nav-group.open .nav-group-items { max-height: 500px; }

.nav-sub-item {
    display: flex;
    align-items: center;
    padding: 8px 20px 8px 48px;
    color: var(--color-text-muted);
    font-size: 13px;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    cursor: pointer;
}
.nav-sub-item:hover { color: var(--color-text); background: rgba(255,255,255,0.03); }
.nav-sub-item.active { color: var(--color-accent); border-left-color: var(--color-accent); }

/* Sub-groups (dimensions) */
.nav-sub-group { overflow: hidden; }
.nav-sub-group-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px 8px 32px;
    color: var(--color-text-muted); font-size: 13px;
    cursor: pointer; transition: all var(--transition);
}
.nav-sub-group-header:hover { color: var(--color-text); }
.nav-sub-group.open .nav-sub-group-header .nav-chevron-sm { transform: rotate(180deg); }
.nav-sub-group-items { max-height: 0; overflow: hidden; transition: max-height var(--transition-slow); }
.nav-sub-group.open .nav-sub-group-items { max-height: 300px; }
.nav-sub-sub-item { padding-left: 64px !important; }
.nav-chevron-sm { width: 12px; height: 12px; margin-left: auto; transition: transform var(--transition); }

.nav-sub-item-dim {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px 8px 32px;
    color: var(--color-text-dim); font-size: 13px;
    cursor: default;
}
.nav-sub-item-dim.disabled { opacity: 0.5; }
.dim-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-dim); flex-shrink: 0; }
.dim-dot.dim-active { background: var(--color-success); }

.badge-soon {
    font-size: 10px; padding: 2px 6px; border-radius: var(--radius-full);
    background: rgba(245,158,11,0.15); color: var(--color-warning);
    font-weight: 600; margin-left: 4px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--color-secondary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: var(--color-text-muted); }
.logout-btn {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); color: var(--color-text-muted);
    transition: all var(--transition); flex-shrink: 0;
}
.logout-btn:hover { color: var(--color-primary); background: rgba(226,0,26,0.1); }
.logout-btn svg { width: 18px; height: 18px; }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 17px; font-weight: 700; color: var(--color-text); }
.sidebar-toggle {
    width: 34px; height: 34px; display: none; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--color-text-muted); cursor: pointer;
    border-radius: var(--radius-sm); transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--color-surface-2); color: var(--color-text); }
.sidebar-toggle svg { width: 20px; height: 20px; }

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-3) transparent;
}
.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-thumb { background: var(--color-surface-3); border-radius: 3px; }

/* ─── 4. Auth Layout ────────────────────────────────────────────── */
.layout-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-bg { position: fixed; inset: 0; pointer-events: none; }
.auth-bg-circle {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,68,148,0.3) 0%, transparent 70%);
}
.auth-bg-circle-1 { width: 600px; height: 600px; top: -200px; right: -100px; }
.auth-bg-circle-2 { width: 400px; height: 400px; bottom: -150px; left: -100px; background: radial-gradient(circle, rgba(226,0,26,0.15) 0%, transparent 70%); }
.auth-bg-circle-3 { width: 300px; height: 300px; top: 30%; left: 30%; background: radial-gradient(circle, rgba(77,166,255,0.08) 0%, transparent 70%); }

.auth-container { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 24px; }
.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0,68,148,0.15);
}
.auth-brand { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { color: var(--color-text-muted); font-size: 14px; margin-bottom: 32px; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-footer-note { margin-top: 32px; text-align: center; font-size: 12px; color: var(--color-text-dim); }

/* ─── 5. Public Layout ──────────────────────────────────────────── */
.layout-public { min-height: 100vh; display: flex; flex-direction: column; }
.public-header {
    background: var(--color-dark);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    flex-shrink: 0;
}
.public-header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.public-header-meta { color: var(--color-text-muted); font-size: 13px; }
.public-main { flex: 1; padding: 32px 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.public-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 20px 24px; margin-top: auto; }
.public-footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.public-footer p { font-size: 12px; color: var(--color-text-muted); }
.footer-disclaimer { margin-top: 4px; font-size: 11px; color: var(--color-text-dim); }

.public-result-wrap { max-width: 1100px; }
.public-greeting { margin-bottom: 28px; }
.public-greeting h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.public-greeting p { color: var(--color-text-muted); }
.public-validity { margin-top: 8px; font-size: 14px; }
.public-empty { text-align: center; padding: 80px 20px; }
.public-empty svg { width: 64px; height: 64px; margin: 0 auto 20px; color: var(--color-text-dim); }
.public-empty h2 { font-size: 22px; margin-bottom: 12px; }
.public-empty p { color: var(--color-text-muted); }

/* ─── 6. Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--color-text); }
.card-body { padding: 20px; }
.card-full { grid-column: 1 / -1; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }

/* ─── 7. Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: var(--color-primary); color: white; }
.btn-primary:hover:not(:disabled)  { background: var(--color-primary-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(226,0,26,0.3); }

.btn-secondary { background: var(--color-secondary); color: white; }
.btn-secondary:hover:not(:disabled) { background: #0055b8; color: white; }

.btn-success  { background: var(--color-success); color: white; }
.btn-success:hover:not(:disabled) { background: #16a34a; color: white; }

.btn-danger   { background: rgba(239,68,68,0.15); color: var(--color-error); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover:not(:disabled) { background: var(--color-error); color: white; }

.btn-ghost    { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-2); color: var(--color-text); border-color: var(--color-border-hover); }

.btn-sm  { padding: 6px 12px; font-size: 13px; }
.btn-xs  { padding: 4px 10px; font-size: 12px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── 8. Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text-muted); margin-bottom: 6px; }
.form-hint  { font-size: 11px; color: var(--color-text-dim); font-weight: 400; margin-left: 6px; }
.required   { color: var(--color-primary); }

.form-input {
    width: 100%; padding: 10px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(77,166,255,0.12); }
.form-input::placeholder { color: var(--color-text-dim); }
.form-input.input-error { border-color: var(--color-error); }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ea8c3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { display: block; font-size: 12px; color: var(--color-error); margin-top: 4px; }

.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-text-dim); pointer-events: none; }
.input-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); font-size: 14px; pointer-events: none; }
.form-input.input-with-icon   { padding-left: 38px; }
.form-input.input-with-prefix { padding-left: 28px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-col  { /* full in grid-row */ }
.form-col-sm { flex: 0 0 120px; max-width: 120px; }
.form-col-lg { flex: 1; }
.form-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--color-text-dim); padding-bottom: 10px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-border); }

/* Range */
.range-wrap { display: flex; align-items: center; gap: 12px; }
.range-label-min, .range-label-max { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.range-slider {
    flex: 1; -webkit-appearance: none; height: 6px;
    border-radius: 3px; background: var(--color-surface-3);
    outline: none; cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
    background: var(--color-primary); cursor: pointer; box-shadow: 0 0 0 4px rgba(226,0,26,0.15);
}
.range-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--color-primary); cursor: pointer; border: none; }
.horizon-labels { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.horizon-tag {
    padding: 4px 10px; border-radius: var(--radius-full); font-size: 12px;
    background: var(--color-surface-2); color: var(--color-text-muted);
    cursor: pointer; transition: all var(--transition);
}
.horizon-tag:hover, .horizon-tag.active { background: rgba(226,0,26,0.15); color: var(--color-text); }

/* Radio Cards */
.radio-card-group { display: flex; gap: 12px; }
.radio-card {
    flex: 1; display: flex; align-items: center; gap: 12px;
    padding: 16px; border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
    background: var(--color-bg);
    cursor: pointer; transition: all var(--transition);
}
.radio-card input[type=radio] { display: none; }
.radio-card:hover { border-color: var(--color-border-hover); background: var(--color-surface-2); }
.radio-card.active { border-color: var(--color-primary); background: rgba(226,0,26,0.08); }
.radio-card-icon svg { width: 28px; height: 28px; color: var(--color-text-muted); }
.radio-card.active .radio-card-icon svg { color: var(--color-primary); }
.radio-card-label strong { display: block; font-size: 14px; font-weight: 600; color: var(--color-text); }
.radio-card-label span  { font-size: 12px; color: var(--color-text-muted); }

/* Toggle */
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-input { display: none; }
.toggle-track {
    width: 44px; height: 24px; border-radius: 12px;
    background: var(--color-surface-3); position: relative;
    transition: background var(--transition);
}
.toggle-track::after {
    content: ''; position: absolute; width: 18px; height: 18px;
    border-radius: 50%; background: white; top: 3px; left: 3px;
    transition: transform var(--transition);
}
.toggle-input:checked + .toggle-track { background: var(--color-success); }
.toggle-input:checked + .toggle-track::after { transform: translateX(20px); }
.toggle-text { font-size: 14px; color: var(--color-text); }

/* ─── 9. Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    background: var(--color-surface);
}
.data-table tbody td {
    padding: 12px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table-hover tbody tr { transition: background var(--transition); }
.data-table-hover tbody tr:hover { background: var(--color-surface-2); }
.data-table tfoot td { padding: 12px 16px; border-top: 2px solid var(--color-border); font-weight: 600; }
.table-total { background: var(--color-surface-2); }

.td-name a { color: var(--color-text); font-weight: 500; }
.td-name a:hover { color: var(--color-accent); }
.td-muted { color: var(--color-text-muted); }
.td-muted-sm { font-size: 12px; color: var(--color-text-dim); }
.td-actions { white-space: nowrap; text-align: right; }
.td-mono { font-family: 'Courier New', monospace; font-size: 12px; }

/* Pagination */
.pagination-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--color-border); }
.pagination-info { font-size: 13px; color: var(--color-text-muted); }

/* ─── 10. Badges & Pills ────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-blue   { background: rgba(0,68,148,0.25); color: #7db8ff; }
.badge-red    { background: rgba(226,0,26,0.2);  color: #ff7088; }
.badge-green  { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-muted  { background: var(--color-surface-2); color: var(--color-text-muted); }

/* Risikoprofil-Badges */
.profile-badge {
    display: inline-flex; padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.profile-badge-1 { background: rgba(22,197,94,0.15);  color: #4ade80; }
.profile-badge-2 { background: rgba(34,197,94,0.15);  color: #4ade80; }
.profile-badge-3 { background: rgba(250,204,21,0.15); color: #fbbf24; }
.profile-badge-4 { background: rgba(245,158,11,0.15); color: #f59e0b; }
.profile-badge-5 { background: rgba(249,115,22,0.15); color: #fb923c; }
.profile-badge-6 { background: rgba(239,68,68,0.15);  color: #f87171; }
.profile-badge-7 { background: rgba(220,38,38,0.15);  color: #ef4444; }

.score-pill {
    display: inline-flex; padding: 2px 10px;
    border-radius: var(--radius-full);
    background: rgba(77,166,255,0.15);
    color: var(--color-accent); font-size: 13px; font-weight: 600;
}
.age-badge { font-size: 12px; color: var(--color-text-dim); margin-left: 4px; }

/* Asset class dots */
.asset-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 8px; vertical-align: middle;
}
.asset-aktienfonds     { background: var(--color-primary); }
.asset-mischfonds      { background: var(--color-secondary); }
.asset-rentenfonds     { background: var(--color-accent); }
.asset-geldmarktfonds  { background: var(--color-dark); border: 1px solid var(--color-border-hover); }
.asset-immobilienfonds { background: #7a5af8; }

/* ─── 11. Alerts ────────────────────────────────────────────────── */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.25);  color: #86efac; }

/* ─── 12. Dashboard ─────────────────────────────────────────────── */
.dashboard-grid { display: flex; flex-direction: column; gap: 20px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-card {
    display: flex; align-items: center; gap: 16px;
    padding: 20px; border-radius: var(--radius-lg);
    background: var(--color-surface); border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}
.kpi-card-dim { opacity: 0.6; }
.kpi-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kpi-icon svg { width: 24px; height: 24px; }
.kpi-icon-blue { background: rgba(0,68,148,0.2); color: var(--color-accent); }
.kpi-icon-red  { background: rgba(226,0,26,0.15); color: var(--color-primary); }
.kpi-icon-muted{ background: var(--color-surface-2); color: var(--color-text-dim); }
.kpi-value { display: block; font-size: 28px; font-weight: 800; color: var(--color-text); line-height: 1; }
.kpi-value-dim { color: var(--color-text-dim); }
.kpi-label { display: block; font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.dash-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.dash-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--color-border); }
.dash-card-header h3 { font-size: 15px; font-weight: 600; }

/* ─── 13. Customer Detail ───────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-list { display: flex; flex-direction: column; gap: 0; }
.dl-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.dl-row:last-child { border-bottom: none; }
dt { font-size: 13px; color: var(--color-text-muted); }
dd { font-size: 14px; color: var(--color-text); }

/* Dimension cards */
.dimension-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dimension-card {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}
.dimension-active { border-color: rgba(0,68,148,0.4); background: rgba(0,68,148,0.08); }
.dimension-inactive { opacity: 0.5; }
.dim-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dim-icon svg { width: 20px; height: 20px; }
.dim-icon-blue { background: rgba(0,68,148,0.2); color: var(--color-accent); }
.dim-icon-muted { background: var(--color-surface-2); color: var(--color-text-dim); }
.dim-info { flex: 1; min-width: 0; }
.dim-name   { display: block; font-size: 14px; font-weight: 600; color: var(--color-text); }
.dim-status { display: block; font-size: 12px; color: var(--color-text-muted); }
.dim-badge {
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 600; white-space: nowrap;
    flex-shrink: 0;
}
.dim-badge-ok   { background: rgba(34,197,94,0.15); color: #4ade80; }
.dim-badge-new  { background: rgba(226,0,26,0.15); color: var(--color-primary); cursor: pointer; }
.dim-badge-soon { background: rgba(245,158,11,0.15); color: var(--color-warning); }

/* Token */
.token-result { padding: 16px 0; }
.token-generated-label { font-size: 13px; color: var(--color-text-muted); margin-bottom: 8px; }
.token-url-box {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--color-bg); border: 1px solid var(--color-border);
}
.token-url-box code { flex: 1; font-size: 13px; color: var(--color-accent); word-break: break-all; }
.token-link { font-size: 13px; color: var(--color-accent); }

/* Danger zone */
.danger-zone {
    padding: 20px; border-radius: var(--radius-md);
    border: 1px solid rgba(239,68,68,0.2);
    background: rgba(239,68,68,0.04);
}
.danger-zone h4 { font-size: 13px; font-weight: 600; color: var(--color-error); margin-bottom: 12px; }

/* ─── 14. Configurator Wizard ───────────────────────────────────── */
.configurator-wrap { max-width: 1000px; }

/* Steps */
.wizard-steps {
    display: flex; align-items: center;
    padding: 24px 0; margin-bottom: 8px;
}
.wizard-step { display: flex; align-items: center; gap: 10px; }
.step-bubble {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    background: var(--color-surface-2); color: var(--color-text-muted);
    border: 2px solid var(--color-border);
    transition: all var(--transition-slow);
    flex-shrink: 0;
}
.wizard-step.active .step-bubble { background: var(--color-primary); color: white; border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
.wizard-step.completed .step-bubble { background: var(--color-success); color: white; border-color: var(--color-success); }
.step-label { font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.wizard-step.active .step-label { color: var(--color-text); font-weight: 600; }
.wizard-connector { flex: 1; height: 2px; background: var(--color-border); margin: 0 16px; }

/* Customer badge */
.customer-badge-bar { margin-bottom: 20px; }
.customer-badge {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: var(--radius-full);
    background: var(--color-surface); border: 1px solid var(--color-border);
    font-size: 14px;
}
.badge-icon { width: 16px; height: 16px; color: var(--color-accent); }
.badge-sep { color: var(--color-border-hover); }

/* Panels */
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

/* Questionnaire */
.questionnaire-progress { font-size: 13px; color: var(--color-text-muted); }
.progress-bar-wrap { margin-bottom: 28px; }
.progress-bar-track { height: 6px; border-radius: 3px; background: var(--color-surface-2); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--color-secondary), var(--color-accent)); transition: width var(--transition-slow); }

.question-slide { display: none; animation: fadeIn 300ms ease; }
.question-slide.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.question-number { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--color-primary); margin-bottom: 8px; }
.question-text { font-size: 18px; font-weight: 600; color: var(--color-text); line-height: 1.4; margin-bottom: 24px; }

.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px; border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
    background: var(--color-bg);
    cursor: pointer; transition: all var(--transition);
}
.answer-card input[type=radio] { display: none; }
.answer-card:hover { border-color: var(--color-border-hover); background: var(--color-surface-2); }
.answer-card.selected { border-color: var(--color-secondary); background: rgba(0,68,148,0.12); }
.answer-card-inner { display: flex; align-items: flex-start; gap: 12px; }
.answer-marker {
    width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid var(--color-border); margin-top: 2px;
    transition: all var(--transition);
}
.answer-card.selected .answer-marker { background: var(--color-secondary); border-color: var(--color-secondary); }
.answer-text { font-size: 14px; color: var(--color-text); line-height: 1.4; }

.question-nav { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.question-nav #calculateBtn { margin-left: auto; }

/* ─── 15. Result ────────────────────────────────────────────────── */
.calculating-overlay {
    display: flex; align-items: center; justify-content: center;
    padding: 80px 0;
}
.calculating-inner { text-align: center; }
.calc-spinner {
    width: 56px; height: 56px; border-radius: 50%;
    border: 4px solid var(--color-surface-2);
    border-top-color: var(--color-primary);
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result Banner */
.result-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 28px 32px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-secondary) 100%);
    border: 1px solid rgba(77,166,255,0.2);
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    --profile-color: #f59e0b;
    border-left: 4px solid var(--profile-color);
}
.result-banner-saved, .result-banner-public { }
.result-banner-left  { display: flex; align-items: center; gap: 24px; }
.result-banner-right { text-align: right; }

/* Score ring */
.result-score-ring { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.score-ring-svg { width: 90px; height: 90px; }
.score-ring-value {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800; color: white;
}

.result-profile-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: rgba(255,255,255,0.6); }
.result-profile-name { font-size: 20px; font-weight: 800; color: white; margin: 4px 0; }
.result-profile-meta { font-size: 13px; color: rgba(255,255,255,0.65); }

.result-return-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: rgba(255,255,255,0.6); }
.result-return-value { font-size: 28px; font-weight: 800; color: white; }
.result-meta-info { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 6px; }

/* Charts */
.result-charts-row { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.result-chart-card .chart-body { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 20px; }
.result-chart-card-wide .chart-body { align-items: stretch; }
.result-chart-card-wide .chart-body canvas { width: 100% !important; }

/* Legend */
.chart-legend { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.legend-label { flex: 1; color: var(--color-text-muted); }
.legend-value { font-weight: 600; color: var(--color-text); }

/* Score breakdown */
.score-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.score-item { padding: 16px; border-radius: var(--radius-md); background: var(--color-surface-2); border: 1px solid var(--color-border); }
.score-item-highlight { background: rgba(77,166,255,0.08); border-color: rgba(77,166,255,0.25); }
.score-item-label { font-size: 12px; color: var(--color-text-muted); margin-bottom: 6px; }
.score-item-value { font-size: 20px; font-weight: 700; color: var(--color-accent); }
.score-item-sub { font-size: 12px; color: var(--color-text-dim); margin-top: 2px; }

/* Projection table */
.projection-table-wrap table { width: 100%; border-collapse: collapse; }
.projection-table-wrap th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.projection-table-wrap td { padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.projection-table-wrap tr:last-child td { border-bottom: none; }
.proj-pessimistic td { color: #fb923c; }
.proj-realistic td { color: var(--color-accent); font-weight: 600; }
.proj-optimistic td { color: #4ade80; }

/* Result actions */
.result-actions { display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.result-action-buttons { display: flex; flex-direction: column; gap: 10px; padding-top: 24px; }

/* Chart period selector */
.chart-period-selector { display: flex; gap: 6px; }
.chip {
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 500; cursor: pointer;
    background: var(--color-surface-2); color: var(--color-text-muted);
    border: 1px solid var(--color-border); transition: all var(--transition);
}
.chip.active, .chip:hover { background: rgba(0,68,148,0.2); color: var(--color-accent); border-color: var(--color-accent); }

/* ─── 16. Misc ──────────────────────────────────────────────────── */
.search-bar { display: flex; gap: 12px; align-items: center; }
.search-bar .input-wrapper { flex: 1; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 24px; color: var(--color-text-muted); text-align: center; }
.empty-state svg { width: 48px; height: 48px; color: var(--color-text-dim); }
.empty-state p { font-size: 14px; }
.py-48 { padding-top: 48px; padding-bottom: 48px; }

.text-muted { color: var(--color-text-muted); }
.text-muted-sm, .td-muted-sm { font-size: 12px; color: var(--color-text-dim); }

.disclaimer-box {
    padding: 20px; border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
}
.disclaimer-box h4 { font-size: 13px; font-weight: 600; color: var(--color-text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.disclaimer-box p { font-size: 12px; color: var(--color-text-dim); line-height: 1.6; }
.mt-8 { margin-top: 8px; }

/* ─── 17. Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .result-charts-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; transition: left var(--transition-slow); z-index: 200; }
    .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .answer-grid { grid-template-columns: 1fr; }
    .kpi-row { grid-template-columns: 1fr 1fr; }
    .result-banner { flex-direction: column; gap: 20px; }
    .result-banner-right { text-align: left; }
    .radio-card-group { flex-direction: column; }
}
@media (max-width: 480px) {
    .kpi-row { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .content-area { padding: 16px; }
}
