/* ═══════════════════════════════════════════════════════
   AI Sales Crew — Hommrich.AI Brandkit (RAS, Dark)
   SSOT: Design System/colors_and_type.css (ras-webapp v3.5)
   Electric Blue #2563EB + KI-Gradient + Syne/Inter/Geist Mono
   Migriert 2026-05-28 (Lena/CDO) — alte Var-Namen als Aliase erhalten.
   ═══════════════════════════════════════════════════════ */

@import url('fonts/fonts.css');

:root {
    /* ── Brandkit-Kern (Electric Blue + KI-Gradient) ── */
    --electric-blue: #2563EB;
    --electric-blue-deep: #1D4ED8;
    --indigo: #4F46E5;
    --violet: #7C3AED;
    --violet-soft: #A78BFA;
    --cyan: #06B6D4;
    --cyan-bright: #38BDF8;
    --ki-gradient: linear-gradient(135deg, #4F46E5 0%, #2563EB 45%, #06B6D4 100%);
    --ki-gradient-3stop: linear-gradient(135deg, #4F46E5 0%, #2563EB 45%, #06B6D4 100%);
    --ki-text-gradient: linear-gradient(135deg, #818CF8, #38BDF8, #06B6D4);

    /* ── Fonts (Brandkit) ── */
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Syne', 'Inter', sans-serif;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-mono: 'Geist Mono', 'SF Mono', ui-monospace, monospace;

    /* ── Alias-Mapping: alte App-Var-Namen → Brandkit-Werte ──
       (so werden alle bestehenden Komponenten automatisch on-brand) */
    --purple: var(--violet);            /* #7C3AED — KI-Gradient-Apex */
    --purple-dark: #6D28D9;
    --purple-light: var(--violet-soft);
    --blue: var(--electric-blue);       /* #2563EB — Primary */
    --blue-light: #3B82F6;
    --gold: #E0A43A;                    /* Brandkit --warning */
    --gold-dark: #C4841A;
    --gold-light: #F59E0B;

    /* Gradients */
    --gradient-primary: var(--ki-gradient);   /* Electric Blue → Violet */
    --gradient-gold: linear-gradient(135deg, #E0A43A 0%, #C4841A 100%);
    --gradient-bg: linear-gradient(180deg, #07071A 0%, #0A0A1E 100%);

    /* Background (Live-Page RAS-Dark) */
    --bg: #07071A;
    --bg2: #0A0A1E;
    --bg3: #10102A;
    --bg-card: rgba(16, 16, 30, 0.85);      /* --panel (glasig) */
    --bg-elevated: rgba(20, 20, 40, 0.60);  /* --panel-2 */
    --bg-input: #0A0A1E;

    /* Borders (Live) */
    --border: rgba(255, 255, 255, 0.10);
    --border-purple: rgba(37, 99, 235, 0.18);        /* --eb-soft */
    --border-purple-hover: rgba(255, 255, 255, 0.18);

    /* Text (Live-Page — fast-weiss) */
    --text: #F8FAFC;
    --subtext: #94A3B8;
    --dim: #64748B;

    /* Status (Brandkit semantic) */
    --green: #22C55E;
    --yellow: #F59E0B;
    --red: #EF4444;

    /* Sizing */
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-pill: 100px;

    /* Shadows (Brandkit) */
    --glow-purple: 0 8px 24px rgba(37, 99, 235, 0.30);   /* CTA-Glow Electric Blue */
    --glow-gold: 0 0 30px rgba(224, 164, 58, 0.15);

    /* Glass */
    --glass-bg: rgba(7, 7, 26, 0.88);

    /* Motion (Live-Page) */
    --hover-y: -2px;
    --press-y: 1px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dur-fast: 150ms;
    --dur-base: 250ms;
    --sh-acc: 0 8px 24px rgba(37, 99, 235, 0.32);

    /* Top-Nav */
    --topnav-height: 64px;
}

/* ── Reset & Base ──────────────────────────────────── */

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--gold); }

/* ── Sidebar ───────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.logo-img {
    height: 22px;
    width: auto;
    max-width: 200px;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--text2);
    letter-spacing: 0.02em;
}

.company-name {
    font-size: 11px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.nav-links {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--subtext);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--text);
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--purple-light);
    font-weight: 600;
    border-left: 3px solid var(--purple);
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.role-evolution-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.badge-ai { color: var(--purple-light); }
.badge-human { color: var(--gold); }

.version {
    font-size: 10px;
    color: var(--dim);
    margin-top: 8px;
}

/* ── Main Content ──────────────────────────────────── */

.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-header {
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.content-header h1 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.content-body {
    padding: 24px 30px;
    flex: 1;
}

/* ── Cards ─────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--border-purple-hover);
    box-shadow: var(--glow-purple);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Grid ──────────────────────────────────────────── */

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .content { margin-left: 0; }
}

/* ── Stat Cards ────────────────────────────────────── */

.stat-card {
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--subtext);
    margin-top: 8px;
    font-weight: 500;
}

.stat-value.green { background: none; -webkit-text-fill-color: var(--green); color: var(--green); }
.stat-value.yellow { background: none; -webkit-text-fill-color: var(--yellow); color: var(--yellow); }
.stat-value.red { background: none; -webkit-text-fill-color: var(--red); color: var(--red); }
.stat-value.gold { background: var(--gradient-gold); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ── Forms ─────────────────────────────────────────── */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--subtext);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ── Buttons ───────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}
.btn-primary:hover {
    opacity: 0.9;
    box-shadow: var(--glow-purple);
}

.btn-gold {
    background: var(--gradient-gold);
    color: var(--bg);
    font-weight: 700;
}
.btn-gold:hover {
    opacity: 0.9;
    box-shadow: var(--glow-gold);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--purple);
    color: var(--purple-light);
}
.btn-outline:hover {
    background: rgba(37, 99, 235, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── PRISM Components ──────────────────────────────── */

.prism-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.prism-lens-label {
    width: 200px;
    font-size: 14px;
    color: var(--subtext);
}

.prism-lens-key {
    font-weight: 700;
    color: var(--text);
    margin-right: 4px;
}

.prism-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.prism-bar-fill {
    height: 100%;
    border-radius: var(--radius);
    transition: width 0.4s ease;
}

.prism-bar-fill.green { background: var(--green); }
.prism-bar-fill.yellow { background: var(--yellow); }
.prism-bar-fill.red { background: var(--red); }

.prism-score-badge {
    width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Geist Mono', 'SF Mono', monospace;
}

/* ── Score Selector (Radio Buttons) ────────────────── */

.score-selector {
    display: flex;
    gap: 8px;
}

.score-option {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.score-option:hover {
    border-color: var(--purple);
    transform: scale(1.05);
}

.score-option.selected { border-width: 3px; }

.score-option[data-score="1"] { border-color: var(--red); }
.score-option[data-score="2"] { border-color: var(--yellow); }
.score-option[data-score="3"] { border-color: var(--green); }

.score-option.selected[data-score="1"] { background: rgba(243, 139, 168, 0.15); }
.score-option.selected[data-score="2"] { background: rgba(249, 226, 175, 0.15); }
.score-option.selected[data-score="3"] { background: rgba(166, 227, 161, 0.15); }

/* ── Status Badges ─────────────────────────────────── */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

.status-healthy { background: rgba(166, 227, 161, 0.12); color: var(--green); }
.status-at-risk { background: rgba(249, 226, 175, 0.12); color: var(--yellow); }
.status-critical { background: rgba(243, 139, 168, 0.12); color: var(--red); }

.heat-hot { background: rgba(243, 139, 168, 0.12); color: var(--red); }
.heat-warm { background: rgba(249, 226, 175, 0.12); color: var(--yellow); }
.heat-cold { background: rgba(37, 99, 235, 0.12); color: var(--blue); }

/* ── Role Evolution Display ────────────────────────── */

.role-evolution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    background: rgba(37, 99, 235, 0.04);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.role-column h4 {
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-column.ai h4 { color: var(--purple-light); }
.role-column.human h4 { color: var(--gold); }

.role-item {
    font-size: 13px;
    color: var(--subtext);
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.role-item::before {
    content: "\251C\2500";
    position: absolute;
    left: 0;
    color: var(--dim);
    font-family: 'Geist Mono', monospace;
}

.role-item:last-child::before {
    content: "\2514\2500";
}

/* ── Loading & Empty States ────────────────────────── */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--dim);
}

.loading::after {
    content: "";
    width: 24px;
    height: 24px;
    border: 3px solid var(--purple);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--dim);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 16px; margin-bottom: 8px; color: var(--subtext); }
.empty-state-hint { font-size: 13px; }

/* ── Account Brief Display ─────────────────────────── */

.account-brief {
    font-family: 'Geist Mono', 'SF Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

/* ── Cost Tracker Widget ──────────────────────────── */

.cost-widget {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 1000;
    cursor: pointer;
}

.cost-widget-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Geist Mono', monospace;
    color: var(--subtext);
    transition: all 0.2s;
    backdrop-filter: blur(16px);
}

.cost-widget-summary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.cost-icon { font-size: 14px; }

.cost-detail {
    position: absolute;
    bottom: 44px;
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
}

.cost-detail.hidden { display: none; }

.cost-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.cost-detail-close {
    cursor: pointer;
    font-size: 18px;
    color: var(--dim);
    line-height: 1;
}
.cost-detail-close:hover { color: var(--text); }

.cost-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--subtext);
    padding: 3px 0;
    font-family: 'Geist Mono', monospace;
}

