/* Bilyaro admin: one light stylesheet, no framework. Felt green accent, both themes, right-to-left first. */
:root {
  --bg: #f4f6f5; --surface: #ffffff; --fg: #18221e; --muted: #5e6b65; --line: #dde3df;
  --accent: #1f6b4f; --accent-fg: #ffffff; --accent-soft: #e2efe9;
  --warn: #9a5b00; --warn-soft: #fbf0dd; --bad: #b3261e; --bad-soft: #fbe4e2; --good: #1f6b4f;
  --radius: 10px; --font: "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614; --surface: #19201d; --fg: #e5ebe8; --muted: #98a59f; --line: #2b3530;
    --accent: #5fc49c; --accent-fg: #0d1a14; --accent-soft: #1c3127;
    --warn: #e7b45c; --warn-soft: #3a2e18; --bad: #f28b82; --bad-soft: #3b1f1d; --good: #5fc49c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 var(--font); }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* sign-in and invitation cards */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; width: min(420px, 100%); display: grid; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: inset -3px -3px 0 rgba(0,0,0,.15); }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
.error { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.note { color: var(--muted); font-size: 13px; }
.secret { font-family: var(--mono); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 10px; word-break: break-all; direction: ltr; text-align: center; letter-spacing: .08em; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
nav .brand { padding: 4px 8px 14px; }
nav a { text-decoration: none; color: var(--fg); padding: 8px 10px; border-radius: 8px; }
nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav .spacer { flex: 1; }
nav .me { font-size: 13px; color: var(--muted); padding: 8px 10px; border-top: 1px solid var(--line); }
main { padding: 24px clamp(16px, 3vw, 32px); display: grid; gap: 20px; align-content: start; min-width: 0; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 10px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  nav { flex-direction: row; flex-wrap: wrap; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  nav .spacer, nav .brand { display: none; }
}

/* figures and tables */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.tile .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
.tile .l { color: var(--muted); font-size: 13px; }
.tile.live .v::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-inline-end: 8px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .tile.live .v::before { animation: none; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.n { font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pill.off { background: var(--bad-soft); color: var(--bad); }
.pill.wait { background: var(--warn-soft); color: var(--warn); }
.chart svg { width: 100%; height: 180px; display: block; }
.chart .legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-row label { flex: 1 1 160px; }
.toast { position: fixed; inset-inline-start: 16px; bottom: 16px; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
