/* Solomon panel. Colors are tokens; an instance overrides them in /admin/brand/theme.css. */
[hidden] { display: none !important; }
:root {
  --bg: #f4f2ee; --panel: #ffffff; --panel-2: #faf9f6; --ink: #1c2124; --muted: #5f686e; --line: #e2ded6; --code: #efece6;
  --accent: #2f6f8f; --accent-ink: #ffffff; --accent-soft: rgba(47,111,143,.12);
  --ok: #2f8a4c; --ok-soft: rgba(47,138,76,.12); --warn: #a8760a; --warn-soft: rgba(168,118,10,.13);
  --off: #b23b3b; --off-soft: rgba(178,59,59,.11);
  --side: #1d2326; --side-ink: #d6dde1; --side-muted: #8b979d; --side-on: rgba(255,255,255,.09);
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111518; --panel: #1a2024; --panel-2: #1e252a; --ink: #e6ebee; --muted: #94a0a7; --line: #2a3338; --code: #232b30;
    --accent: #5aa9cf; --accent-ink: #0b1215; --accent-soft: rgba(90,169,207,.15);
    --ok: #52c47a; --ok-soft: rgba(82,196,122,.14); --warn: #e0b04a; --warn-soft: rgba(224,176,74,.14);
    --off: #ec7272; --off-soft: rgba(236,114,114,.13);
    --side: #0c0f11; --side-ink: #d6dde1; --side-muted: #7f8b91; --side-on: rgba(255,255,255,.07);
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--code); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; } h3 { font-size: .98rem; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.08rem; padding: 4px 8px 18px; }
.brand.big { font-size: 1.4rem; justify-content: center; padding: 0 0 4px; }
.logo { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--side-muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--side-ink); background: var(--side-on); }
.nav a.on { color: #fff; background: var(--side-on); box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot .muted { color: var(--side-muted); }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.top h1 { font-size: 1.45rem; }
.menu-btn { display: none !important; }
#page { padding: 12px 28px 60px; max-width: 1280px; }
.scrim { display: none; }
.loading { color: var(--muted); padding: 30px 0; }

/* cards + grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-actions input[type=search] { min-width: min(320px, 100%); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; }
.grid2 > .card { margin: 0; }
.servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 18px; align-items: start; }
.servers .card { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 8px 0; }
.row.tight { gap: 6px; margin: 4px 0 0; }
.row > input { flex: 1 1 200px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 220px; }
.label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin: 4px 0 6px; }

/* forms */
input, select { font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; color: var(--muted); font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer;
  transition: background .12s, border-color .12s, transform .05s; white-space: nowrap; position: relative; }
.btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--off); border-color: color-mix(in srgb, var(--off) 35%, var(--line)); }
.btn.danger:hover:not(:disabled) { background: var(--off-soft); border-color: var(--off); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: .84rem; } .btn.sm .ic { width: 16px; height: 16px; }
.btn.xs { padding: 2px 7px; font-size: .78rem; gap: 4px; } .btn.xs .ic { width: 14px; height: 14px; }
.btn.lg { padding: 13px 18px; font-size: 1.02rem; width: 100%; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* pills, ticks, chips */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--code); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.on { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.off { background: var(--off-soft); color: var(--off); } .pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.accent::before { display: none; }
.tick { font-weight: 600; } .tick.done { color: var(--ok); } .tick.waiting { color: var(--warn); } .tick.problem { color: var(--off); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--code); border-radius: 99px; padding: 3px 4px 3px 12px; font-weight: 600; font-size: .88rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-weight: 700; flex: none; }
.who-cell { display: flex; align-items: center; gap: 10px; }

/* overview */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.tile-ic { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tile.bad .tile-ic { background: var(--off-soft); color: var(--off); } .tile.good .tile-ic { background: var(--ok-soft); color: var(--ok); }
.tile-v { font-size: 1.6rem; font-weight: 750; line-height: 1.1; } .tile-l { color: var(--muted); font-size: .86rem; } .tile-s { color: var(--muted); font-size: .76rem; }
.srvrow { display: grid; grid-template-columns: minmax(150px, 1.3fr) auto minmax(200px, 2fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.srvrow-main { display: flex; flex-direction: column; }
.srvrow-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.srvrow-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* meters */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 4px 0 14px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); }
.meter-top b { color: var(--ink); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-bar { height: 7px; background: var(--code); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.meter-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.meter.warm .meter-bar i { background: var(--warn); } .meter.hot .meter-bar i { background: var(--off); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -4px 14px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: .88rem; color: var(--muted); background: none; border: 0; padding: 9px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); } .tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab .ic { width: 16px; height: 16px; }
pre.log { background: var(--code); border-radius: 8px; padding: 10px 12px; max-height: 380px; overflow: auto; font: .8rem/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }
.modlist { list-style: none; padding: 0; margin: 0; } .mod { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.dim td { opacity: .55; }
.tbl .empty { text-align: center; padding: 24px; }

/* invites */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 8px; }
.choice { text-align: left; font: inherit; color: var(--ink); background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.choice b { text-transform: capitalize; } .choice:hover { border-color: var(--accent); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.invout { background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; margin-top: 12px; }
.bigcode { font-size: 1.35rem; font-weight: 800; letter-spacing: .04em; background: none; padding: 0; }

/* join card */
.srvjoin { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.steps { padding-left: 1.3em; margin: 8px 0 0; } .steps li { margin: 6px 0; }
.addr { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mods { margin: 4px 0; }

/* auth */
.auth { grid-column: 1 / -1; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card > .muted { text-align: center; margin: 0; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; font-weight: 600; margin: 6px 0 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* toasts + dialog */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 32px); }
.toast { display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2); animation: rise .18s ease-out; transition: opacity .4s; }
.toast.bad { background: var(--off); color: #fff; } .toast.out { opacity: 0; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); padding: 22px; width: min(420px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog p { margin: 8px 0 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* phones + tablets: sidebar becomes a drawer */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }
  .menu-btn { display: inline-flex !important; }
  .top { padding: 12px 16px 4px; position: sticky; top: 0; background: var(--bg); z-index: 10; }
  #page { padding: 8px 16px 60px; }
  .srvrow { grid-template-columns: 1fr auto; }
  .srvrow-meters, .srvrow-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
