/* CorSec Hub — corporate trust: dark navy & charcoal, gold accents. Theme switchable. */
* { box-sizing: border-box; }
:root, [data-theme="dark"] {
  --bg: #0b1526; --bg2: #0e1b30; --panel: #13233c; --panel2: #182b47;
  --line: #24395a; --text: #e8edf5; --muted: #93a7c1; --faint: #6b7f9c;
  --accent: #d4a944; --accent2: #e7c15f; --on-accent: #17130a;
  --good: #45d09a; --warn: #f0a832; --bad: #f0665f; --info: #5aa7e8;
  --shadow: 0 12px 34px rgba(2, 8, 20, .45);
}
[data-theme="light"] {
  --bg: #f2f5fa; --bg2: #e9eef6; --panel: #ffffff; --panel2: #f5f8fc;
  --line: #d7dfec; --text: #17233a; --muted: #4d6079; --faint: #78899f;
  --accent: #9a7414; --accent2: #7d5e0f; --on-accent: #ffffff;
  --good: #0e8f5f; --warn: #a86a08; --bad: #c23a34; --info: #1f6dbb;
  --shadow: 0 10px 28px rgba(23, 35, 58, .12);
}
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--accent2); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.price, .money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Buttons & inputs ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent2), var(--accent)); color: var(--on-accent); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }

/* ── Chrome ── */
.topnav {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--line);
}
.topnav .inner { display: flex; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand img { height: 36px; width: auto; }
.navlinks { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.navlinks a, .navlinks button.linky {
  color: var(--muted); padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: .92rem;
  background: none; border: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center;
}
.navlinks a:hover { color: var(--text); text-decoration: none; background: var(--panel2); }
.theme-toggle { min-width: 44px; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg2); white-space: nowrap;
}
.pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill.bad  { color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.pill.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.pill.gold { color: var(--accent2); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* ── Landing ── */
.hero { padding: 84px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 130%;
  background:
    radial-gradient(600px 320px at 78% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 420px at 15% 0%, rgba(60, 110, 190, .18), transparent 70%);
  pointer-events: none;
}
.hero .inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center; }
.hero .inner > * { min-width: 0; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 3.6rem); letter-spacing: -.02em; line-height: 1.06; }
.hero h1 .gold { color: var(--accent2); }
.hero p.lede { color: var(--muted); font-size: 1.15rem; max-width: 34rem; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.kicker { color: var(--accent2); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: .78rem; }

.mock { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; }
.mock .mrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mock .mrow:last-child { border-bottom: none; }
.mock .bar { height: 8px; border-radius: 6px; background: var(--bg2); overflow: hidden; flex: 1; margin: 0 10px; }
.mock .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); }

.section { padding: 64px 0; }
.section.alt { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.01em; }
.section .sub { color: var(--muted); max-width: 44rem; margin-bottom: 34px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid3 > * { min-width: 0; }

/* Two-column work area that collapses on phones (never overflows at 375px) */
.split2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; margin-top: 14px; }
.split2 > * { min-width: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card h3 { font-size: 1.05rem; }
.card p { color: var(--muted); font-size: .92rem; margin: .3rem 0 0; }

/* Tiles (landing features + portal dashboard) with hover detail */
.tile { position: relative; display: block; text-align: left; width: 100%; cursor: pointer; transition: transform .14s ease, border-color .15s ease; }
.tile:hover, .tile:focus-within { transform: translateY(-3px); border-color: var(--accent); }
.tile .tcount { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .tip {
  display: none; position: absolute; left: 10px; right: 10px; bottom: calc(100% - 6px); z-index: 5;
  background: var(--panel2); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px;
  font-size: .84rem; color: var(--text); box-shadow: var(--shadow);
}
.tile:hover .tip, .tile:focus .tip { display: block; }
.tile .dot { position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 25%, transparent); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 22px; min-width: 0; }
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.plan .pname { font-weight: 700; font-size: 1.02rem; }
.plan .price { display: block; font-size: 2.1rem; font-weight: 800; margin: 4px 0; }
.plan .per { color: var(--muted); font-size: .85rem; }
.plan ul { margin: 8px 0 16px; padding: 0 0 0 18px; color: var(--muted); font-size: .92rem; display: grid; gap: 6px; }
.plan .btn { margin-top: auto; }

.footer { border-top: 1px solid var(--line); padding: 44px 0 60px; color: var(--muted); font-size: .9rem; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 26px; }
.trustline { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ── Portal shell ── */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 64px); }
.sidenav { border-right: 1px solid var(--line); background: var(--bg2); padding: 18px 12px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin: 2px 0;
  color: var(--muted); border-radius: 10px; font-weight: 600; font-size: .93rem; min-height: 44px;
}
.sidenav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.sidenav a.active { color: var(--on-accent); background: linear-gradient(135deg, var(--accent2), var(--accent)); }
.main { padding: 26px 26px 80px; min-width: 0; }
.main h1 { font-size: 1.6rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tiles-grid > * { min-width: 0; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); max-width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel2); }

.progress { height: 8px; border-radius: 6px; background: var(--bg2); overflow: hidden; min-width: 90px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); }

.notice { border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 10px; background: var(--panel); padding: 12px 14px; font-size: .92rem; margin: 6px 0; }
.notice.warn { border-left-color: var(--warn); }
.notice.bad { border-left-color: var(--bad); }
.notice.good { border-left-color: var(--good); }

.modal-back { position: fixed; inset: 0; background: rgba(4, 10, 22, .66); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; max-width: 560px; width: 100%; max-height: 88vh; overflow: auto; padding: 24px; box-shadow: var(--shadow); }

.checkitem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.checkitem select { min-height: 36px; width: auto; }

pre { max-width: 100%; overflow-x: auto; }

/* ── Admin console (visibly different application) ── */
body.admin { --accent: #3fbfb2; --accent2: #6adfd2; --on-accent: #07211e; background: linear-gradient(180deg, var(--bg) 0%, #0d1420 100%); }
body.admin[data-theme="light"] { --accent: #0c7d72; --accent2: #095e56; --on-accent: #fff; background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-rail { background: #0a0f1a; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
body.admin[data-theme="light"] .admin-rail { background: #14202e; }
.admin-rail .brand { padding: 6px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; color: #e8edf5; display: block; }
.admin-rail a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; color: #93a7c1; font-weight: 600; font-size: .92rem; min-height: 44px; }
.admin-rail a:hover { background: #131d2e; color: #e8edf5; text-decoration: none; }
.admin-rail a.active { background: var(--accent); color: var(--on-accent); }
.admin-rail .foot { margin-top: auto; padding: 10px 8px; font-size: .78rem; color: var(--faint); }
.console-badge { display: inline-block; background: var(--accent); color: var(--on-accent); font-size: .68rem; font-weight: 800; letter-spacing: .14em; padding: 3px 8px; border-radius: 6px; }
.admin-main { padding: 24px 28px 80px; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .v { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero .inner { grid-template-columns: 1fr; }
  .grid3, .plans { grid-template-columns: 1fr 1fr; }
  .split2 { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .shell, .admin-shell { grid-template-columns: 1fr; }
  .sidenav, .admin-rail { display: flex; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 8px; gap: 4px; }
  .sidenav a, .admin-rail a { white-space: nowrap; }
  .admin-rail .brand { border-bottom: none; margin: 0; padding: 6px; min-width: 130px; }
  .admin-rail .foot { display: none; }
  .grid3, .plans { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr; }
  .main, .admin-main { padding: 18px 14px 70px; }
  .hero { padding: 54px 0 40px; }
}
