/* Sharqawi Controls - the front pages (/login, /, /admin) on the one design kernel, sq.css (tokens, fonts, top bar,
   cards, tables, buttons, fields, dialogs). Only what is specific to these pages lives here. The @import keeps the
   server's small "note" pages (core.py _note: app.css only) on the kernel too; the three pages link sq.css first. */
@import url('/static/sq.css');

body.sq-topbody { display: flex; flex-direction: column; }
body.sq-topbody > main { flex: 1 1 auto; min-width: 0; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--good); font-size: 13px; margin: 4px 0 8px; }
.error { color: var(--crit); font-size: 13px; min-height: 20px; }
.arrow::after { content: "\2192"; }

/* top bar extras: tools may wrap on phones; the quiet link has no frame; the who-am-I chip */
.sq-rail.sq-top .sq-tools { flex-wrap: wrap; }
@media (max-width: 1099px) { .sq-rail.sq-top .sq-tools { display: flex !important; } }   /* the kernel's phone rule hides .sq-tools even in top-bar mode */
.sq-rail .sq-tools .btn { backdrop-filter: none; -webkit-backdrop-filter: none; }   /* the kernel .btn blur inside the blurred bar paints a light pill in Chrome */
.sq-rail.sq-top .sq-tools .btn.quiet { border-color: transparent; }
.sq-rail.sq-top .sq-tools .chip { font: 600 12px/1 var(--sans); padding: 6px 10px; gap: 6px; }
.sq-rail.sq-top .sq-tools .chip .dotsep { color: var(--muted); }

/* fields: kernel inputs at a form height, uppercase display labels */
.field { display: grid; gap: 5px; }
.field label { font: 600 11px/1.25 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, input.search { width: 100%; min-height: 36px; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw .btn { position: absolute; right: 5px; top: 5px; min-height: 26px; }
.pwcur { display: grid; gap: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r1, 6px); background: var(--surface-2); }
.pwline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pwline code { font-size: 15px; letter-spacing: .04em; color: var(--ink, inherit); user-select: all; word-break: break-all; }
.btn.block { width: 100%; min-height: 38px; font-size: 13.5px; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font: 600 10.5px var(--display); letter-spacing: .06em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); }
.badge.off { background: var(--crit-soft); color: var(--crit); }
.join { border-color: var(--warn); }
.join-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.join-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
.join-list .email { font-size: 12px; color: var(--muted); }

/* layout helpers */
.stack { display: grid; gap: 12px; align-content: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* 2026-11-20: the same 4 columns whoever signs in */
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid.fields { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.field.wide { grid-column: 1 / -1; }

/* dialogs (sign-in, register, reset, PIN, passwords) */
dialog { padding: 0; max-width: 440px; width: calc(100% - 32px); }
dialog.auth .card, dialog > form { background: transparent; border: 0; box-shadow: none; padding: 28px 28px 24px; position: relative; }
dialog h2, dialog h3 { font: 600 18px/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
dialog h3 span { text-transform: none; letter-spacing: 0; color: var(--accent); }
dialog .sub { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }
dialog.auth .x { position: absolute; top: 10px; right: 10px; }
dialog[open] { animation: dlg-in 200ms ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog form { display: grid; gap: 14px; }
dialog .dlg-actions, dialog .row.end { display: flex; gap: 8px; justify-content: flex-end; }
.auth .links { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.7; }

/* landing (/login): the head-office photo fading into the ground, the title, every project as a glass card */
.landing { position: relative; display: flex; align-items: flex-end; overflow: hidden; }
.landing > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.landing::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--ground) 6%, transparent) 0%, color-mix(in srgb, var(--ground) 40%, transparent) 45%, color-mix(in srgb, var(--ground) 92%, transparent) 78%, var(--ground) 100%); }
.landing .copy { position: relative; z-index: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 48px 32px 32px; }
.landing h1 { font: 600 52px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.landing h1::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 14px var(--glow); margin-bottom: 14px; }
.landing .lead { color: var(--ink-2); font-size: 17px; margin-top: 10px; max-width: 40rem; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 28px; }
.pcard { display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 10px; color: var(--ink); text-align: left; font: inherit;
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r3); box-shadow: var(--card-shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 200ms ease-out, border-color 200ms ease-out; }
.pcard .ph { aspect-ratio: 16 / 9; border-radius: var(--r2); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font: 600 20px var(--display); letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 200ms ease-out; }
.pcard .nm { font: 600 13.5px/1.25 var(--sans); padding: 0 6px; text-wrap: balance; }
.pcard .cd { font: 600 10.5px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.pcard .go { color: var(--accent); font: 600 12.5px/1.4 var(--sans); padding: 0 6px; margin-top: 2px; display: inline-flex; align-items: center; gap: 6px; }
.pcard .go::after { content: "\2192"; transition: transform 150ms ease-out; }
.pcard.live { cursor: pointer; }
.pcard.live:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pcard.live:hover .ph img { transform: scale(1.04); }
.pcard.live:hover .go::after { transform: translateX(3px); }
.pcard.live:active { transform: scale(.98); }
.pcard .lock { font: 600 10px var(--display); letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.projects .skel { aspect-ratio: 16 / 11; border-radius: var(--r3); background: var(--card); border: 1px solid var(--card-line); }

/* home: one glass card per dashboard, photo on top (card r4 20 = photo r2 10 + padding 10) */
.home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; min-height: 20px; }
.project { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r4); box-shadow: var(--card-shadow);
  transition: transform 200ms ease-out, border-color 200ms ease-out; }
