/* The Dollar Stress Dashboard — Phase 2 styles
   Phase 1 base + Auctions tab table styling. */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(to bottom, #f7fafc, #fff);
    padding: 2rem;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1 {
    font-size: 2.5rem;
    color: #1a202c;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

h2 {
    font-size: 1.8rem;
    color: #2d3748;
    margin: 2rem 0 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

p, label {
    font-size: 18px;
    margin-bottom: 1rem;
    color: #4a5568;
}

a {
    color: #4299e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2b6cb0;
}

/* Breadcrumb (matches russia_exchange_rate.html) */
.breadcrumb {
    display: flex;
    list-style: none;
    margin-bottom: 2rem;
    background-color: #f8fafc;
    padding: 10px 15px;
    border-radius: 6px;
}

.breadcrumb li { margin-right: 10px; }

.breadcrumb li:after {
    content: "›";
    margin-left: 10px;
    color: #718096;
}

.breadcrumb li:last-child:after { content: ""; }

.outstanding-text {
    font-size: 16px;
    font-weight: bold;
    color: #2a2a2a;
    background: #ebf8ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #4299e1;
}

.ds-meta-line {
    font-size: 14px;
    color: #718096;
    margin-bottom: 2rem;
}

/* Tabs */
.ds-tabs {
    display: flex;
    gap: 0;
    margin: 2rem 0 0;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.ds-tab {
    font-family: inherit;
    font-size: 15px;
    background: none;
    border: 0;
    padding: 12px 20px;
    cursor: pointer;
    color: #718096;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.ds-tab:hover { color: #2d3748; }

.ds-tab-active {
    color: #2b6cb0;
    border-bottom-color: #4299e1;
    font-weight: 600;
}

.ds-pane { padding: 1.5rem 0 2rem; }

/* Cadence badges */
.ds-cad {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 8px;
    border-radius: 3px;
    vertical-align: middle;
}

.ds-cad-D { background: #e6fffa; color: #234e52; }
.ds-cad-W { background: #ebf8ff; color: #2a4365; }
.ds-cad-M { background: #faf5ff; color: #44337a; }
.ds-cad-Q { background: #fffaf0; color: #5f370e; }
.ds-cad-S { background: #fff5f5; color: #63171b; }

/* Metric tiles — now 4 across the funding row */
.ds-metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin: 1.5rem 0 2rem;
}

.ds-metric {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ds-metric-label {
    font-size: 11px;
    color: #718096;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ds-metric-value {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.ds-metric-foot {
    font-size: 12px;
    color: #a0aec0;
    margin: 8px 0 0;
}

/* Chart container — dark, matches russia_exchange_rate */
.chart-container {
    height: 420px;
    margin: 2rem 0;
    background-color: #222;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#ds-funding-chart {
    width: 100%;
    height: 100%;
}

.ds-source-foot {
    font-size: 13px;
    color: #718096;
    line-height: 1.6;
    margin-top: 1rem;
}

/* ─── Auctions table ─────────────────────────────────────────── */

.ds-table-wrap {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ds-auctions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ds-auctions-table thead th {
    background: #f7fafc;
    color: #4a5568;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.ds-auctions-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

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

.ds-auctions-table tbody tr:hover {
    background: #f8fafc;
}

.ds-auctions-table .ds-num {
    text-align: right;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
}

.ds-auctions-table .ds-empty {
    text-align: center;
    color: #a0aec0;
    padding: 32px;
    font-style: italic;
}

/* Color signals on auction tape */
.ds-tail-good { color: #22543d; font-weight: 600; }   /* tail < 0 (stop-through) */
.ds-tail-bad  { color: #c53030; font-weight: 600; }   /* tail >= 1.5 bp */
.ds-indir-good { color: #22543d; }                     /* indirect >= 70% */
.ds-indir-bad  { color: #c53030; }                     /* indirect < 65% */
.ds-dlr-bad    { color: #c53030; font-weight: 600; }   /* dealer >= 18% */

.ds-sec-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #edf2f7;
    color: #4a5568;
    font-size: 12px;
    font-weight: 500;
}

.ds-reopening {
    color: #718096;
    font-size: 11px;
    margin-left: 4px;
    font-style: italic;
}

/* Sources list */
.ds-source-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}

.ds-source-row:last-child { border-bottom: none; }

.ds-source-name {
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.ds-source-detail {
    font-size: 13px;
    color: #718096;
    margin: 4px 0 0;
}

.ds-source-link {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    color: #a0aec0;
    margin-top: 6px;
    word-break: break-all;
}

.ds-source-stale { opacity: 0.55; }

.ds-source-marker {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 10px;
    vertical-align: middle;
    font-weight: 600;
}

.ds-source-marker-fresh { background: #c6f6d5; color: #22543d; }
.ds-source-marker-stale { background: #feebc8; color: #7b341e; }

/* Footer */
.footer {
    padding-top: 50px;
    margin-top: 4rem;
    border-top: 2px solid #e2e8f0;
    text-align: center;
    color: #718096;
}

.footer p { margin-bottom: 0.5rem; }

/* Mobile */
@media (max-width: 768px) {
    body { padding: 1rem; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; flex-wrap: wrap; }
    .ds-metric-value { font-size: 20px; }
    .chart-container { height: 320px; padding: 12px; }
    .ds-auctions-table { font-size: 12px; }
    .ds-auctions-table thead th,
    .ds-auctions-table tbody td { padding: 8px 10px; }
}

/* ─── Phase 3b: MFH tiles + sub-headings ─────────────────────────────────── */
.ds-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 18px 0 22px;
}
.ds-tile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 14px 16px;
}
.ds-tile-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #a0aec0;
    margin-bottom: 6px;
}
.ds-tile-value {
    font-family: var(--ds-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
    font-size: 22px;
    font-weight: 600;
    color: #f7fafc;
    margin-bottom: 4px;
}
.ds-tile-sub {
    font-size: 12px;
    color: #a0aec0;
    font-family: var(--ds-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
}
.ds-subhead {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #cbd5e0;
    margin: 24px 0 10px;
}

/* Signed change coloring (subtle, not the red-flag color) */
.ds-auctions-table tbody td.ds-pos { color: #68d391; }
.ds-auctions-table tbody td.ds-neg { color: #fc8181; }

@media (max-width: 768px) {
    .ds-tiles { grid-template-columns: 1fr 1fr; }
    .ds-tile-value { font-size: 18px; }
}
