:root {
  --bg: #0f0f0f;
  --ink: #ffffff;
  --muted: #b8b8b8;
  --card: #181818;
  --line: #2c2c2c;
  --accent: #ff6a00;
  --soft: #242424;
  --good: #38a169;
  --warn: #ffb020;
  --danger: #ff5a5f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 34px; box-shadow: 0 24px 70px rgba(47, 35, 22, .12); }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-size: 11px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 34px; margin-bottom: 10px; }
h2 { font-size: 28px; margin-bottom: 0; }
h3 { margin-bottom: 0; font-size: 19px; }
.muted { color: var(--muted); }
label { display: block; color: var(--muted); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
input, select { width: 100%; border: 1px solid var(--line); background: #111; border-radius: 14px; padding: 13px 14px; font: inherit; color: var(--ink); }
button { border: 0; border-radius: 14px; padding: 13px 17px; font-weight: 800; cursor: pointer; background: var(--accent); color: white; }
button:disabled { opacity: .55; cursor: not-allowed; }
.login-card button { width: 100%; margin-top: 16px; }
.status { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-size: 14px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #080808; color: white; padding: 26px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; }
.sidebar .eyebrow { color: #bcb1a1; }
.sidebar h1 { font-size: 26px; }
.sidebar-logo { width: min(210px, 100%); height: auto; display: block; object-fit: contain; margin: 0 auto 10px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; }
.logout-logo { width: min(190px, 100%); height: auto; display: block; object-fit: contain; margin: 0 auto; }
nav { display: grid; gap: 8px; }
nav a { color: #efe6d8; text-decoration: none; padding: 12px 14px; border-radius: 14px; font-weight: 700; }
nav a.active, nav a:hover { background: rgba(255,255,255,.12); }
.ghost-button { width: 100%; background: rgba(255,255,255,.10); color: white; }
.content { padding: 30px; max-width: 1420px; width: 100%; }
.topbar, .panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { align-items: flex-start; }
.hero-logo { width: min(420px, 52vw); height: auto; display: block; object-fit: contain; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); }
.card { padding: 20px; }
.card strong { display: block; font-size: 26px; margin-top: 8px; }
.panel { padding: 22px; margin-bottom: 20px; }
.filters { margin-top: 18px; display: grid; grid-template-columns: 1.7fr .75fr .65fr auto; gap: 12px; align-items: center; }
.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 0; }
.toggle input { width: auto; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 12px; border-bottom: 1px solid var(--line); }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255, 106, 0, .10); }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--soft); color: var(--muted); }
.badge.signed { background: rgba(56, 161, 105, .16); color: var(--good); }
.badge.needs_review { background: rgba(255, 176, 32, .16); color: var(--warn); }
.badge.superseded { background: rgba(255, 90, 95, .16); color: var(--danger); }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; justify-content: flex-end; padding: 18px; z-index: 20; }
.drawer-card { width: min(760px, 100%); height: 100%; overflow: auto; background: var(--card); border-radius: 28px; padding: 26px; position: relative; box-shadow: 0 30px 90px rgba(0,0,0,.26); }
.close-button { position: sticky; top: 0; float: right; width: 42px; height: 42px; padding: 0; border-radius: 50%; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.detail-item { background: #111; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.detail-item span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.link-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.link-row a { background: var(--accent); color: white; text-decoration: none; border-radius: 14px; padding: 10px 13px; font-weight: 800; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #080808; color: #fff8ec; border-radius: 18px; padding: 16px; max-height: 340px; overflow: auto; }
.event { border-left: 4px solid var(--line); padding: 10px 0 10px 14px; margin: 10px 0; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-logo, .logout-logo { margin-left: 0; margin-right: 0; }
  .hero-logo { width: min(360px, 70vw); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .cards, .detail-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
}

.assumption-box { margin: 8px 0 24px; background: #111; border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; }
.assumption-box div { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.assumption-box span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.assumption-box strong { color: var(--ink); }
.ebitda-grid .detail-item:last-child strong, .ebitda-grid .detail-item:nth-last-child(2) strong { color: var(--accent); }
button:hover, .link-row a:hover { background: #e85f00; }


.all-fields-grid .detail-item strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.json-section-list {
  display: grid;
  gap: 12px;
}

.json-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #101010;
  padding: 14px 16px;
}

.json-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.json-section pre {
  margin-top: 12px;
}

.card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-top: 6px;
}

.compact-cards {
  margin-bottom: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rmr-panel .cards {
  margin-top: 18px;
}

.subscription-grid .detail-item strong,
.ebitda-grid .detail-item strong {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .compact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .compact-cards { grid-template-columns: 1fr; }
}

.ghost-link {
  color: white;
  background: rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 12px 15px;
  text-decoration: none;
  font-weight: 800;
}

.calculator-placeholder {
  margin-top: 18px;
  min-height: 320px;
  border: 1px dashed rgba(255, 106, 0, .55);
  border-radius: 24px;
  background: #111;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  gap: 8px;
  padding: 28px;
}

.calculator-placeholder strong {
  color: var(--ink);
  font-size: 24px;
}
