/*
 * ==============================================================================
 * Cash/Frontend/command/cash_command-styles.css
 * ==============================================================================
 * What:
 *     Page-specific styles for the Cash Command dashboard (P3.2 — R28-R30).
 *     Extends the shared hex design system.
 *
 * Depends:
 *     /shared/css/hex-design-system.css
 *     /shared/css/hex-components.css
 *     /shared/css/hex-utilities.css
 * ==============================================================================
 */

/* ── DQ / Info banner ────────────────────────────────────────────────────── */
.dq-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 20px 4px;
    padding: 10px 16px;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.30);
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    color: #fde68a;
    font-size: 13px;
    line-height: 1.5;
}

/* ── Level badges ────────────────────────────────────────────────────────── */
.level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.level-org        { background: rgba(99,102,241,0.20); color: #a5b4fc; }
.level-vault      { background: rgba(16,185,129,0.20); color: #6ee7b7; }
.level-center     { background: rgba(245,158,11,0.20); color: #fde68a; }
.level-branch     { background: rgba(59,130,246,0.20); color: #93c5fd; }
.level-remittance { background: rgba(236,72,153,0.20); color: #f9a8d4; }
.level-atm        { background: rgba(156,163,175,0.15); color: #d1d5db; }

/* ── Reconcile strip badges ──────────────────────────────────────────────── */
.recon-strip {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 20px;
}
.recon-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: var(--surface-card, rgba(15,23,42,0.60));
    min-width: 210px;
    flex: 1;
}
.recon-badge.reconciled { border-left: 4px solid #10b981; }
.recon-badge.warning    { border-left: 4px solid #f59e0b; }
.recon-badge.diverged   { border-left: 4px solid #ef4444; }
.recon-badge.unknown    { border-left: 4px solid #6b7280; }

.recon-icon { font-size: 20px; flex-shrink: 0; }
.recon-label { font-size: 11px; color: var(--text-dim, #64748b); font-weight: 600; letter-spacing: 0.5px; }
.recon-status { font-size: 13px; font-weight: 700; }
.recon-status.reconciled { color: #10b981; }
.recon-status.warning    { color: #f59e0b; }
.recon-status.diverged   { color: #ef4444; }
.recon-status.unknown    { color: #6b7280; }
.recon-pct { font-size: 11px; color: var(--text-dim, #64748b); }

/* ── Level position table ────────────────────────────────────────────────── */
.position-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}
.position-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(99,102,241,0.30);
    flex: 1;
    overflow: hidden;
}
.position-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.4s ease;
}

/* ── Risk panel ──────────────────────────────────────────────────────────── */
.risk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 0 20px 20px;
}
.risk-module {
    background: var(--surface-card, rgba(15,23,42,0.60));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 16px;
}
.risk-module.high  { border-left: 3px solid #ef4444; }
.risk-module.med   { border-left: 3px solid #f59e0b; }
.risk-module.low   { border-left: 3px solid #10b981; }
.risk-title  { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; color: var(--text-dim, #64748b); margin-bottom: 8px; }
.risk-value  { font-size: 26px; font-weight: 700; }
.risk-value.danger  { color: #ef4444; }
.risk-value.warn    { color: #f59e0b; }
.risk-value.ok      { color: #10b981; }
.risk-sub    { font-size: 11px; color: var(--text-dim, #64748b); margin-top: 4px; }

/* ── DQ flag chip ────────────────────────────────────────────────────────── */
.dq-chip {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.30);
    color: #fde68a;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    cursor: help;
}
.dq-chip.none {
    background: transparent;
    border-color: transparent;
    color: var(--text-dim, #64748b);
    font-style: italic;
}

/* ── League table rank ───────────────────────────────────────────────────── */
.rank-cell {
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    color: #6366f1;
}
tr.dq-row td { background: rgba(245, 158, 11, 0.05); }

/* ── Sort button ─────────────────────────────────────────────────────────── */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: #a5b4fc; }
th.sort-asc::after  { content: ' ▲'; font-size: 9px; }
th.sort-desc::after { content: ' ▼'; font-size: 9px; }
