/* ============================================================
   AlphaConsensus Design System — Prototype-Aligned
   Fonts: Outfit (body) + IBM Plex Mono (numbers)
   ============================================================ */

:root {
    --bg-base: #f6f8fb;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-sidebar: #0c1222;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(99, 144, 255, 0.15);
    --border-subtle: #e8ecf2;
    --border-strong: #d1d9e6;
    --text-primary: #0f1729;
    --text-secondary: #3e4a5e;
    --text-tertiary: #64708a;
    --text-on-dark: #c8d1e0;
    --text-on-dark-muted: #8494ad;
    --accent: #4f6ef7;
    --accent-soft: rgba(79, 110, 247, 0.08);
    --accent-medium: rgba(79, 110, 247, 0.15);
    --green: #1a9a6c;
    --green-bg: rgba(26, 154, 108, 0.08);
    --green-soft: rgba(26, 154, 108, 0.12);
    --red: #d94052;
    --red-bg: rgba(217, 64, 82, 0.08);
    --red-soft: rgba(217, 64, 82, 0.12);
    --amber: #a87608;
    --amber-bg: rgba(196, 138, 18, 0.12);
    --amber-soft: rgba(196, 138, 18, 0.18);
    --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.04);
    --shadow-md: 0 2px 8px rgba(15, 23, 41, 0.06);
    --shadow-lg: 0 8px 24px rgba(15, 23, 41, 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 100px;
    --sidebar-w: 260px;
    --font-body: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
}

html {
    font-size: 15px;
}

body {
    font-family: var(--font-body);
    font-weight: 450;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ─── Sidebar ─── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.4rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4f6ef7 0%, #7c5bf5 100%);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-mode {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.6rem;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-mode.paper {
    background: rgba(196, 138, 18, 0.2);
    color: #f0c440;
}

.sidebar-mode.live {
    background: rgba(217, 64, 82, 0.2);
    color: #f06070;
}

.sidebar-nav {
    padding: 0.75rem 0.6rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-on-dark-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 450;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-on-dark);
}

.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: #97b2ff;
    font-weight: 500;
}

.sidebar-link.active i {
    color: #7da1ff;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer-info {
    font-size: 0.72rem;
    color: var(--text-on-dark-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.sidebar-footer-info .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px rgba(26, 154, 108, 0.5);
}

.sidebar-footer form {
    margin-top: 0.6rem;
}

/* ─── Content ─── */
.content-area {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 0;
}

.main-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 2rem 2rem;
}

.page-header {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

/* ─── Topbar / Status ─── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(246, 248, 251, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.topbar h1 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.status-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.pill-market-open {
    background: var(--green-bg);
    color: var(--green);
}

.pill-market-open::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-dot 2s infinite;
}

.pill-market-closed {
    background: rgba(90, 101, 120, 0.08);
    color: var(--text-secondary);
}

.pill-paper {
    background: var(--amber-bg);
    color: var(--amber);
}

.pill-live {
    background: var(--red-bg);
    color: var(--red);
}

.pill-neutral {
    background: rgba(90, 101, 120, 0.08);
    color: var(--text-secondary);
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* ─── Cards ─── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card-head {
    padding: 0.75rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.card-head-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-head-title i {
    font-size: 0.9rem;
}

.card-head-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.card-body {
    padding: 1.1rem;
}

.card-body-flush {
    padding: 0;
}

/* ─── Charts ─── */
.chart-wrap {
    position: relative;
    height: 220px;
    padding: 0.75rem 1rem 0.5rem;
}

.chart-wrap .empty-state,
.chart-wrap-lg .empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
}

.chart-wrap-lg {
    position: relative;
    height: 280px;
    padding: 0.75rem 1rem 0.5rem;
}

/* ─── Stats Row ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-panel {
    position: relative;
    overflow: hidden;
}

.stat-panel .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* ─── Risk meters ─── */
.risk-meter {
    margin-bottom: 0.6rem;
}

.risk-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.risk-meter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 450;
}

.risk-meter-value {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
}

.risk-track {
    height: 5px;
    background: var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
}