.project:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.project:active { transform: scale(.985); }
.project .image { aspect-ratio: 16 / 9; border-radius: var(--r2); background: var(--surface-2); overflow: hidden; }
.project .image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms ease-out; }
.project:hover .image img { transform: scale(1.03); }
.project .content { padding: 0 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.project h3 { font: 600 20px/1.15 var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.project p { color: var(--muted); font-size: 13.5px; }
.project .foot { margin-top: auto; padding-top: 6px; }
.project .go { color: var(--accent); font: 600 13px/1 var(--sans); display: inline-flex; align-items: center; gap: 6px; }
.project:hover .go { text-decoration: underline; text-underline-offset: 4px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* note pages (core.py _note): one centred card */
body.note { display: grid; place-items: center; padding: 16px; }
.note main { max-width: 440px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.note .logo { height: 56px; padding: 8px 14px; background: #fff; border-radius: var(--r2); }
.note h1 { font: 600 24px/1.15 var(--display); letter-spacing: .04em; text-transform: uppercase; }

/* admin: tabs, two-column panes, the people table scrolls inside its frame (owner law: one screen at 1440x900) */
.admin .tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin .card h2 { margin: 0; font: 600 15px/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); text-wrap: balance; }
.admin .card .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.admin .adm-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.admin .grid.fields { grid-template-columns: 1fr; gap: 8px; }
.admin .grid.fields .field { grid-template-columns: 112px 1fr; align-items: center; }
.admin #a-doors { flex-direction: column; align-items: flex-start; gap: 6px; }
.admin .field.inl { display: inline-flex; align-items: center; gap: 8px; }
.admin .field.inl select { width: auto; min-height: 30px; }
.admin .tw { max-height: calc(100dvh - 232px); }
.admin [data-pane="activity"] .tw { max-height: calc(100dvh - 262px); }
td.c, th.c { text-align: center; }
tr.off td { opacity: .55; }
td .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
td .name input { min-height: 28px; padding: 0 6px; margin-left: -7px; border-color: transparent; background: transparent; font-weight: 600; font-size: 13.5px; width: 11em; }
td .name input:hover { border-color: var(--line-2); }
td .name input:focus { background: var(--surface); }
td .email { color: var(--muted); font-size: 12px; }
td select { min-height: 28px; font-size: 12.5px; padding: 0 26px 0 8px; }
.kv > div { display: grid; grid-template-columns: 150px 1fr; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--card-line); font-size: 13px; }
.kv .label { font: 600 11px/1.3 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; box-shadow: 0 0 8px currentColor; }
.dot.ok { background: var(--good); color: var(--good); }
.dot.bad { background: var(--crit); color: var(--crit); }
.nowrap { white-space: nowrap; }
tr.warnrow td { background: var(--crit-soft) !important; }
input.search { max-width: 300px; }
.boards { display: grid; gap: 10px; }
.board-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--card-line); border-radius: var(--r2); background: color-mix(in srgb, var(--ink) 3%, transparent); }
.board-row .switch { padding-bottom: 8px; }
.pinfield { width: 200px; }
code { font: 12.5px ui-monospace, Consolas, monospace; color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .knob { width: 36px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; transition: background-color 150ms ease-out; flex: none; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 150ms ease-out; }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(14px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 3px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; background: var(--ink); color: var(--ground); padding: 10px 18px; border-radius: 999px;
  font: 600 13px/1 var(--sans); pointer-events: none; transition: transform 200ms ease-out, opacity 200ms ease-out; z-index: 9; box-shadow: var(--card-shadow); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 1100px) {
  .admin .adm-grid { grid-template-columns: 1fr 1fr; }
  .admin .adm-people { grid-template-columns: 320px minmax(0, 1fr); }
  .admin .adm-tall { grid-row: span 2; }
}
@media (max-width: 900px) {
  .landing .copy { padding: 40px 20px 28px; }
  .landing h1 { font-size: 38px; }
  .landing .lead { font-size: 15px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .sq-rail.sq-top .sq-mid { flex-wrap: wrap; }
  .sq-rail.sq-top .sq-tools { flex: 1 1 100%; }
  .sq-rail.sq-top .sq-tools .btn { padding: 6px 10px; }
  .landing .copy { padding: 32px 16px 20px; }
  .landing h1 { font-size: 30px; }
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
  .grid { grid-template-columns: 1fr; }
  dialog.auth .card, dialog > form { padding: 24px 18px 20px; }
  .admin .tw, .admin [data-pane="activity"] .tw { max-height: none; }
  .pinfield { width: 100%; }
}

/* Admin > Rebuild now: a fixed status beside each page's button (2026-11-03) */
.rb-st{display:inline-flex;align-items:center;gap:6px;min-width:150px;font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums;margin-right:8px}
.rb-st::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--line-2);flex:none}
.rb-st.ok{color:var(--ink-2)}.rb-st.ok::before{background:var(--good)}
.rb-st.run{color:var(--warn)}.rb-st.run::before{background:var(--warn);animation:rb-pulse 1s ease-in-out infinite alternate}
.rb-st.bad{color:var(--crit)}.rb-st.bad::before{background:var(--crit)}
@keyframes rb-pulse{to{opacity:.35}}
@media (prefers-reduced-motion:reduce){.rb-st.run::before{animation:none}}
/* one line per page: name | status | button (owner 2026-11-03: "which status is which") */
.rb-grid{display:grid;gap:0;margin-top:4px;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.rb-grid .rb-h{padding:8px 12px;font-size:11.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);background:var(--surface-2)}
.rb-grid .rb-r{display:grid;grid-template-columns:150px minmax(0,1fr) auto;align-items:center;gap:12px;padding:8px 12px;border-top:1px solid var(--line)}
.rb-grid .rb-r b{font-size:13.5px}
.rb-grid .rb-st{min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:640px){.rb-grid .rb-r{grid-template-columns:1fr auto}.rb-grid .rb-st{grid-column:1/-1;grid-row:2}}
