/* HQ — internal operations dashboard.
   Dark, high contrast, built to be stared at for hours. */

:root {
  --bg:        #0a0d14;
  --surface:   #11151f;
  --surface-2: #171c28;
  --surface-3: #1e2534;
  --line:      #232b3b;
  --line-2:    #2f3a4d;

  --text:      #e6ebf4;
  --text-2:    #9aa8bf;
  --text-3:    #64748b;

  --mint:      #34d399;
  --mint-dim:  rgba(52, 211, 153, .13);
  --sky:       #56a8ff;
  --sky-dim:   rgba(86, 168, 255, .13);
  --amber:     #fbbf24;
  --amber-dim: rgba(251, 191, 36, .13);
  --rose:      #fb7185;
  --rose-dim:  rgba(251, 113, 133, .13);
  --violet:    #a78bfa;
  --violet-dim: rgba(167, 139, 250, .13);

  --r:   10px;
  --r-s: 7px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky); text-decoration: none; }
a:hover { color: #8ec4ff; }

::selection { background: rgba(86, 168, 255, .3); }

/* ------------------------------------------------------------- structure -- */

.shell { display: flex; min-height: 100vh; }

.rail {
  width: 224px;
  flex: 0 0 224px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .glyph {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--mint), #0d9488);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #04120c;
  flex: none;
}
.brand .txt .n { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.brand .txt .s { font-size: 11px; color: var(--text-3); margin-top: -2px; }

.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; margin-bottom: 1px;
  border-radius: var(--r-s);
  color: var(--text-2);
  font-size: 13.5px; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--surface-3); color: var(--text); font-weight: 560; }
.nav a.on .ico { color: var(--mint); }
.nav .ico { width: 15px; display: inline-flex; align-items: center; justify-content: center;
            font-size: 13px; color: var(--text-3); flex: none; }
.nav .tag {
  margin-left: auto;
  font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-2);
}
.nav a.on .tag { background: rgba(0,0,0,.3); }
.nav .tag.hot { background: var(--mint-dim); color: var(--mint); }
.nav-group {
  font-size: 10px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--text-3); padding: 14px 11px 5px; font-weight: 650;
}

