/* Shared Anubis admin look — used by the hub and every panel that loads it.
 * Tokens, base, buttons, cards, fields, toast, login. Layout lives in kit.css. */
:root {
  /* calm night palette: low contrast surfaces, one muted gold for what matters */
  --bg: #0d1016; --bg-rgb: 13,16,22; --bg-2: #10141b; --surface: #141922; --surface-2: #191f2a; --raise: #1e2531;
  --line: rgba(255,255,255,.06); --line-2: rgba(255,255,255,.10); --line-3: rgba(255,255,255,.18);
  --hover: rgba(255,255,255,.045); --tint: rgba(255,255,255,.07);
  --text: #e4e7ec; --muted: #9aa2b0; --faint: #687080;
  --gold: #c8a56a; --gold-rgb: 200,165,106; --gold-2: #dcc393; --gold-soft: rgba(200,165,106,.10); --on-gold: #1b1305;
  --ok: #6cbf9b; --ok-rgb: 108,191,155; --bad: #e08a8a; --bad-rgb: 224,138,138; --warn: #d9b067; --warn-rgb: 217,176,103; --radius: 12px;
  --shadow: rgba(0,0,0,.4); --scrim: rgba(3,6,12,.6);
  /* the same colours as r g b, for Tailwind panels (rgb(var(--x) / alpha)) */
  --bg2-rgb: 16,20,27; --surface-rgb: 20,25,34; --surface2-rgb: 25,31,42; --raise-rgb: 30,37,49; --gold2-rgb: 220,195,147; --text-rgb: 228,231,236; --muted-rgb: 154,162,176;
  --display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
/* light: warm paper, ink text, a deeper gold that stays readable on white */
:root[data-theme="light"] {
  --bg: #f5f4f0; --bg-rgb: 245,244,240; --bg-2: #fbfaf7; --surface: #ffffff; --surface-2: #f3f1ec; --raise: #ebe8e1;
  --line: rgba(30,28,24,.08); --line-2: rgba(30,28,24,.14); --line-3: rgba(30,28,24,.24);
  --hover: rgba(30,28,24,.045); --tint: rgba(30,28,24,.06);
  --text: #1f2329; --muted: #5b626d; --faint: #8a909a;
  --gold: #a37f42; --gold-rgb: 163,127,66; --gold-2: #7d5f2c; --gold-soft: rgba(163,127,66,.12); --on-gold: #ffffff;
  --ok: #2e8b63; --ok-rgb: 46,139,99; --bad: #c24b48; --bad-rgb: 194,75,72; --warn: #a8761c; --warn-rgb: 168,118,28;
  --shadow: rgba(40,35,25,.14); --scrim: rgba(40,35,25,.35);
  --bg2-rgb: 251,250,247; --surface-rgb: 255,255,255; --surface2-rgb: 243,241,236; --raise-rgb: 235,232,225; --gold2-rgb: 125,95,44; --text-rgb: 31,35,41; --muted-rgb: 91,98,109;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; }
body { font-family: var(--body); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: rgba(var(--gold-rgb),.35); }
.ltr { direction: ltr; unicode-bidi: isolate; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* old top bar (a few pages still use it) */
.a-top { position: sticky; top: 0; z-index: 20; background: rgba(var(--bg-rgb),.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.a-top .in { width: min(1200px, 100% - 32px); margin-inline: auto; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; }
.a-brand img { width: 28px; height: 28px; border-radius: 8px; }
.a-brand small { color: var(--faint); font-weight: 500; font-family: var(--body); }
.a-wrap { width: min(1200px, 100% - 32px); margin: 20px auto 48px; }

/* buttons */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line-2); font-size: .88rem; background: var(--surface-2); color: var(--text); font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.a-btn:hover { background: var(--raise); border-color: var(--line-3); }
.a-btn.gold { background: var(--gold); color: var(--on-gold); border-color: transparent; }
.a-btn.gold:hover { background: var(--gold-2); }
.a-btn.danger { color: var(--bad); border-color: rgba(var(--bad-rgb),.3); background: transparent; }
.a-btn.danger:hover { background: rgba(var(--bad-rgb),.08); }
.a-btn:disabled { opacity: .5; cursor: wait; }
.a-btn.sm { padding: 4px 10px; font-size: .8rem; border-radius: 8px; }
.a-btn .k-ic { width: 15px; height: 15px; }

/* cards and text */
.a-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.a-h1 { font-family: var(--display); font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.a-h2 { font-family: var(--display); font-size: .98rem; font-weight: 600; margin-bottom: 10px; }
.a-muted { color: var(--muted); }

/* fields */
.a-field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 500; }
.a-field input, .a-field select, .a-field textarea { font: inherit; font-size: .92rem; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 12px; transition: border-color .15s, box-shadow .15s; }
.a-field input:hover, .a-field select:hover, .a-field textarea:hover { border-color: var(--line-3); }
.a-field input:focus, .a-field select:focus, .a-field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); }

/* toast */
.a-toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 90px); background: var(--raise); color: var(--text); border: 1px solid var(--line-2); border-inline-start: 3px solid var(--ok); font-weight: 600; font-size: .9rem; padding: 10px 18px; border-radius: 10px; box-shadow: 0 12px 32px var(--shadow); transition: transform .3s; z-index: 99; }
.a-toast.bad { border-inline-start-color: var(--bad); }
.a-toast.show { transform: translate(-50%, 0); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(700px 420px at 50% 0%, rgba(var(--gold-rgb),.08), transparent 70%), var(--bg); }
.login .a-card { width: min(380px, 100%); text-align: center; padding: 30px 26px; box-shadow: 0 24px 60px var(--shadow); }
.login img { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 14px; }
.login form { display: grid; gap: 12px; margin-top: 18px; text-align: start; }
.code-input { text-align: center; letter-spacing: .4em; font-size: 1.25rem !important; direction: ltr; }
.err { color: var(--bad); min-height: 1.4em; font-size: .85rem; }

/* hub: trusted devices */
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-2); margin-inline-start: 6px; }
.dev { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.dev small { color: var(--faint); display: block; font-size: .8rem; }

/* hub pages */
.hub-hello { padding: 6px 0 2px; }
.hub-hello h2 { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.hub-hello p { color: var(--faint); font-size: .88rem; margin-top: 2px; }
.hub-sec { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; align-items: start; }
.hub-sec .k-note { margin: -4px 0 6px; }
@media (max-width: 760px) { .hub-sec { grid-template-columns: 1fr; } }
.hub-hello kbd { font: 600 .74rem var(--body); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); }
.hub-app { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hub-app .k-card { border: 0; border-radius: 0; background: none; }
.hub-app .k-card:hover { background: var(--surface-2); }
.hub-links { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
/* An app with sub-panels (روح المسلم) gets more links: they wrap into rows of equal cells, never overlap. */
.hub-links a { flex: 1 1 86px; background: var(--surface); text-align: center; padding: 7px 6px; font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.hub-links a:hover { background: var(--surface-2); color: var(--gold-2); }