.risk-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.risk-fill.ok {
    background: linear-gradient(90deg, #1a9a6c, #22b87e);
}

.risk-fill.warn {
    background: linear-gradient(90deg, #c48a12, #e0a020);
}

.risk-fill.danger {
    background: linear-gradient(90deg, #d94052, #e85d6e);
}

/* ─── Regime ─── */
.regime-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
}

.regime-badge.up {
    background: var(--green-soft);
    color: var(--green);
}

.regime-badge.down {
    background: var(--red-soft);
    color: var(--red);
}

.regime-badge.sideways {
    background: var(--amber-soft);
    color: var(--amber);
}

.regime-badge.unknown {
    background: rgba(90, 101, 120, 0.1);
    color: var(--text-secondary);
}

.regime-confidence {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.regime-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ─── AI Consensus ─── */
.ai-votes {
    display: flex;
    gap: 4px;
    margin-bottom: 0.5rem;
}

.ai-vote {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 0.85rem;
}

.ai-vote.approve {
    background: var(--green-soft);
    color: var(--green);
}

.ai-vote.block {
    background: var(--red-soft);
    color: var(--red);
}

.ai-vote.abstain {
    background: rgba(90, 101, 120, 0.08);
    color: var(--text-tertiary);
}

.ai-meta {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 1rem;
}

.ai-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Tables ─── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    padding: 0.6rem 1rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(79, 110, 247, 0.02);
}

/* ─── Typography utilities ─── */
.mono {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: -0.02em;
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.text-amber {
    color: var(--amber);
}

.text-2xs {
    font-size: 0.6rem;
}

.text-xs {
    font-size: 0.7rem;
}

.text-sm {
    font-size: 0.8rem;
}

.pnl-value {
    font-size: 1.1rem;
}

.pre-wrap {
    white-space: pre-wrap;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-sm {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-lg {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ─── Tags ─── */
.tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.tag-buy {
    background: var(--green-soft);
    color: var(--green);
}

.tag-sell {
    background: var(--red-soft);
    color: var(--red);
}

.tag-strategy {
    background: rgba(79, 110, 247, 0.08);
    color: var(--accent);
}

.tag-accent {
    background: var(--accent-soft);
    color: var(--accent);
}

.tag-neutral {
    background: rgba(90, 101, 120, 0.08);
    color: var(--text-secondary);
}

.tag-warning {
    background: var(--amber-soft);
    color: var(--amber);
}

.tag-danger {
    background: var(--red-soft);
    color: var(--red);
}

.tag-success {
    background: var(--green-soft);
    color: var(--green);
}

/* ─── P&L Chips ─── */
.pnl-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
}

.pnl-chip.pos {
    background: var(--green-bg);
    color: var(--green);
}

.pnl-chip.neg {
    background: var(--red-bg);
    color: var(--red);
}

.sl-distance {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.position-duration {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ─── Signal Feed ─── */
.signal-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.signal-item:last-child {
    border-bottom: none;
}

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

.signal-dot.buy {
    background: var(--green);
}

.signal-dot.sell {
    background: var(--red);
}

.signal-info {
    flex: 1;
    min-width: 0;
}

.signal-info-top {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.signal-info-bottom {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 0.75rem;
    margin-top: 2px;
}

.signal-time {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* ─── Metric Cards ─── */
.metric-card {
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 0.35rem;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.metric-sub {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* ─── Status dots ─── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

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

.status-dot-amber {
    background: var(--amber);
}

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

/* ─── Event badges ─── */
.event-badge {
    display: inline-flex;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ─── Accordion overrides ─── */
.accordion-button {
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    background: var(--accent-soft);
    color: var(--text-primary);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--border-subtle);
}

.accordion-item {
    border-color: var(--border-subtle);
    background: var(--bg-surface);
    border-left: none;
    border-right: none;
}

/* ─── Parameter editing ─── */
.param-row {
    transition: background 0.15s;
}

.param-edit-row {
    background: rgba(79, 110, 247, 0.03);
}

/* ─── Timeline (parameter history) ─── */
.timeline-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8rem;
}

.timeline-item:last-child {
    border-bottom: none;
}

/* ─── Toast container ─── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1080;
}

.toast {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* ─── Empty States ─── */
.empty-state {
    text-align: center;
    color: var(--text-tertiary);
    padding: 1.5rem 1rem;
}

.empty-state-icon {
    font-size: 1.5rem;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.empty-state-title {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.empty-state-hint {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ─── Filter Controls ─── */
.filter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─── Date Presets ─── */
.date-preset {
    padding: 4px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.date-preset:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.date-preset.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.form-control-date {
    width: 140px;
}

/* ─── Search Input ─── */
.search-input-wrap {
    position: relative;
    width: 100%;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    padding-left: 2.25rem;
}

/* ─── Modal Custom ─── */
.modal-custom .modal-content {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-custom .modal-header {
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-custom .modal-title {
    font-size: 0.95rem;
    font-weight: 600;
}

/* ─── Trade Detail ─── */
.trade-detail-table {
    font-size: 0.85rem;
}

.trade-detail-label {
    width: 40%;
}

.ai-code-block {
    font-size: 0.8rem;
    background: var(--bg-base);
    padding: 0.75rem;
    border-radius: 8px;
}

.state-log-scroll {
    max-height: 250px;
    overflow-y: auto;
}

/* ─── Grid Layouts ─── */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* ─── Login ─── */
.login-wrapper {
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    max-width: 380px;
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
}

.login-brand {
    text-align: center;
    padding: 2rem 1.5rem 1rem;
}

.login-brand .sidebar-logo {
    margin: 0 auto 0.75rem;
}

.login-brand-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.login-form {
    padding: 0 1.5rem 1.5rem;
}

.login-alert {
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
}

.btn-accent.btn-lg, .btn-accent:not(.btn-sm):not(.btn-lg) {
    padding: 0.6rem 1.2rem;
}

.btn-accent:hover {
    background: #3d5bdb;
    color: #fff;
}

.btn-accent:active {
    background: #3350c4;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-ghost:hover {
    background: var(--bg-base);
    color: var(--text-primary);
}

/* ─── Mobile ─── */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-sidebar);
    padding: 0 1rem;
    height: 50px;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
}

.mobile-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
}

.mobile-header .sidebar-mode {
    margin-top: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    margin-right: 0.75rem;
}

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .content-area {
        margin-left: 0;
    }

    .main-grid {
        padding: 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .chart-wrap {
        height: 180px;
    }

    .chart-wrap-lg {
        height: 200px;
    }

    .page-header {
        font-size: 1.1rem;
    }

    .two-col-grid {
        grid-template-columns: 1fr;
    }

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

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

    /* Topbar stacking */
    .topbar {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .topbar h1 {
        font-size: 0.95rem;
    }

    .topbar > .d-flex {
        flex-wrap: wrap;
        width: 100%;
    }

    .topbar .form-control-date {
        width: auto;
        flex: 1;
        min-width: 120px;
    }

    .topbar .date-preset {
        flex: 1;
    }

    /* Filter stacking */
    .filter-bar {
        flex-direction: column;
    }

    .filter-bar > * {
        width: 100%;
    }

    .filter-bar .btn {
        width: 100%;
    }

    /* Search full-width */
    .search-input-wrap {
        max-width: none;
    }

    /* Table column hiding */
    .data-table .col-hide-mobile {
        display: none;
    }

    /* Touch targets — only on interactive controls that need it */
    .sidebar-link {
        padding: 0.75rem 0.85rem;
    }

    .date-preset {
        min-height: 44px;
    }

    .page-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile typography floors */
    .text-2xs {
        font-size: 0.7rem;
    }

    .text-xs {
        font-size: 0.75rem;
    }

    .tag, .pill, .event-badge {
        font-size: 0.72rem;
    }

    .metric-label, .risk-meter-label {
        font-size: 0.78rem;
    }

    .card-head-title {
        font-size: 0.8rem;
    }
}

/* ─── Entrance animations ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeUp 0.4s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.delay-1 {
    animation-delay: 0.05s;
}

.delay-2 {
    animation-delay: 0.1s;
}

.delay-3 {
    animation-delay: 0.15s;
}

.delay-4 {
    animation-delay: 0.2s;
}

.delay-5 {
    animation-delay: 0.25s;
}