.cost-row-total {
    font-weight: 700;
    color: var(--gold);
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 6px;
}

.cost-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    margin-bottom: 4px;
}

/* ── Dashboard Hero Logo ──────────────────────────── */

.hero-logo {
    text-align: center;
    padding: 20px 0 10px;
}

.hero-logo img {
    max-width: 320px;
    height: auto;
    opacity: 0.9;
}

.hero-tagline {
    text-align: center;
    font-size: 14px;
    color: var(--subtext);
    margin-bottom: 24px;
    font-weight: 500;
}

.hero-tagline em {
    color: var(--gold);
    font-style: normal;
    font-weight: 600;
}

/* ── Table ─────────────────────────────────────────── */

.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

th {
    color: var(--dim);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

tr:hover td { background: rgba(37, 99, 235, 0.04); }

/* ── Scrollbar ─────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 768px) {
    .role-evolution { grid-template-columns: 1fr; }
    .content-body { padding: 16px; }
    .cost-widget { bottom: 8px; right: 8px; }
    .hero-logo img { max-width: 200px; }
}

/* ═══════════════════════════════════════════════════════
   AUTH PAGES (Login, Register)
   ═══════════════════════════════════════════════════════ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--gradient-bg);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.auth-logo {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo img {
    max-width: 200px;
    height: auto;
    opacity: 0.9;
}

.auth-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--subtext);
    margin-bottom: 32px;
    font-weight: 500;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    color: var(--subtext);
    margin-bottom: 6px;
    font-weight: 500;
}

.auth-form .form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox label {
    margin-bottom: 0;
    font-size: 13px;
    cursor: pointer;
}

.form-check {
    accent-color: var(--purple);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-error {
    display: block;
    font-size: 12px;
    color: var(--red);
    margin-top: 4px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    margin-top: 8px;
}

.auth-footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
}

/* ── Flash Messages ──────────────────────────────────── */

.flash-container {
    padding: 0 30px;
    margin-top: 8px;
}

.flash-message {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.flash-success, .flash-message {
    background: rgba(166, 227, 161, 0.1);
    color: var(--green);
    border: 1px solid rgba(166, 227, 161, 0.2);
}

.flash-error, .flash-danger {
    background: rgba(243, 139, 168, 0.1);
    color: var(--red);
    border: 1px solid rgba(243, 139, 168, 0.2);
}

.flash-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--blue);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.flash-warning {
    background: rgba(249, 226, 175, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(249, 226, 175, 0.2);
}

/* ═══════════════════════════════════════════════════════
   USER MENU (Sidebar Footer)
   ═══════════════════════════════════════════════════════ */

.user-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout {
    color: var(--dim);
    font-size: 18px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    flex-shrink: 0;
}

.user-logout:hover {
    color: var(--red);
    background: rgba(243, 139, 168, 0.1);
}

/* ── Nav Divider ──────────────────────────────────────── */

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 14px;
}

/* ═══════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════ */

/* Admin Link Cards (Dashboard) */
.admin-link-card {
    display: block;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    color: var(--text);
}

.admin-link-card:hover {
    border-color: var(--border-purple-hover);
    box-shadow: var(--glow-purple);
    transform: translateY(-2px);
    color: var(--text);
}

.admin-link-card .stat-value {
    font-size: 28px;
}

.admin-link-card .stat-label {
    margin-top: 6px;
}

/* Admin Forms */
.admin-form {
    max-width: 100%;
}

.admin-form .form-group {
    margin-bottom: 16px;
}

.admin-form label {
    display: block;
    font-size: 13px;
    color: var(--subtext);
    margin-bottom: 6px;
    font-weight: 500;
}

.admin-form .form-input,
.admin-form select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-form .form-input:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Form Row (side-by-side fields) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
}

