/* ratioTrends.css — Full Restructure (Apr 2026) */

.rt-module {
    font-family: var(--liq-font-body);
    color: var(--liq-text);
    padding: 0;
    background: var(--liq-bg);
}

.rt-shell { background: transparent; border: none; padding: 0; }

/* ===== Hero Header ===== */
.rt-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 60%, #283548 100%);
    color: white;
    padding: 1.25rem 1.75rem;
    border-radius: 12px;
    box-shadow: var(--liq-shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.rt-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 40%;
    height: 180%;
    background: radial-gradient(ellipse at 80% 20%, rgba(74, 144, 128, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.rt-hero-left { display: flex; align-items: center; gap: 1.25rem; position: relative; z-index: 1; }

.rt-hero-ring { width: 64px; height: 64px; flex-shrink: 0; }
.rt-hero-ring svg { transform: rotate(-90deg); }
.rt-hero-ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.rt-hero-ring .rt-ring-bg { stroke: rgba(255,255,255,0.12); }
.rt-hero-ring .rt-ring-fill { transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1); }
.rt-score-good .rt-ring-fill { stroke: #34D399; }
.rt-score-fair .rt-ring-fill { stroke: #FBBF24; }
.rt-score-poor .rt-ring-fill { stroke: #F87171; }

.rt-hero-ring-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--liq-font-mono);
    font-size: 1.125rem;
    font-weight: 700;
}

.rt-score-good .rt-hero-ring-center { color: #34D399; }
.rt-score-fair .rt-hero-ring-center { color: #FBBF24; }
.rt-score-poor .rt-hero-ring-center { color: #F87171; }

.rt-hero-text h3 {
    margin: 0 0 0.15rem;
    font-family: var(--liq-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.rt-hero-text p {
    margin: 0;
    opacity: 0.55;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

.rt-hero-actions {
    display: flex;
    gap: 0.375rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.rt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--liq-font-body);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s var(--liq-ease);
    line-height: 1;
}

.rt-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rt-btn svg { flex-shrink: 0; }

.rt-btn-hero {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
    border-color: rgba(255,255,255,0.12);
}

.rt-btn-hero:hover { background: rgba(255,255,255,0.16); color: white; }

/* ===== Content Area ===== */
.rt-content-area {
    background: var(--liq-surface);
    border: 1px solid var(--liq-border-lighter);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

/* ===== Tabs ===== */
.rt-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--liq-border-lighter);
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.rt-tabs::-webkit-scrollbar { display: none; }

.rt-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.7rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--liq-font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--liq-text-muted);
    position: relative;
    white-space: nowrap;
    transition: color 0.2s var(--liq-ease);
}

.rt-tab::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0.5rem; right: 0.5rem;
    height: 2px;
    background: transparent;
    border-radius: 2px 2px 0 0;
    transition: background 0.2s var(--liq-ease), transform 0.2s var(--liq-ease);
    transform: scaleX(0);
}

.rt-tab:hover { color: var(--liq-text-secondary); }
.rt-tab:hover::after { background: var(--liq-border-light); transform: scaleX(1); }
.rt-tab.active { color: var(--liq-text); font-weight: 600; }
.rt-tab.active::after { background: var(--liq-accent); transform: scaleX(1); }
.rt-tab svg { width: 14px; height: 14px; }

/* ===== Controls ===== */
.rt-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.rt-period-toggle {
    display: inline-flex;
    gap: 2px;
    background: var(--liq-bg);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--liq-border-light);
}

.rt-period-btn {
    padding: 0.35rem 0.875rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--liq-font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--liq-text-muted);
    transition: all 0.2s var(--liq-ease);
}

.rt-period-btn:hover { color: var(--liq-text-secondary); }
.rt-period-btn.active { background: var(--liq-text); color: white; box-shadow: var(--liq-shadow-sm); }

/* ===== Alerts ===== */
.rt-alert { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.8125rem; margin-bottom: 0.75rem; }
.rt-alert p { margin: 0.125rem 0; }
.rt-alert-error { background: var(--liq-loss-light); color: var(--liq-loss); border: 1px solid rgba(190,18,60,0.15); }
.rt-alert-warn { background: var(--liq-warning-light); color: #92400E; border: 1px solid rgba(202,138,4,0.15); }

/* ============================================================
   OVERVIEW TAB — Category Panels Layout
   ============================================================ */

.rt-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.rt-category-panel {
    background: var(--liq-surface);
    border: 1px solid var(--liq-border-lighter);
    border-radius: 10px;
    padding: 1rem 1.125rem;
    border-top: 3px solid var(--liq-border-light);
    transition: all 0.2s var(--liq-ease);
}

.rt-category-panel:hover {
    box-shadow: var(--liq-shadow-sm);
    border-color: var(--liq-border);
}

.rt-cat-Profitability { border-top-color: #047857; }
.rt-cat-Liquidity { border-top-color: #1E40AF; }
.rt-cat-Efficiency { border-top-color: #7C3AED; }
.rt-cat-Leverage { border-top-color: #CA8A04; }

.rt-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--liq-border-lighter);
}

.rt-panel-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rt-cat-Profitability .rt-panel-title { color: #047857; }
.rt-cat-Liquidity .rt-panel-title { color: #1E40AF; }
.rt-cat-Efficiency .rt-panel-title { color: #7C3AED; }
.rt-cat-Leverage .rt-panel-title { color: #CA8A04; }

.rt-panel-title svg { width: 13px; height: 13px; }

.rt-panel-score {
    font-family: var(--liq-font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.rt-panel-score-good { color: #047857; background: rgba(4,120,87,0.1); }
.rt-panel-score-fair { color: #92400E; background: rgba(202,138,4,0.1); }
.rt-panel-score-poor { color: #BE123C; background: rgba(190,18,60,0.1); }

.rt-ratio-list { display: flex; flex-direction: column; gap: 0.5rem; }

.rt-ratio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.rt-ratio-name {
    font-size: 0.8125rem;
    color: var(--liq-text-secondary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-ratio-val {
    font-family: var(--liq-font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--liq-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rt-ratio-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.375rem;
    border-radius: 8px;
    white-space: nowrap;
}

.rt-badge-good { color: #047857; background: rgba(4,120,87,0.1); }
.rt-badge-fair { color: #92400E; background: rgba(202,138,4,0.1); }
.rt-badge-poor { color: #BE123C; background: rgba(190,18,60,0.1); }
.rt-badge-na { color: var(--liq-text-muted); background: var(--liq-bg); }

.rt-ratio-change {
    font-family: var(--liq-font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.rt-ratio-change.up { color: #047857; }
.rt-ratio-change.down { color: #BE123C; }
.rt-ratio-change.flat { color: var(--liq-text-muted); }

/* Takeaways section */
.rt-takeaways {
    background: var(--liq-bg);
    border: 1px solid var(--liq-border-lighter);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.rt-takeaways-title {
    font-family: var(--liq-font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--liq-text-muted);
    margin: 0 0 0.625rem;
}

.rt-takeaway-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    color: var(--liq-text-secondary);
    line-height: 1.45;
}

.rt-takeaway-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.375rem;
}

.rt-takeaway-dot.good { background: #047857; }
.rt-takeaway-dot.poor { background: #BE123C; }
.rt-takeaway-dot.info { background: var(--liq-accent); }

/* ============================================================
   TRENDS TAB — 2-Column Chart Grid
   ============================================================ */

.rt-trend-section { margin-bottom: 1.5rem; }

.rt-trend-section-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rt-trend-section-header svg { width: 13px; height: 13px; }

.rt-sect-Profitability { color: #047857; }
.rt-sect-Liquidity { color: #1E40AF; }
.rt-sect-Efficiency { color: #7C3AED; }
.rt-sect-Leverage { color: #CA8A04; }

.rt-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.rt-chart-card {
    background: var(--liq-surface);
    border: 1px solid var(--liq-border-lighter);
    border-radius: 10px;
    padding: 1rem 1.125rem;
    transition: all 0.2s var(--liq-ease);
}

.rt-chart-card:hover { box-shadow: var(--liq-shadow-sm); border-color: var(--liq-border); }

.rt-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.rt-chart-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--liq-text);
}

.rt-chart-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rt-chart-latest {
    font-family: var(--liq-font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--liq-text);
    font-variant-numeric: tabular-nums;
}

.rt-chart-change {
    font-family: var(--liq-font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.rt-chart-change.up { color: #047857; background: rgba(4,120,87,0.08); }
.rt-chart-change.down { color: #BE123C; background: rgba(190,18,60,0.08); }

.rt-chart-body { height: 220px; position: relative; }
.rt-chart-body .liq-apex-host { width: 100%; min-height: 220px; }

/* ============================================================
   HEATMAP TAB
   ============================================================ */

.rt-heatmap-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--liq-border-lighter);
}

.rt-heatmap { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }

.rt-heatmap th, .rt-heatmap td {
    padding: 0.5rem 0.625rem;
    text-align: center;
    border-bottom: 1px solid var(--liq-border-lighter);
    border-right: 1px solid var(--liq-border-lighter);
}

.rt-heatmap th:last-child, .rt-heatmap td:last-child { border-right: none; }

.rt-heatmap thead th {
    background: var(--liq-bg);
    font-family: var(--liq-font-mono);
    font-weight: 600;
    font-size: 0.6875rem;
    color: var(--liq-text-secondary);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rt-hm-label {
    text-align: left !important;
    font-weight: 500;
    color: var(--liq-text);
    white-space: nowrap;
    background: var(--liq-surface);
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 140px;
}

.rt-hm-cat-row td {
    background: var(--liq-bg);
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.6875rem;
    padding: 0.5rem 0.625rem;
    border-bottom: 2px solid var(--liq-border-light);
}

.rt-hm-cat-Profitability td { color: #047857; }
.rt-hm-cat-Liquidity td { color: #1E40AF; }
.rt-hm-cat-Efficiency td { color: #7C3AED; }
.rt-hm-cat-Leverage td { color: #CA8A04; }

.rt-hm-cell {
    font-family: var(--liq-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    transition: all 0.15s var(--liq-ease);
    cursor: default;
}

.rt-hm-cell:hover { box-shadow: inset 0 0 0 2px var(--liq-accent); position: relative; z-index: 1; }

.rt-hm-cell.hm-good { background: rgba(4,120,87,0.08); color: #047857; }
.rt-hm-cell.hm-fair { background: rgba(202,138,4,0.08); color: #92400E; }
.rt-hm-cell.hm-poor { background: rgba(190,18,60,0.08); color: #BE123C; }
.rt-hm-cell.hm-empty { color: var(--liq-text-muted); }

/* ===== Empty ===== */
.rt-empty {
    text-align: center;
    padding: 3rem;
    color: var(--liq-text-muted);
    font-size: 0.875rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .rt-overview-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .rt-hero { flex-direction: column; align-items: flex-start; padding: 1rem; }
    .rt-content-area { padding: 1rem; }
    .rt-overview-grid { grid-template-columns: 1fr; }
    .rt-chart-grid { grid-template-columns: 1fr; }
}

/* ===== Print ===== */
@media print {
    .rt-hero { box-shadow: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .rt-tabs, .rt-controls, .rt-hero-actions { display: none; }
    .rt-category-panel, .rt-chart-card { page-break-inside: avoid; box-shadow: none; }
}

/* ===== Focus ===== */
.rt-btn:focus-visible, .rt-tab:focus-visible, .rt-period-btn:focus-visible {
    outline: 2px solid var(--liq-accent);
    outline-offset: 2px;
}
