/* StockSpotter — Dark Dashboard Theme */

:root {
    --bg:           #0a0e17;
    --bg-secondary: #0f1521;
    --surface:      #141c2e;
    --surface-2:    #1a2540;
    --border:       #1f2d48;
    --border-hover: #2a3f66;

    --text-primary:  #e8eef7;
    --text-secondary: #8fa3c8;
    --text-muted:    #4d6080;

    --accent:        #3b82f6;
    --accent-hover:  #2563eb;
    --accent-subtle: rgba(59, 130, 246, 0.12);

    --success:       #22c55e;
    --success-bg:    rgba(34, 197, 94, 0.1);
    --danger:        #ef4444;
    --danger-bg:     rgba(239, 68, 68, 0.1);
    --warning:       #eab308;
    --warning-bg:    rgba(234, 179, 8, 0.1);

    --radius:        8px;
    --radius-lg:     12px;
    --font:          'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

    --navbar-h:      56px;
    --transition:    0.18s ease;
}

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

html { font-size: 15px; }

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.55;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Navbar ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--navbar-h);
    background: rgba(10, 14, 23, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.navbar-inner {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 1.5rem;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    flex-shrink: 0;
}
.brand-icon { font-size: 1.25rem; }
.navbar-menu { display: flex; gap: 0.25rem; flex: 1; }
.navbar-actions { display: flex; gap: 0.5rem; align-items: center; }

.nav-link {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-link.active { background: var(--accent-subtle); color: var(--accent); }

/* ── Container & layout ── */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

/* ── KPI grid ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    transition: border-color var(--transition);
}
.kpi-card:hover { border-color: var(--border-hover); }
.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.kpi-sub {
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* ── Dashboard grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.card-link {
    font-size: 0.8rem;
    color: var(--accent);
}

/* ── Performers list ── */
.performer-list { list-style: none; }
.performer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.performer-item:last-child { border-bottom: none; }
.performer-ticker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.performer-name {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.performer-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.performer-change { font-weight: 600; }

/* ── Status list ── */
.status-list { list-style: none; }
.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.status-item:last-child { border-bottom: none; }
.status-label { color: var(--text-secondary); }
.status-value { font-variant-numeric: tabular-nums; }

/* ── Sentiment cards ── */
.sentiment-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sentiment-card {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.sentiment-card:last-child { border-bottom: none; }
.sentiment-card:hover { background: var(--surface-2); }

.sentiment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.sc-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sc-prices {
    display: flex;
    flex-direction: column;
}
.sc-price {
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.sc-change {
    font-size: 0.8rem;
    font-weight: 600;
}
.sc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}
.sc-badges {
    display: flex;
    gap: 0.4rem;
}
.sc-toelichting {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0.4rem 0;
}
.sc-pnl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
}

/* ── Temperatuurmeter ── */
.temp-gauge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.temp-gauge-bar {
    width: 80px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.temp-gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.temp-score {
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Temperatuurbadge in tabel */
.temp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}
.temp-badge.temp-1,  .temp-badge.temp-2  { background: #ef4444; }
.temp-badge.temp-3,  .temp-badge.temp-4  { background: #f97316; }
.temp-badge.temp-5,  .temp-badge.temp-6  { background: #eab308; }
.temp-badge.temp-7,  .temp-badge.temp-8  { background: #84cc16; }
.temp-badge.temp-9,  .temp-badge.temp-10 { background: #22c55e; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.55em;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-kopen    { background: var(--success-bg); color: var(--success); }
.badge-vasthouden { background: var(--warning-bg); color: var(--warning); }
.badge-verkopen { background: var(--danger-bg);  color: var(--danger); }

.badge-sentiment-positief { background: var(--success-bg); color: var(--success); }
.badge-sentiment-neutraal { background: rgba(139,148,158,0.15); color: #8b949e; }
.badge-sentiment-negatief { background: var(--danger-bg);  color: var(--danger); }

/* ── Ticker badge ── */
.ticker-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

/* ── Watchlist grid ── */
.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}
.watchlist-card { padding: 1.25rem; }
.watchlist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}
.watchlist-ticker-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.company-name { font-size: 0.85rem; }
.watchlist-price-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.current-price {
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.watchlist-sentiment { margin-bottom: 0.75rem; }
.sentiment-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.sentiment-toelichting {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.watchlist-reason {
    font-size: 0.82rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.4rem;
}
.watchlist-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.label-small {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
    margin-top: 0.1rem;
}

/* ── Table ── */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.table .text-right { text-align: right; }
.table .text-center { text-align: center; }
.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    white-space: nowrap;
}

/* ── Formulieren ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-group-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.required { color: var(--danger); }

.form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem;
    font-family: var(--font);
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
textarea.form-control { resize: vertical; min-height: 72px; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); border-color: var(--border-hover); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ── Alerts ── */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.2);
}
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ── Modal ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.modal-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.modal-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Utility ── */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }