/* ════════════════════════════════════════════════════════════════
 * company.css -- Shared styles for all per-company CEBE pages.
 * Loaded by /company/{TICKER}/index.html files.
 * ════════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0a0a; --bg-card: #111; --bg-secondary: #151515; --bg-elevated: #1a1a1a;
    --text-primary: #f5f5f5; --text-secondary: #d1d1d1; --text-muted: #A0A0A0;
    --border-subtle: rgba(255,255,255,0.06); --border: rgba(255,255,255,0.08);
    --orange-primary: #f97316; --orange-border: rgba(249,115,22,0.3);
    --green: #22c55e; --red: #ef4444; --yellow: #eab308; --blue: #3b82f6;
    --mono: 'JetBrains Mono', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: var(--mono); line-height: 1.5; }
.container { max-width: 1100px; margin: 0 auto; padding: 80px 20px 40px; }
.loading-wrap { text-align: center; padding: 100px 20px; color: var(--text-muted); font-size: 1.3rem; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--orange-primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ COMPANY HEADER ═══ */
.co-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.co-name { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.5px; }
.co-ticker-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.co-ticker-pill { display: inline-block; padding: 3px 10px; border-radius: 5px; border: 1px solid var(--orange-border); background: rgba(249,115,22,0.08); color: var(--orange-primary); font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; }
.co-exchange { color: var(--text-muted); font-size: 1.1rem; }
.co-links { display: flex; gap: 10px; margin-top: 4px; }
.co-link { color: var(--orange-primary); text-decoration: none; font-size: 1.05rem; border: 1px solid var(--orange-border); border-radius: 6px; padding: 4px 12px; transition: all 0.15s; }
.co-link:hover { background: rgba(249,115,22,0.1); }

/* ═══ SECTION TITLES ═══ */
.section { margin-bottom: 32px; }
.section-title { font-size: 1.0rem; font-weight: 700; letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; }

/* ═══ KEY METRICS ROW ═══ */
.metrics-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px 16px; }
.metric-card-label { font-size: 0.95rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 4px; }
.metric-card-value { font-size: 1.8rem; font-weight: 800; }
.metric-card-sub { font-size: 0.95rem; color: var(--text-muted); margin-top: 2px; }
.val-green { color: var(--green); }
.val-red { color: var(--red); }
.val-yellow { color: var(--yellow); }
.val-orange { color: var(--orange-primary); }

/* ═══ QUARTERLY DASHBOARD ═══ */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.dash-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 16px; }
.dash-card-title { font-size: 1.0rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.dash-card-value { font-size: 2.0rem; font-weight: 800; margin-bottom: 2px; }
.dash-card-trend { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 6px; }
.dash-card-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 5px; font-size: 0.95rem; font-weight: 600; }
.status-ok { background: rgba(34,197,94,0.1); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.status-warn { background: rgba(234,179,8,0.1); color: var(--yellow); border: 1px solid rgba(234,179,8,0.2); }
.status-danger { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.dash-overall { background: var(--bg-card); border: 2px solid var(--border-subtle); border-radius: 10px; padding: 16px; margin-bottom: 24px; }
.dash-overall-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.dash-overall-items { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.7; }

/* ═══ CREDIT STRUCTURE TABLE ═══ */
.credit-table-wrap { overflow-x: auto; margin-bottom: 24px; }
.credit-table { width: 100%; border-collapse: collapse; font-size: 1.1rem; }
.credit-table th { padding: 10px 14px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; font-size: 1.0rem; }
.credit-table th:first-child { text-align: left; }
.credit-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.03); text-align: right; white-space: nowrap; }
.credit-table td:first-child { text-align: left; font-weight: 600; }
.credit-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ═══ HISTORY CHART ═══ */
.history-wrap { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 16px; margin-bottom: 24px; position: relative; }
.history-legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 1.05rem; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 18px; height: 3px; border-radius: 2px; }
.chart-tabs { display: flex; gap: 2px; margin-bottom: 12px; }
.chart-tab { padding: 6px 14px; font-family: var(--mono); font-size: 0.95rem; font-weight: 600; color: var(--text-muted); background: transparent; border: 1px solid var(--border-subtle); border-radius: 6px; cursor: pointer; transition: all 0.15s; }
.chart-tab.active { color: var(--orange-primary); border-color: var(--orange-primary); background: rgba(249,115,22,0.08); }
.chart-tab:hover:not(.active) { border-color: rgba(255,255,255,0.15); color: var(--text-secondary); }
.chart-panel { display: none; }
.chart-panel.active { display: block; }
.share-chart-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 5px;
    padding: 4px 8px; font-size: 1.0rem; font-weight: 500; color: var(--text-muted);
    font-family: var(--mono); cursor: pointer; transition: all 0.15s;
    position: absolute; top: 12px; right: 12px; z-index: 5;
}
.share-chart-btn:hover { border-color: var(--orange-primary); color: var(--orange-primary); }
.share-chart-btn svg { width: 12px; height: 12px; }
.share-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--orange-primary); color: #000; padding: 8px 20px; border-radius: 8px;
    font-family: var(--mono); font-size: 1.2rem; font-weight: 600;
    z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.share-toast.visible { opacity: 1; }

/* ═══ FILING SOURCE ═══ */
.filing-note { font-size: 1.0rem; color: var(--text-muted); padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 8px; margin-bottom: 24px; }

/* ═══ NOT FOUND ═══ */
.not-found { text-align: center; padding: 80px 20px; }
.not-found h2 { font-size: 2rem; margin-bottom: 12px; }
.not-found p { color: var(--text-muted); font-size: 1.2rem; margin-bottom: 20px; }
.not-found a { color: var(--orange-primary); text-decoration: none; }

/* ═══ H1 SEMANTIC ═══ */
.page-h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 640px) {
    .container { padding: 70px 12px 30px; }
    .co-name { font-size: 1.8rem; }
    .metrics-row { grid-template-columns: 1fr 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
    .dash-card-value { font-size: 1.6rem; }
    .metric-card-value { font-size: 1.5rem; }
}
.data-protected { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