.rail-foot { padding: 12px; border-top: 1px solid var(--line); }
.rail-foot .who { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.rail-foot .av {
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
  flex: none;
}
.rail-foot .nm { font-size: 12.5px; font-weight: 550; }
.rail-foot .st { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; }

.topbar {
  padding: 20px 26px 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.topbar .lede { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { padding: 22px 26px 60px; max-width: 1440px; }

/* ---------------------------------------------------------------- cards --- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 18px;
  overflow: hidden;
}
.card > h2 {
  margin: 0; padding: 13px 17px;
  font-size: 12.5px; font-weight: 620; letter-spacing: .02em;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2);
}
.card > h2 .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.card-body { padding: 17px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 26px 0 12px;
}
.section-head h3 {
  margin: 0; font-size: 12px; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
}

/* ------------------------------------------------------------- kpi tiles -- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 17px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--line-2);
}
.kpi.mint::before   { background: var(--mint); }
.kpi.sky::before    { background: var(--sky); }
.kpi.amber::before  { background: var(--amber); }
.kpi.violet::before { background: var(--violet); }

.kpi .label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); font-weight: 620;
}
.kpi .value {
  font-size: 27px; font-weight: 640; letter-spacing: -.025em;
  margin-top: 5px; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.kpi .value.sm { font-size: 19px; }
.kpi .foot { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* -------------------------------------------------------- project cards --- */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  align-items: start;
}
.proj {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .13s, transform .13s;
}
.proj:hover { border-color: var(--line-2); transform: translateY(-1px); }
.proj.go { border-color: rgba(52, 211, 153, .4); }

.proj-top { display: flex; gap: 13px; padding: 15px 15px 12px; }
.proj-art {
  width: 52px; height: 52px; border-radius: 9px; flex: none;
  background: var(--surface-3);
  display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--line);
}
.proj-art img { width: 100%; height: 100%; object-fit: cover; }
.proj-art .ph { font-size: 17px; font-weight: 700; color: var(--text-3); }

.proj-id { min-width: 0; flex: 1; }
.proj-id .nm {
  font-size: 15px; font-weight: 620; letter-spacing: -.01em;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-id a.nm:hover { color: var(--mint); }
.proj-id .tk {
  font-family: var(--mono); font-size: 12px; color: var(--text-3);
  margin-top: 1px;
}
.proj-id .desc {
  font-size: 12.5px; color: var(--text-2); margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.proj-meter { padding: 0 15px 12px; }
.meter-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; margin-bottom: 5px;
}
.meter-top .pc { font-weight: 650; font-variant-numeric: tabular-nums; }
.meter-top .lb { color: var(--text-3); }

.track { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: 3px; background: var(--sky); }
.track > i.full { background: var(--mint); }
.track > i.low  { background: var(--amber); }

.proj-todo {
  border-top: 1px solid var(--line);
  padding: 11px 15px;
  background: var(--surface-2);
}
.proj-todo .hd {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 620; margin-bottom: 6px;
}
.todo-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.todo-chip {
  font-size: 11.5px; padding: 2px 8px; border-radius: 5px;
  background: var(--amber-dim); color: var(--amber);
  border: 1px solid rgba(251, 191, 36, .22);
}
.proj-todo.done { background: var(--mint-dim); }
.proj-todo.done .hd { color: var(--mint); }

/* ------------------------------------------------------------ checklist --- */

.checklist { display: grid; gap: 2px; }
.check {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-s);
  font-size: 13px;
}
.check:hover { background: var(--surface-2); }
.check .box {
  width: 17px; height: 17px; border-radius: 5px; flex: none;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  font-size: 10px; color: transparent;
}
.check.yes .box { background: var(--mint); border-color: var(--mint); color: #04120c; }
.check.yes .lb { color: var(--text-2); }
.check.no .lb { color: var(--text); font-weight: 550; }
.check .todo { margin-left: auto; font-size: 11.5px; color: var(--amber); }

/* --------------------------------------------------------------- tables --- */

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 620;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
tbody td { padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }
.table-wrap { overflow-x: auto; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty .big { font-size: 26px; margin-bottom: 9px; opacity: .5;
              display: flex; justify-content: center; }

/* ---------------------------------------------------------------- pills --- */

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 620; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.pill.idea     { background: var(--surface-3); color: var(--text-2); border-color: var(--line-2); }
.pill.building { background: var(--amber-dim);  color: var(--amber);  border-color: rgba(251,191,36,.25); }
.pill.ready    { background: var(--mint-dim);   color: var(--mint);   border-color: rgba(52,211,153,.3); }
.pill.launched { background: var(--sky-dim);    color: var(--sky);    border-color: rgba(86,168,255,.3); }
.pill.archived { background: transparent;       color: var(--text-3); border-color: var(--line); }
.pill.solana   { background: var(--violet-dim); color: var(--violet); border-color: rgba(167,139,250,.28); }
.pill.evm      { background: var(--sky-dim);    color: var(--sky);    border-color: rgba(86,168,255,.28); }
.pill.generated{ background: var(--mint-dim);   color: var(--mint);   border-color: rgba(52,211,153,.3); }
.pill.imported { background: var(--amber-dim);  color: var(--amber);  border-color: rgba(251,191,36,.25); }
.pill.watch    { background: transparent;       color: var(--text-3); border-color: var(--line-2); }

/* ---------------------------------------------------------------- forms --- */

label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--text-3); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  font-size: 13.5px; font-family: inherit;
  color: var(--text); background: var(--bg);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-dim);
}
input[type=file] {
  width: 100%; padding: 9px 11px; font-size: 13px;
  border: 1px dashed var(--line-2); border-radius: var(--r-s);
  background: var(--bg); color: var(--text-2);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 8l3-3.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.field { margin-bottom: 14px; }
.grid { display: grid; gap: 13px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-s);
  border: 1px solid var(--line-2); background: var(--surface-3);
  color: var(--text); font-size: 13px; font-weight: 550;
  font-family: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #262f42; border-color: #3a465c; color: var(--text); }
.btn.primary { background: var(--mint); border-color: var(--mint); color: #04120c; font-weight: 620; }
.btn.primary:hover { background: #4ade9f; border-color: #4ade9f; color: #04120c; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--rose); border-color: rgba(251,113,133,.3); background: var(--rose-dim); }
.btn.danger:hover { background: rgba(251,113,133,.2); color: var(--rose); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.link { border: 0; background: none; color: var(--text-3); padding: 4px 7px; }
.btn.link:hover { background: var(--surface-3); color: var(--text); }
.btn.wide { width: 100%; justify-content: center; }

.inline-form { display: inline; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* --------------------------------------------------------------- alerts --- */

.flashes { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 11px 15px; border-radius: var(--r-s);
  font-size: 13px; border: 1px solid;
  display: flex; align-items: flex-start; gap: 9px;
}
.flash.ok    { background: var(--mint-dim); border-color: rgba(52,211,153,.3); color: var(--mint); }
.flash.error { background: var(--rose-dim); border-color: rgba(251,113,133,.3); color: var(--rose); }

.notice {
  background: var(--amber-dim); border: 1px solid rgba(251,191,36,.25);
  color: #f5d68a; padding: 12px 15px; border-radius: var(--r-s);
  font-size: 12.5px; line-height: 1.6;
}
.notice strong { color: var(--amber); }
.notice.crit { background: var(--rose-dim); border-color: rgba(251,113,133,.3); color: #f7b3bd; }
.notice.crit strong { color: var(--rose); }

/* ---------------------------------------------------------------- vault --- */

.vault-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 17px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface);
  margin-bottom: 18px;
}
.vault-bar.open { border-color: rgba(52,211,153,.35); background: linear-gradient(180deg, var(--mint-dim), transparent); }
.vault-bar .ic { display: inline-flex; align-items: center; color: var(--text-2); }
.vault-bar.open .ic { color: var(--mint); }
.vault-bar .msg { flex: 1; min-width: 200px; }
.vault-bar .msg .t { font-weight: 620; font-size: 14px; }
.vault-bar .msg .d { color: var(--text-2); font-size: 12.5px; margin-top: 1px; }
.vault-bar.open .msg .t { color: var(--mint); }
#vaultClock { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.secret {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-3);
}
.secret .dots { letter-spacing: .16em; user-select: none; }
.secret .shown {
  color: var(--text); word-break: break-all;
  background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 4px 8px; max-width: 100%;
}

/* --------------------------------------------------------------- assets --- */

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 11px; }
.asset {
  border: 1px solid var(--line); border-radius: var(--r-s);
  overflow: hidden; background: var(--surface-2);
}
.asset:hover { border-color: var(--line-2); }
.asset .thumb {
  height: 112px; display: grid; place-items: center;
  background: var(--bg); overflow: hidden;
}
.asset .thumb img, .asset .thumb video { max-width: 100%; max-height: 112px; object-fit: contain; }
.asset .meta { padding: 8px 10px; font-size: 11.5px; border-top: 1px solid var(--line); }
.asset .meta .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.filetype { font-family: var(--mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; }

.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--r);
  padding: 22px; text-align: center; color: var(--text-3);
  background: var(--surface-2); cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--mint); color: var(--mint); background: var(--mint-dim); }
