/* === Invest – App CSS === */

:root {
    --sidebar-bg: #1a2332;
    --sidebar-width: 220px;
    --navbar-height: 56px;
}

/* ── Layout ──────────────────────────────────────────────────────────────────── */

body {
    background: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    flex-shrink: 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* ── Page header ────────────────────────────────────────────────────────────── */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

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

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: none;
    border-bottom: 1px solid #f1f5f9;
}

/* Stat card */
.stat-card {
    padding: 18px 22px;
}

.stat-label {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

/* Portfolio card */
.portfolio-card {
    transition: transform 0.12s, box-shadow 0.12s;
    cursor: pointer;
}

.portfolio-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */

.table {
    font-size: 0.875rem;
}

.table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 600;
    border-top: none;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    color: #334155;
}

.ticker-badge {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

/* ── Gain/Loss ──────────────────────────────────────────────────────────────── */

.gain    { color: #16a34a; font-weight: 500; }
.loss    { color: #dc2626; font-weight: 500; }
.neutral { color: #94a3b8; }

/* ── Security type badges ──────────────────────────────────────────────────── */

.type-etf {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.type-stock {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Price states ───────────────────────────────────────────────────────────── */

.price-stale   { color: #f59e0b; }
.price-loading { color: #94a3b8; }

/* ── Empty state ────────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 { color: #64748b; }

/* ── Dividend calendar ──────────────────────────────────────────────────────── */

.div-month-header {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
    padding: 8px 0 4px;
}

.div-amount { color: #16a34a; font-weight: 600; }

/* ── Ticker search results ──────────────────────────────────────────────────── */

.search-result-item {
    padding: 9px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
}

.search-result-item:hover { background: #f1f5f9; }

.search-result-item .ticker {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-weight: 700;
    font-size: 0.9rem;
}

.search-result-item .name {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

/* ── Spinner ────────────────────────────────────────────────────────────────── */

.spin {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

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

/* ── Toast animation ────────────────────────────────────────────────────────── */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 767px) {
    main.flex-grow-1 { padding: 16px !important; }
}
