/* =====================================================================================
   Ionity Channel Vault - console styles
   Brand tokens per ASSETS-IONITY-2026 wiki/Brand-and-Licensing (Policy 986 AED)
   (c) 2018-2026 Antwerp Designs | Ionity (Pty) Ltd - All Rights Reserved - TM2
   ===================================================================================== */
:root {
  --ionity-primary: #00BFFF;
  --ionity-accent: #00c6ff;
  --ionity-dark: #0d1b2a;
  --ionity-ink: #101820;
  --ionity-mark: #1657A2; /* logo blue */

  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dde4ee;
  --text: #101820;
  --muted: #5b6b7f;
  --ok: #0f9d58;
  --warn: #c77700;
  --err: #d93025;
  --focus: 0 0 0 3px rgba(0, 191, 255, .35);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 4px 16px rgba(16, 24, 32, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--ionity-mark); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.fineprint { font-size: 11px; color: var(--muted); margin: 12px 0 0; }

/* ---------- Gate (TaxPilot visual language) ---------- */
.gate {
  --g-purple: #5746e3; --g-teal: #00b39c; --g-text: #141824; --g-muted: #596175; --g-border: #e4e7ee;
  position: relative; min-height: 100vh; overflow: hidden; background: #fff; color: var(--g-text);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px;
}
.gate-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gate-brand { position: absolute; top: 18px; left: 22px; display: flex; flex-direction: column; gap: 2px; z-index: 1; }
.gate-brand img { display: block; height: 30px; width: auto; }
.gate-brand span { font-size: 9.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--g-muted); font-weight: 500; }
.gate-brand b { color: var(--ionity-primary); font-weight: 700; }
.gate-center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 720px; }
.gate-glow {
  position: absolute; width: 520px; height: 200px; left: 50%; top: -150px; transform: translateX(-50%);
  border-radius: 50%; filter: blur(28px); pointer-events: none;
  background: radial-gradient(closest-side, rgba(87, 70, 227, .2), rgba(0, 179, 156, .12) 55%, rgba(0, 179, 156, 0));
  animation: glow 6s ease-in-out infinite alternate;
}
@keyframes glow { from { opacity: .7; transform: translateX(-50%) scale(.96); } to { opacity: 1; transform: translateX(-50%) scale(1.04); } }
.gate-title { font-size: clamp(38px, 7vw, 56px); font-weight: 300; letter-spacing: -.5px; margin: 0; }
.dots i { font-style: normal; color: #a8b0c4; animation: dot 1.4s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.gate-tag { font-size: 17px; letter-spacing: .2px; color: var(--g-muted); margin: 12px 0 14px; }
.gate-pills { list-style: none; padding: 0; margin: 0 0 56px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gate-pills li { font-size: 11.5px; color: var(--g-muted); border: 1px solid var(--g-border); background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 4px; }
.pill-ic { fill: none; stroke: var(--g-teal); stroke-width: 2; }
.btn-google {
  font: 500 15px "Roboto", system-ui, sans-serif; color: var(--g-text); background: #fff; border: 1px solid var(--g-border);
  border-radius: 999px; padding: 11px 22px; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(20, 24, 36, .10); transition: transform .15s, box-shadow .15s;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(87, 70, 227, .18); }
.btn-google:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(87, 70, 227, .3); }
.gate-msg { min-height: 20px; color: #b3261e; font-size: 13px; margin: 14px 0 0; max-width: 460px; }
.gate-link { background: none; border: 0; color: var(--g-purple); font: 500 13px "Roboto", sans-serif; cursor: pointer; padding: 4px; }
.gate-foot { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 11px; color: #8b93a4; z-index: 1; }
.gate-foot a { color: #8b93a4; }
@media (prefers-reduced-motion: reduce) { .gate-glow, .dots i { animation: none; } }
.logo-tile { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 10px 14px; }
.logo-tile img { display: block; height: auto; max-width: 100%; }
.logo-tile.small { padding: 6px 10px; border-radius: 8px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.sidebar { background: var(--ionity-dark); color: #cfe3f5; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; gap: 10px; padding: 4px 6px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-name { font-weight: 600; color: #fff; letter-spacing: .2px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.nav a { color: #cfe3f5; text-decoration: none; padding: 9px 12px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; }
.nav a:hover { background: rgba(255, 255, 255, .06); }
.nav a.active { background: rgba(0, 191, 255, .14); color: #fff; box-shadow: inset 3px 0 0 var(--ionity-primary); }
.badge { background: var(--err); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; min-width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.sidebar-foot .fineprint, .sidebar-foot a { color: #8fa9c2; }
.who { font-size: 12px; word-break: break-all; margin-bottom: 8px; color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 18px; }
.env { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.menu-btn { display: none; }
.view { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }

/* ---------- Components ---------- */
.btn { font: inherit; font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 14px; cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
a.btn { text-decoration: none; display: inline-block; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary { background: var(--ionity-mark); border-color: var(--ionity-mark); color: #fff; }
.btn.primary:hover { background: #124a8a; }
.btn.ghost { background: transparent; border-color: rgba(127, 140, 160, .35); color: inherit; }
.btn.danger { color: var(--err); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .card .num { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.kpi .card .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.section { margin-top: 20px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 220px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface); color: var(--text); width: 100%;
}
textarea { min-height: 88px; font-family: var(--mono); font-size: 12.5px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 5px; }
label.field small { display: block; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.check input { width: 16px; height: 16px; accent-color: var(--ionity-mark); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.name { max-width: 340px; word-break: break-word; }
td .sub { color: var(--muted); font-size: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 500; background: #eef3f9; color: var(--muted); }
.pill.done, .pill.live, .pill.on { background: #e6f4ea; color: var(--ok); }
.pill.error, .pill.off { background: #fce8e6; color: var(--err); }
.pill.skipped, .pill.planned { background: #fef7e0; color: var(--warn); }
.pill.queued, .pill.processing { background: #e8f4fd; color: #0b6fb3; }

.copy { display: flex; gap: 8px; align-items: center; }
.copy code { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; overflow-x: auto; white-space: nowrap; }
.preview { background: var(--ionity-ink); color: #bfe9ff; border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.note { background: #e8f4fd; border: 1px solid #b9dcf5; color: #0b4f80; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.note.warn { background: #fef7e0; border-color: #f3d98b; color: #6b4a00; }
.note.err { background: #fce8e6; border-color: #f4b8b2; color: #8a1c13; }
.bar { height: 8px; background: #eef3f9; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ionity-mark), var(--ionity-primary)); }
.cat-row { display: grid; grid-template-columns: 130px 1fr 48px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
ol.steps { padding-left: 18px; margin: 0; }
ol.steps li { margin-bottom: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ionity-ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); z-index: 50; max-width: min(560px, 92vw); }
.toast.err { background: var(--err); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-block; }
  .topbar, .view { padding-left: 16px; padding-right: 16px; }
  .env { display: none; }
}

/* ---------- pick-list (searchable multi-select) ---------- */
.pick { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 6px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 6px; min-height: 26px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #e8f4fd; color: #0b4f80; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12.5px; max-width: 100%; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.chip button:hover { background: rgba(11, 79, 128, .12); }
.pick .pick-q { border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; width: 100%; font: inherit; }
.pick-list { max-height: 220px; overflow-y: auto; margin-top: 6px; border-top: 1px solid var(--border); }
.pick-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; cursor: pointer; border-bottom: 1px solid #f0f3f8; font-size: 13px; }
.pick-row:hover { background: var(--surface-2); }
.pick-row input { width: 16px; height: 16px; accent-color: var(--ionity-mark); margin: 0; }
.pick-row small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.pick-add { display: block; width: 100%; text-align: left; border: 0; background: #e6f4ea; color: var(--ok); font: 500 13px var(--font); padding: 7px 8px; border-radius: 6px; cursor: pointer; margin: 6px 0; }

/* ---------- v1.4: gradient Ionity logo (transparent), save-location ---------- */
.logo-grad { display: inline-block; flex: none;
  background: linear-gradient(100deg, #00E5FF 0%, #00BFFF 30%, #2F7FE0 60%, #7B6EF0 100%);
  -webkit-mask: url(/assets/ionity-logo.png) left center / contain no-repeat; mask: url(/assets/ionity-logo.png) left center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(0, 191, 255, .25)); }
.loc { padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); }
