/* Z.A.S. Console: the same look as the apps and the approved mock-up.
   Fonts are served from the console itself (nothing loaded from other sites). */

@font-face { font-family: 'Geist'; src: url('/fonts/Geist-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/Geist-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/Geist-SemiBold.ttf') format('truetype'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/GeistMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/GeistMono-Medium.ttf') format('truetype'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/fonts/IBMPlexSansArabic-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/fonts/IBMPlexSansArabic-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }

:root {
  --bg: #050607;
  --panel: #0C0E11;
  --raised: #12151A;
  --line: #1C2026;
  --line2: #262B33;
  --line3: #3A4049;
  --text: #F2F4F7;
  --soft: #C9CED6;
  --text2: #A3AAB5;
  --text3: #7C8490;
  --green: #3DD68C;
  --amber: #F5B544;
  --red: #F2555A;
  --mono: 'Geist Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Geist', system-ui, sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--text); }
a:hover { color: #FFFFFF; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.2; }
h2 { margin: 0; font-size: 22px; font-weight: 600; }
h3 { margin: 0; font-size: 17px; font-weight: 600; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--text2); }
.faint { color: var(--text3); }
.small { font-size: 13px; }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }
.arabic { font-family: 'IBM Plex Sans Arabic', 'Geist', sans-serif; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; padding: 28px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: baseline; gap: 10px; padding: 0 12px 24px; }
.brand-mark { font-family: var(--mono); font-size: 16px; font-weight: 500; letter-spacing: 0.2em; }
.navlink { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text2); font-weight: 500; text-decoration: none; }
.navlink:hover { color: var(--text); background: var(--panel); }
.navlink.on { background: var(--raised); color: var(--text); }
.side-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.linkish { background: none; border: none; padding: 0; color: var(--text2); cursor: pointer; text-decoration: underline; font-size: 13px; text-align: left; }
.linkish:hover { color: var(--text); }
.page { flex: 1; min-width: 0; padding: 36px 48px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1440px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.head-title { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.spacer { flex: 1; }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid var(--line2); background: transparent; color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--line3); color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn.primary:hover { background: #FFFFFF; color: var(--bg); }
.btn.danger { border-color: #5A2A2D; color: #F7B5B7; }
.btn.small { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.green { background: rgba(61, 214, 140, 0.12); color: var(--green); }
.chip.amber { background: rgba(245, 181, 68, 0.12); color: var(--amber); }
.chip.red { background: rgba(242, 85, 90, 0.14); color: var(--red); }
.chip.plain { background: var(--raised); color: var(--text2); }
.pill { height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--line2); background: transparent; color: var(--text2); cursor: pointer; font-size: 14px; }
.pill.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; flex-shrink: 0; }

/* Cards, notes and tables */
.card { padding: 18px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-label { font-size: 13px; color: var(--text3); }
.card-value { font-size: 17px; font-weight: 600; }
.stat { font-family: var(--mono); font-size: 28px; font-weight: 500; }
.note { padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.note.amber { border: 1px solid #3A3220; background: rgba(245, 181, 68, 0.06); color: #E8D2A6; }
.note.red { border: 1px solid #4A2426; background: rgba(242, 85, 90, 0.06); color: #F3C4C6; }
.note.green { border: 1px solid #1F3A2E; background: rgba(61, 214, 140, 0.06); color: #BFEBD4; }
.table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tr { display: grid; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 14px; text-decoration: none; color: var(--text); }
.tr:first-child { border-top: none; }
.tr.th { background: var(--panel); font-size: 13px; color: var(--text3); padding-top: 12px; padding-bottom: 12px; }
a.tr:hover { background: #090B0D; }
.empty { padding: 28px; text-align: center; color: var(--text3); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { height: 44px; padding: 0 16px; border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--text2); cursor: pointer; font-size: 15px; font-weight: 500; }
.tab.on { color: var(--text); border-bottom-color: var(--text); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text2); }
.input { height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font-size: 15px; outline: none; }
.input:focus { border-color: var(--line3); }
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.error { color: #F7B5B7; font-size: 14px; }

/* Sign-in and other single-card pages */
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 16px; }
.solo { width: 100%; max-width: 440px; padding: 36px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.solo .brand { padding: 0; }

/* Site map */
.map { position: relative; border-radius: 14px; overflow: hidden; background: #0A0C0F; border: 1px solid var(--line); }
.map svg { display: block; width: 100%; height: auto; }
/* Sizes are in map units (the map is 1000 wide), so labels scale with the map. */
.zone-label { font-family: var(--mono); font-size: 30px; font-weight: 500; fill: #FFFFFF; paint-order: stroke; stroke: rgba(0, 0, 0, 0.85); stroke-width: 6px; }

/* Dialogs */
.backdrop { position: fixed; inset: 0; background: rgba(5, 6, 7, 0.72); display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; z-index: 10; overflow-y: auto; }
.dialog { width: 100%; max-width: 520px; margin: auto 0; padding: 26px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 16px; }

/* Two columns that stack on narrow screens */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }

/* Narrow screens (a phone, or a small window): the menu becomes a bar along the top */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--line); gap: 2px; }
  .brand { padding: 0 10px 0 4px; }
  .navlink { height: 38px; padding: 0 10px; }
  .side-foot { margin: 0 0 0 auto; padding: 0 4px; border-top: none; flex-direction: row; align-items: center; gap: 10px; }
  .side-foot .faint, .side-foot > span:first-child { display: none; }
  .page { padding: 20px 16px 32px; gap: 18px; }
  .head { flex-wrap: wrap; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .form-row, .split { grid-template-columns: minmax(0, 1fr); }
  .table { overflow-x: auto; }
  .tr { min-width: 760px; }
  .tabs { overflow-x: auto; }
  .tab { flex-shrink: 0; }
  h1 { font-size: 24px; }
}

/* Set-up steps */
.setup { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.step { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 10px; color: var(--text3); text-decoration: none; font-size: 15px; }
.step:hover { color: var(--text); background: var(--panel); }
.step.done { color: #D5DAE1; }
.step.on { background: var(--raised); color: var(--text); font-weight: 500; }
.step-mark { width: 26px; height: 26px; flex-shrink: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; border: 1px solid #333842; color: var(--text3); }
.step.done .step-mark { background: rgba(61, 214, 140, 0.16); border-color: transparent; color: var(--green); }
.step.on .step-mark { background: var(--text); border-color: var(--text); color: var(--bg); }
.setup-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.seg button { height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--text2); cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--text); color: var(--bg); font-weight: 600; }
.editor { position: relative; border-radius: 14px; overflow: hidden; background: #0A0C0F; border: 1px solid var(--line); touch-action: none; user-select: none; }
.editor svg { display: block; width: 100%; height: auto; }
.handle { fill: #FFFFFF; stroke: #050607; stroke-width: 2; cursor: nwse-resize; }
.handle.ne, .handle.sw { cursor: nesw-resize; }
.chip-on-map { position: absolute; padding: 6px 10px; border-radius: 8px; background: rgba(5, 6, 7, 0.82); font-size: 13px; font-weight: 500; pointer-events: none; }
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; border-radius: 15px; border: none; cursor: pointer; padding: 0; background: #333842; }
.switch[aria-pressed="true"] { background: var(--green); }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: var(--text); transition: left 0.2s; }
.switch[aria-pressed="true"] span { left: 23px; }
.spinner-note { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 14px; }
.split.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) {
  .setup { grid-template-columns: minmax(0, 1fr); }
  .steps { position: static; flex-direction: row; overflow-x: auto; }
  .step { flex-shrink: 0; white-space: nowrap; }
  .split.wide-left { grid-template-columns: minmax(0, 1fr); }
}

/* ---- The join poster (step 8) ---- */
.poster-step { display: flex; gap: 32px; align-items: flex-start; }
.poster { width: 340px; flex-shrink: 0; box-sizing: border-box; padding: 26px; border-radius: 12px; background: #FAFAF8; color: #111316; display: flex; flex-direction: column; gap: 16px; }
.poster-mark { font-family: var(--mono); font-size: 14px; letter-spacing: 0.2em; font-weight: 500; }
.poster-title { font-size: 22px; font-weight: 700; line-height: 1.2; }
.poster ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.4; }
@media (max-width: 900px) {
  .poster-step { flex-direction: column; }
  .poster { width: 100%; max-width: 340px; }
}