/* Quick Links Grid */
.quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .quick-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .quick-links { grid-template-columns: 1fr; }
}

/* Plan Badge */
.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-enterprise { background: rgba(224, 164, 58, 0.15); color: var(--gold); }
.plan-professional { background: rgba(37, 99, 235, 0.15); color: var(--purple-light); }
.plan-starter { background: rgba(37, 99, 235, 0.15); color: var(--blue); }
.plan-trial { background: rgba(166, 227, 161, 0.15); color: var(--green); }
.plan-demo { background: rgba(166, 173, 193, 0.15); color: var(--subtext); }

/* Active/Inactive dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.status-dot.active { background: var(--green); }
.status-dot.inactive { background: var(--red); }

/* Admin Table enhancements */
.admin-table td { vertical-align: middle; }
.admin-table .actions { white-space: nowrap; }


/* ═══════════════════════════════════════════════════════
   PHASE 2B: Demo Banner, Connectors, Auth Links
   ═══════════════════════════════════════════════════════ */

/* Demo / Trial Banner */
.demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple));
    border-radius: 8px;
    margin: 0 1.5rem 0.5rem 1.5rem;
    font-size: 0.85rem;
    color: #fff;
}

.demo-banner-trial {
    background: linear-gradient(135deg, #2d6a4f, #40916c);
}

.demo-banner-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-banner-icon {
    font-size: 1.1rem;
}

.demo-banner-text {
    opacity: 0.95;
}

.demo-banner-upgrade {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.demo-banner-upgrade:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Auth Links (Login Page) */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links-divider {
    position: relative;
    margin: 1.5rem 0 1rem;
    text-align: center;
}

.auth-links-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.auth-links-divider span {
    position: relative;
    background: var(--bg-card);
    padding: 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.btn-outline {
    display: inline-block;
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--purple);
    color: var(--purple-light);
    background: transparent;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    box-sizing: border-box;
}

.btn-outline:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--purple-light);
}

