/* AM14 base styles (13 Nov 2026) — written for AM14: layout, type, forms, buttons, tables, badges, windows.
   Colours come from the AM14 tokens (am14.css / am14-app.css). Replaces the earlier shared base stylesheet. */
:root { --brand: #7cff2b; --accent: #19d3ff; --bg: #03060c; --panel: #0a1322; --line: #22324a; --text: #eef3f8; --muted: #94a3b8;
  --warn: #ffc53d; --danger: #ff6b81; --ok: #7cff2b; --info: #7dd3fc; --radius: 20px; color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif; overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.15; } h1 { font-size: clamp(24px, 4vw, 34px); } h2 { font-size: 21px; } h3 { font-size: 17px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .mono { font-family: ui-monospace, Consolas, monospace; } .hidden { display: none !important; }
.err { color: var(--danger); } .okc { color: var(--ok); } .warn { color: var(--warn); }

/* layout */
.topbar { position: sticky; top: 0; z-index: 30; }
.topbar .in { max-width: 1240px; margin: auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; }
.topbar .sp { flex: 1; } .topbar .act { display: flex; gap: 8px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; min-width: 0; }
.brand .logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; font-weight: 900; font-size: 12px; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand .nm { display: flex; flex-direction: column; min-width: 0; } .brand .nm b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .brand .nm small { color: var(--muted); font-weight: 600; font-size: 11px; }
.wrap { max-width: 1240px; margin: auto; padding: 20px 16px 70px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; }
.nav a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; transition: .15s; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .row.between { justify-content: space-between; } .stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); } .grid > * { min-width: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.card { padding: 18px; margin: 0 0 16px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.tile { padding: 14px; text-decoration: none; } .tile b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; } .tile span { color: var(--muted); font-size: 12.5px; }
.hub { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 6px 0 18px; }
.hub a { min-height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; text-decoration: none; text-align: center; font-weight: 800; transition: .18s; }
.hub a span { font-size: 24px; line-height: 1; }
.empty { padding: 22px; text-align: center; color: var(--muted); }

/* forms */
label { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #a9b6c6; margin: 10px 0 5px; font-weight: 700; }
label.inline { display: inline-flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); margin: 4px 12px 4px 0; }
input, select, textarea { width: 100%; font: inherit; color: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 42px; background: #050b14; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; }
textarea { min-height: 90px; resize: vertical; }
.form { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form .full { grid-column: 1 / -1; } .form .actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* buttons */
button, .btn { font: inherit; font-weight: 800; color: #fff; background: rgba(255,255,255,.05); border: 1px solid #2a3a52; border-radius: 12px; padding: 10px 14px; cursor: pointer; text-decoration: none;
  display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 42px; transition: .15s; }
button:hover, .btn:hover { border-color: #4a5d78; }
button.danger, .btn.danger { border-color: #7d1d2e; color: var(--danger); } button.ghost, .btn.ghost { background: transparent; }
button.sm, .btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 10px; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #2b3a50; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 800; white-space: nowrap; background: rgba(255,255,255,.03); }
.badge.warn { border-color: #8a6a1f; color: var(--warn); } .badge.danger { border-color: #8b1d2e; color: var(--danger); }
.badge.live { color: #fff; animation: amBadge 1.6s infinite; } @keyframes amBadge { 50% { opacity: .65; } }

/* tables */
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #a9b6c6; text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid rgba(160,190,230,.08); vertical-align: middle; } tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover td { background: rgba(124,255,43,.04); }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.tblTools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; } .tblTools input, .tblTools select { width: auto; flex: 1 1 180px; }

/* windows */
.modalBg { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 80; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal { width: min(680px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.modal.wide { width: min(980px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; } .modal header h2 { margin: 0; }

@media (max-width: 600px) { .wrap { padding: 14px 12px 60px; } .card { padding: 14px; } }

/* face scan as the first step (27 Nov) */
.faceScan { display: grid; gap: 10px; }
.faceCam video { max-height: 50vh; }
.faceSteps { justify-content: center; gap: 6px; }
.faceDone { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid rgba(124,255,43,.45); border-radius: 12px; }
.byCode { margin-top: 10px; } .byCode summary { cursor: pointer; color: var(--am-green, #7cff2b); font-weight: 600; }
.result.warn { border: 1px solid rgba(255,197,61,.6); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.result.good b { display: block; }
/* health sheet (27 Nov): two small charts, one axis each */
.hCharts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 10px 0; }
.hChart { border: 1px solid var(--am-line, rgba(255,255,255,.12)); border-radius: 12px; padding: 10px; }
.hChartT { font-weight: 600; margin-bottom: 4px; } .hChartT b { color: var(--am-text, #fff); }
.hPlot { position: relative; } .hSvg { width: 100%; height: auto; display: block; overflow: visible; }
.hGrid { stroke: rgba(255,255,255,.10); stroke-width: 1; } .hAx { fill: rgba(220,230,245,.65); font-size: 10px; }
.hLine { fill: none; stroke: var(--am-green, #7cff2b); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hDot { fill: var(--am-green, #7cff2b); stroke: #0b1322; stroke-width: 2; } .hHit { fill: transparent; cursor: pointer; outline: none; }
.hTip { position: absolute; transform: translate(-50%, -130%); background: #0b1322; color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 3px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; }
.hTip.on { opacity: 1; }
.hAlert { border: 1px solid rgba(255,46,77,.55); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.hRec { border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 10px 12px; } .hRec.on { border-color: rgba(255,197,61,.55); }
.hTreat { margin: 6px 0 4px 18px; padding: 0; } .hTable summary { cursor: pointer; margin: 6px 0; }
/* bracket (final stage / knockout) — shared by the system and the website */
.bracket { display: flex; gap: 14px; overflow-x: auto; padding: 6px 0 10px; }
.bCol { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-width: 200px; }
.bRound { font-weight: 700; text-align: center; opacity: .8; }
.bMatch { border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 8px 10px; background: rgba(8,14,26,.6); cursor: pointer; }
.bTeam { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; } .bTeam.win { color: var(--am-green, #7cff2b); font-weight: 700; }
a.card.tour { display: block; color: inherit; text-decoration: none; }
.teamDot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(255,255,255,.4); }