/* Coastal PC — platform UI. Harbor navy + tide teal, fog surfaces.
   Signature: the "tide bar" speed gauge on plan cards. */
:root {
  --ink: #12303f;          /* deep harbor */
  --ink-2: #33535f;
  --fog: #f2f5f6;          /* sea fog surface */
  --panel: #ffffff;
  --line: #d8e0e3;
  --tide: #0d7a6a;         /* primary action */
  --tide-deep: #0a5f53;
  --amber: #a16207;
  --coral: #c2410c;
  --muted: #6b7f88;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 48, 63, .08), 0 4px 14px rgba(18, 48, 63, .06);
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--fog); line-height: 1.55; }
a { color: var(--tide-deep); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* Shells */
.topbar { background: var(--ink); color: #e8eef0; display: flex; align-items: center; gap: 1.25rem; padding: .8rem 1.25rem; }
.topbar .brand { font-weight: 700; color: #fff; text-decoration: none; font-size: 1.05rem; }
.topbar .brand span { color: #7fd1c3; }
.topbar nav { margin-left: auto; display: flex; gap: 1rem; }
.topbar nav a { color: #cfe0e4; text-decoration: none; font-size: .92rem; }
.topbar nav a:hover { color: #fff; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.wrap--narrow { max-width: 640px; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; background: var(--ink); color: #cfe0e4; padding: 1.1rem .9rem; }
.sidebar .brand { display: block; color: #fff; font-weight: 700; text-decoration: none; margin-bottom: 1.4rem; padding: 0 .5rem; }
.sidebar .brand span { color: #7fd1c3; }
.sidebar .group { margin: 1.1rem 0 .3rem; padding: 0 .5rem; }
.sidebar a.nav { display: block; color: #cfe0e4; text-decoration: none; padding: .42rem .55rem; border-radius: 7px; font-size: .93rem; }
.sidebar a.nav:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar a.nav.active { background: var(--tide); color: #fff; }
.main { flex: 1; min-width: 0; padding: 1.6rem 2rem 4rem; }

/* Panels, tables, forms */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data th { text-align: left; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .6rem .8rem; background: #fafcfc; border-bottom: 1px solid var(--line); }
table.data td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-size: .93rem; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f7fafa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 2px solid var(--tide); outline-offset: 1px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.field-row { display: flex; gap: 1rem; } .field-row > div { flex: 1; }

.btn { display: inline-block; background: var(--tide); color: #fff; border: 0; border-radius: 8px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--tide-deep); }
.btn--ghost { background: transparent; color: var(--tide-deep); border: 1px solid var(--line); }
.btn--ghost:hover { background: #eef4f3; }
.btn--danger { background: var(--coral); }
.btn--sm { padding: .32rem .7rem; font-size: .85rem; }
.actions { margin-top: 1.25rem; display: flex; gap: .75rem; align-items: center; }

.badge { display: inline-block; padding: .13rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 600; text-transform: capitalize; }
.badge--ok { background: #d9efe9; color: #0a5f53; }
.badge--warn { background: #fdf0d7; color: #92580a; }
.badge--bad { background: #fbe2d6; color: #a3350b; }
.badge--muted { background: #e6ecee; color: #55707b; }

.flash { border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; font-size: .93rem; border: 1px solid; }
.flash--success { background: #e5f4ef; border-color: #b6dfd3; color: #0a5f53; }
.flash--error { background: #fdeee6; border-color: #f3cdb8; color: #a3350b; }
.flash--info { background: #e9f1f4; border-color: #c9dde4; color: #2a5666; }

/* Checkout */
.steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; flex: 1; text-align: center; font-size: .8rem; color: var(--muted); padding-top: 2rem; position: relative; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1.6rem; height: 1.6rem; line-height: 1.6rem; border-radius: 50%; background: #dfe7ea; color: var(--ink-2); font-weight: 700; }
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active::before { background: var(--tide); color: #fff; }
.steps li.done::before { background: var(--ink); color: #7fd1c3; content: "✓"; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.plan-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.plan-card h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.plan-card .price { font-size: 1.5rem; font-weight: 700; margin: .4rem 0 .1rem; }
.plan-card .price small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.tide-bar { height: 8px; background: #e3ebee; border-radius: 99px; margin: .6rem 0 .2rem; overflow: hidden; }
.tide-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--tide), #58b7a8); border-radius: 99px; }
.speed-note { font-size: .82rem; color: var(--muted); }

.kv { display: grid; grid-template-columns: 180px 1fr; gap: .3rem .9rem; font-size: .93rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .85rem; text-decoration: none; color: var(--ink-2); border-radius: 8px 8px 0 0; font-size: .92rem; }
.tabs a.active { background: var(--panel); border: 1px solid var(--line); border-bottom-color: var(--panel); font-weight: 600; color: var(--ink); margin-bottom: -1px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.stat .eyebrow { display: block; margin-bottom: .15rem; }
.stat .value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.slot { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: .55rem .7rem; text-align: center; cursor: pointer; font: inherit; }
.slot:hover { border-color: var(--tide); }
.slot input { position: absolute; opacity: 0; }
.slot.selected { border-color: var(--tide); background: #e5f4ef; font-weight: 600; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; }
  .sidebar .group { display: none; }
  .main { padding: 1.1rem 1rem 3rem; }
  .kv { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
