/* Snizware App Manager — dark gray theme, Snizware blue accent */
:root {
  --bg: #1b1d22;
  --bg-2: #22252b;
  --card: #262a31;
  --card-2: #2d323a;
  --line: #363b45;
  --text: #e8eaef;
  --muted: #9aa1ad;
  --accent: #3b74ff;
  --accent-2: #7aa4ff;
  --accent-glow: rgba(59,116,255,.35);
  --ok: #3ddc84;
  --warn: #ffb547;
  --bad: #ff5c6c;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Outfit", var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  display: flex; flex-direction: column; min-height: 100vh; position: relative;
  -webkit-font-smoothing: antialiased;
}
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(59,116,255,.18), transparent 60%),
    radial-gradient(700px 400px at 95% 110%, rgba(122,164,255,.10), transparent 60%);
}
.topbar, main, footer, .flash { position: relative; z-index: 1; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em;
       background: var(--bg-2); padding: .1em .4em; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0 0 .6rem; }
h1 { font-size: 1.7rem; margin-top: .5rem; }
h2 { font-size: 1.12rem; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.5rem; border-bottom: 1px solid var(--line);
  background: rgba(27,29,34,.85); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line), 0 0 18px var(--accent-glow); }
.brand-sub { color: var(--muted); font-weight: 400; }
.nav { display: flex; align-items: center; gap: 1.1rem; }
.nav a { color: var(--muted); font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: .35rem 0; white-space: nowrap; }
button.link:hover { color: var(--text); }

/* layout */
.container { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
body.centered .container { display: flex; align-items: center; justify-content: center; }
.footer { display: flex; justify-content: space-between; padding: 1rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.card.slim { padding: 1rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; padding: 2rem 2rem 1.5rem; }
.auth-logo { display: block; width: 240px; margin: 0 auto 1.4rem; filter: drop-shadow(0 0 18px var(--accent-glow)); }

/* hero + tiles */
.hero { text-align: center; padding: 1rem 0 1.5rem; }
.hero-logo { width: 300px; max-width: 70vw; filter: drop-shadow(0 0 22px var(--accent-glow)); }
.hero-tag { color: var(--muted); margin: .25rem 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.1rem; margin: 0 0 1.5rem; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  padding: 1.3rem 1rem 1rem; color: var(--text); text-align: center;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: 18px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover { text-decoration: none; transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(0,0,0,.4), 0 0 0 1px var(--accent-glow); }
.tile-icon { width: 84px; height: 84px; border-radius: 22px; overflow: hidden; display: grid; place-items: center;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line), 0 6px 18px rgba(0,0,0,.35); }
.tile-icon img { width: 100%; height: 100%; object-fit: cover; }
.tile-icon.mini { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; vertical-align: middle; margin-right: .4rem; }
.tile-letter { font-family: var(--display); font-size: 2rem; color: var(--accent-2); }
.tile-icon.mini .tile-letter { font-size: 1rem; }
.tile-name { font-family: var(--display); font-weight: 600; font-size: 1.02rem; }
.tile-status { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.tile-none, .tile-expired { opacity: .78; }
.tile-none .tile-icon, .tile-expired .tile-icon { filter: grayscale(.6); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot.bad { background: var(--bad); }

.banner { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: rgba(255,181,71,.12); border: 1px solid rgba(255,181,71,.4); border-radius: 12px;
  padding: .75rem 1rem; margin-bottom: 1.25rem; }
.flash { max-width: 1100px; margin: 1rem auto 0; padding: .7rem 1.1rem; border-radius: 10px; width: calc(100% - 2.5rem); }
.flash-ok { background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.45); }
.flash-error { background: rgba(255,92,108,.12); border: 1px solid rgba(255,92,108,.45); }
.flash-info { background: rgba(59,116,255,.12); border: 1px solid rgba(59,116,255,.45); }
.error { color: var(--bad); }
.notice { background: rgba(59,116,255,.1); border-left: 3px solid var(--accent); padding: .6rem .9rem; border-radius: 6px; font-size: .92rem; }
.error-code { font-family: var(--display); font-size: 3rem; color: var(--accent-2); margin: 0; }

/* forms */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form.row, .row { flex-direction: row; display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 140px; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: .55rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: .4rem; }
.btn {
  display: inline-block; font: inherit; font-weight: 500; cursor: pointer;
  color: var(--text); background: var(--card-2); border: 1px solid var(--line);
  border-radius: 10px; padding: .55rem 1rem; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--line); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px var(--accent-glow); }
.btn.primary:hover { background: #2f66f0; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.btn.wide { width: 100%; }

/* data */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.list { list-style: none; padding: 0; margin: .5rem 0 0; }
.list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.pill { display: inline-block; font-size: .74rem; padding: .15rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); text-transform: capitalize; }
.pill-ok, .pill-resolved { border-color: var(--ok); color: var(--ok); }
.pill-in_progress { border-color: var(--warn); color: var(--warn); }
.pill-unaddressed { border-color: var(--bad); color: var(--bad); }
.secret { font-size: 1.1rem; background: var(--bg); border: 1px dashed var(--accent); padding: 1rem; border-radius: 10px; user-select: all; word-break: break-all; }

pre.log { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .8rem; font-size: .8rem; max-height: 260px; overflow: auto; white-space: pre-wrap; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--muted); }

/* admin */
.subnav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: .25rem 0 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.subnav a { color: var(--muted); font-weight: 500; }
.subnav a.active { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; }
.stat-n { font-family: var(--display); font-size: 1.9rem; font-weight: 600; color: var(--accent-2); }
.stat-l { color: var(--muted); font-size: .85rem; }
.row-card { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin-bottom: .6rem; background: var(--bg-2); }
.row-card summary { cursor: pointer; display: flex; align-items: center; gap: .5rem; }
.row-card[open] summary { margin-bottom: .8rem; }

@media (max-width: 600px) {
  .topbar { padding: .6rem 1rem; }
  .brand-text { font-size: .95rem; }
  .brand-sub { display: none; }
  .nav { gap: .7rem; font-size: .92rem; }
  .container { padding: 1rem .9rem 2.5rem; }
  .hero-logo { width: 220px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tile-icon { width: 68px; height: 68px; }
}
