:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e4e8f1;
  --text: #121826;
  --muted: #667085;
  --primary: #2f6bff;
  --primary-ink: #ffffff;
  --primary-soft: #e8efff;
  --green: #12a150;
  --green-soft: #e3f6eb;
  --amber: #c27803;
  --amber-soft: #fdf3dc;
  --red: #d92d20;
  --red-soft: #fde8e7;
  --gray-soft: #eef0f4;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .04);
  --radius: 14px;
  --font: "IBM Plex Sans Arabic", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b24;
  --surface-2: #1b2130;
  --border: #283042;
  --text: #e8ecf4;
  --muted: #98a2b3;
  --primary: #5b8cff;
  --primary-soft: #1d2a4a;
  --green: #3ccb7f;
  --green-soft: #12301f;
  --amber: #f5b544;
  --amber-soft: #36290f;
  --red: #ff6b5f;
  --red-soft: #3a1714;
  --gray-soft: #222a38;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[dir="ltr"] body { font-family: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif; }
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; direction: ltr; unicode-bidi: isolate; }

/* ---------- icons (CSS masks) ---------- */
.ic { width: 18px; height: 18px; display: inline-block; background: currentColor; flex: none;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic-home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ic-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.8-3.6 3.3-5.5 6.5-5.5s5.7 1.9 6.5 5.5'/%3E%3Cpath d='M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.8c1.8.8 3 2.5 3.5 5.2'/%3E%3C/svg%3E"); }
.ic-live { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='2.5' y='6' width='13' height='12' rx='2.5'/%3E%3Cpath d='m15.5 10.5 6-3.5v10l-6-3.5'/%3E%3C/svg%3E"); }
.ic-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13'/%3E%3Ccircle cx='3.5' cy='6' r='1'/%3E%3Ccircle cx='3.5' cy='12' r='1'/%3E%3Ccircle cx='3.5' cy='18' r='1'/%3E%3C/svg%3E"); }
.ic-gear { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
.ic-moon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E"); }
.ic-out { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }
.ic-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ic-edit { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E"); }
.ic-trash { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3C/svg%3E"); }
.ic-copy { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E"); }
.ic-eye { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ic-dice { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7L21 8M21 3v5h-5'/%3E%3C/svg%3E"); }
.ic-play { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4v16l13-8z' fill='black'/%3E%3C/svg%3E"); }
.ic-stop { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='5' width='14' height='14' rx='2' fill='black'/%3E%3C/svg%3E"); }
.ic-refresh { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7L21 8M21 3v5h-5'/%3E%3C/svg%3E"); }
.ic-door { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E"); }
.ic-download { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E"); }
.ic-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.ic-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 8px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h8a3 3 0 0 1 3 3v7H6a3 3 0 0 1-3-3z M16.5 10.5 21 7v10l-4.5-3.5z' fill='black'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h8a3 3 0 0 1 3 3v7H6a3 3 0 0 1-3-3z M16.5 10.5 21 7v10l-4.5-3.5z' fill='black'/%3E%3C/svg%3E") center/contain no-repeat; }
.brand.big .logo { width: 44px; height: 44px; border-radius: 12px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a.active { background: var(--primary-soft); color: var(--primary); }
.side-foot { margin-top: auto; }
.mini-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }

main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.topbar h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.top-actions { display: flex; gap: 6px; }
.view { padding: 4px 28px 40px; max-width: 1200px; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2 { font-size: 15px; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 10px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.block { width: 100%; padding: 11px; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; vertical-align: middle; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.green { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.dot.red { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.dot.gray { background: var(--muted); box-shadow: 0 0 0 4px var(--gray-soft); }
.dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

/* status hero */
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero .big-dot { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.hero .big-dot .ic { width: 26px; height: 26px; }
.hero.green .big-dot { background: var(--green-soft); color: var(--green); }
.hero.amber .big-dot { background: var(--amber-soft); color: var(--amber); }
.hero.red .big-dot { background: var(--red-soft); color: var(--red); }
.hero.gray .big-dot { background: var(--gray-soft); color: var(--muted); }
.hero h3 { margin: 0; font-size: 18px; }
.hero p { margin: 2px 0 0; color: var(--muted); }
.hero .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .value.warn { color: var(--amber); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 11px 20px; border-top: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); border-top: 0; }
tbody tr:hover { background: var(--surface-2); }
td.actions { text-align: end; white-space: nowrap; }
td .name { font-weight: 600; }
tr.inactive td { opacity: .55; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 13px; }

.ev-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-icon { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--muted); }
.ev-icon.info { background: var(--primary); }
.ev-icon.warning { background: var(--amber); }
.ev-icon.error { background: var(--red); }
.ev-icon.debug { background: var(--border); }
.ev { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.ev:first-child { border-top: 0; }
.ev .grow { flex: 1; min-width: 0; }
.ev .detail { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }

/* forms */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13.5px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field-error { color: var(--red); font-size: 12px; font-weight: 400; min-height: 0; }
.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--red); margin: 0; min-height: 1em; font-size: 13px; }
.search { position: relative; min-width: 220px; flex: 1; max-width: 360px; }

.switch { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.switch:first-of-type { border-top: 0; }
.switch .txt { display: flex; flex-direction: column; gap: 2px; }
.switch .txt small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; flex: none; padding: 0; border: 0; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { inset-inline-start: 21px; }
.switch input:focus { box-shadow: 0 0 0 3px var(--primary-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 13px; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.segmented { display: inline-flex; align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.code-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px 4px 2px 10px; }
[dir="rtl"] .code-pill { padding: 2px 10px 2px 4px; }
.code-pill code { letter-spacing: .12em; font-weight: 600; min-width: 4.2ch; }
.code-pill .icon-btn.sm { width: 26px; height: 26px; border: 0; background: none; }

.zoom-name { background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.zoom-name code { font-size: 15px; font-weight: 600; }

.check { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.check .ic { width: 15px; height: 15px; }
.check.ok .ic { color: var(--green); }
.check.bad .ic { color: var(--red); }

.setup-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.setup-item .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); color: var(--muted); flex: none; }
.setup-item.done .tick { background: var(--green-soft); color: var(--green); }
.setup-item .tick .ic { width: 12px; height: 12px; }
.setup-item.done .label { color: var(--muted); text-decoration: line-through; }

.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.room-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.room-card .room-name { font-weight: 600; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(10, 14, 24, .45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal header h3 { margin: 0; font-size: 17px; }
.modal .body { padding: 20px 22px; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

.toasts { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; }
[dir="rtl"] .toasts { transform: translateX(50%); }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: pop .2s; }
.toast.error { background: var(--red); color: #fff; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(1200px 500px at 50% -10%, var(--primary-soft), transparent), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 8px; }
.login-foot { text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 20; border-inline-end: 0; border-top: 1px solid var(--border); }
  .sidebar .brand, .side-foot { display: none; }
  nav { flex-direction: row; width: 100%; justify-content: space-around; }
  nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 4px; flex: 1; }
  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 19px; }
  .view { padding: 4px 16px 96px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero .actions { margin-inline-start: 0; width: 100%; }
  .hero .actions .btn { flex: 1; }
  .hide-sm { display: none; }
  th, td { padding: 10px 14px; }
  .table-wrap { margin: 0 -20px -20px; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
}