.btn-ghost {
    display: inline-block;
    width: 100%;
    padding: 0.5rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    transition: color 0.2s;
    margin-top: 0.5rem;
    cursor: pointer;
    box-sizing: border-box;
}

.btn-ghost:hover {
    color: var(--text);
}

.auth-back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    display: inline-block;
    margin-top: 0.5rem;
}

.auth-back-link:hover {
    color: var(--purple-light);
}

/* Auth Tagline */
.auth-tagline {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Demo Features List (Signup Pages) */
.auth-demo-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.demo-feature {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 4px;
}

/* Expired Page */
.expired-content {
    text-align: center;
    padding: 1rem 0;
}

.expired-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.expired-title {
    color: var(--text);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.expired-message {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.expired-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.expired-contact {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.expired-contact a {
    color: var(--purple-light);
    text-decoration: none;
}

.expired-contact a:hover {
    text-decoration: underline;
}

.upgrade-cta {
    background: linear-gradient(135deg, var(--gold), #e8b940) !important;
    color: #1a1a2e !important;
    font-weight: 700;
}

.upgrade-cta:hover {
    filter: brightness(1.1);
}

/* ── Connector UI ───────────────────────────────────────── */

.connector-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.connector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.connector-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.2s;
    position: relative;
}

.connector-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.connector-card.connector-active {
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

.connector-card.connector-locked {
    opacity: 0.6;
}

.connector-card.connector-locked:hover {
    transform: none;
}

.connector-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.connector-icon {
    font-size: 1.8rem;
}

.connector-info {
    flex: 1;
}

.connector-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.connector-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.connector-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.connector-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.connector-lock {
    font-size: 1.2rem;
    opacity: 0.5;
}

.connector-upgrade-hint {
    font-size: 0.75rem;
    color: var(--gold);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Toggle Switch */
.connector-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.connector-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-elevated);
    border-radius: 24px;
    transition: 0.3s;
    border: 1px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.connector-toggle input:checked + .toggle-slider {
    background: var(--green);
    border-color: var(--green);
}

.connector-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

.connector-note {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.connector-note strong {
    color: var(--purple-light);
}

/* ── Admin Cards ────────────────────────────────────────── */

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.admin-card h3 {
    color: var(--text);
    margin: 0 0 1rem 0;
    font-size: 1rem;
}


/* ══════════════════════════════════════════════════════════
   DASHBOARD CHARTS
   ══════════════════════════════════════════════════════════ */

/* ── ICP Score Bar Chart ───────────────────────────────── */

.chart-icp {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.icp-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icp-label {
    flex: 0 0 130px;
    font-size: 12px;
    color: var(--subtext);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icp-bar-track {
    flex: 1;
    height: 22px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.icp-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 0;
    position: relative;
}

.icp-bar-hot {
    background: linear-gradient(90deg, var(--purple) 0%, var(--green) 100%);
}

.icp-bar-warm {
    background: linear-gradient(90deg, var(--purple) 0%, var(--gold) 100%);
}

.icp-bar-cold {
    background: linear-gradient(90deg, var(--purple-dark) 0%, rgba(37, 99, 235, 0.5) 100%);
}

.icp-bar-value {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.icp-heat {
    flex: 0 0 24px;
    text-align: center;
    font-size: 14px;
}


/* ── PRISM Health Ring ─────────────────────────────────── */

.health-ring-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 16px 0;
}

.health-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(var(--border) 0% 100%);
    transition: background 0.6s ease;
}

.health-ring-inner {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.3);
}

.health-ring-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.health-ring-label {
    font-size: 10px;
    color: var(--subtext);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-ring-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--subtext);
}

.legend-item strong {
    color: var(--text);
    margin-left: 2px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}


/* ── Pipeline Funnel ───────────────────────────────────── */

.chart-funnel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
}

.funnel-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.funnel-label {
    flex: 0 0 100px;
    font-size: 12px;
    color: var(--subtext);
    text-align: right;
}

.funnel-bar-track {
    flex: 1;
    display: flex;
    transition: max-width 0.4s ease;
}

.funnel-bar {
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 0%;
    overflow: hidden;
    position: relative;
}

.funnel-bar-animated {
    transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.funnel-count {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}


/* ── Mini Progress Bar (Deal Table) ────────────────────── */

.mini-bar-track {
    width: 60px;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.mini-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.mini-bar-green { background: var(--green); }
.mini-bar-yellow { background: var(--gold); }
.mini-bar-red { background: var(--red); }

.mini-bar-label {
    font-size: 11px;
    color: var(--subtext);
    margin-left: 6px;
    vertical-align: middle;
}


/* ── Level Badge ───────────────────────────────────────── */

.level-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-compact {
    background: rgba(37, 99, 235, 0.15);
    color: var(--purple-light);
}

.level-standard {
    background: rgba(224, 164, 58, 0.15);
    color: var(--gold);
}

.level-full {
    background: rgba(64, 224, 130, 0.15);
    color: var(--green);
}


/* ── Responsive: Charts ────────────────────────────────── */

@media (max-width: 768px) {
    .health-ring-wrap {
        flex-direction: column;
        gap: 16px;
    }
    .health-ring-legend {
        flex-direction: row;
        gap: 16px;
    }
    .icp-label {
        flex: 0 0 80px;
        font-size: 11px;
    }
    .funnel-label {
        flex: 0 0 70px;
        font-size: 11px;
    }
}