.drop .big { font-size: 21px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- misc ---- */

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12px; }
.split { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.split > * { flex: 1 1 340px; min-width: 0; }
.split.wide-left > :first-child { flex: 2 1 480px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.copyline {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--r-s);
  background: var(--bg); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px;
  margin-bottom: 7px;
}
.copyline .k { color: var(--text-3); min-width: 74px; font-family: var(--sans); font-size: 11.5px; }
.copyline .v { flex: 1; word-break: break-all; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-3); padding: 9px 14px; font-size: 13.5px;
  font-weight: 550; font-family: inherit; cursor: pointer;
}
.tabs button:hover { color: var(--text-2); }
.tabs button.on { color: var(--text); border-bottom-color: var(--mint); }

.allocbar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.allocbar > i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 11px; font-size: 12.5px; }
.legend .it { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 9px; height: 9px; border-radius: 2px; }

/* ---------------------------------------------------------------- login --- */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(52,211,153,.09), transparent),
    var(--bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; width: min(384px, 100%); padding: 32px;
}
.login-card .glyph {
  width: 42px; height: 42px; border-radius: 11px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--mint), #0d9488);
  display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #04120c;
}
.login-card .ttl { text-align: center; font-size: 17px; font-weight: 650; }
.login-card .sub { text-align: center; color: var(--text-3); font-size: 12.5px; margin: 4px 0 24px; }

@media (max-width: 880px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: 3px; }
  .nav-group { display: none; }
  .nav a { flex: 0 0 auto; }
  .content, .topbar { padding-left: 15px; padding-right: 15px; }
}

/* Keep identifier columns on one line — wrapped names read as broken layout. */
td .nowrap, td.nowrap { white-space: nowrap; }
.vault-name { min-width: 150px; }
.vault-addr { white-space: nowrap; }

/* Collapsed editors: keep the heavy forms out of the way until wanted. */
details.tuck { border-top: 1px solid var(--line); background: var(--surface-2); }
details.tuck > summary {
  list-style: none; cursor: pointer; padding: 11px 17px;
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
  display: flex; align-items: center; gap: 7px;
}
details.tuck > summary::-webkit-details-marker { display: none; }
details.tuck > summary:hover { color: var(--text); }
details.tuck > summary::before { content: '+'; font-size: 14px; color: var(--text-3); }
details.tuck[open] > summary::before { content: '\2212'; }
details.tuck[open] > summary { border-bottom: 1px solid var(--line); }
