/* ---------------------------------------------------------------------------
   Rama — "Private bank". Chosen by Istiak, 24 November 2026.

   White by day, deep navy by night, with a switch the person controls rather
   than the phone deciding for them. Navy and gold from the logo. Figures set
   in a serif, because response times are the point of this system and they
   should look like numbers somebody stands behind.

   This file is the single source. Both screens are built from it; nobody
   writes a second palette.
   --------------------------------------------------------------------------- */

:root {
  --bg: #f3f6fb;
  --bg-2: #e9eef8;
  --panel: #ffffff;
  --ink: #15223c;
  --muted: #66718c;
  --line: #dfe6f1;
  --wash: #eef2fa;
  --brand: #1b3764;
  --brand-soft: #e7edf9;
  --gold: #c8a063;
  --warn: #b5342a;
  --warn-soft: #fbe9e6;
  --amber: #8a6a24;
  --amber-soft: #f8f1dd;
  --shadow: 0 1px 1px rgba(21,34,60,.04), 0 10px 30px rgba(21,34,60,.06);
  --radius: 14px;
  color-scheme: light;
}

/* Night. Navy cannot carry a dark ground — it vanishes — so the brand colour
   lifts and the gold warms slightly. Every value is a token; no component
   hard-codes a colour that works in only one of the two. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --bg-2: #0e1528; --panel: #131b30; --ink: #e7ecf7;
    --muted: #95a0b9; --line: #25304a; --wash: #182138;
    --brand: #8fb2e8; --brand-soft: #17233c; --gold: #d9b67e;
    --warn: #e58a7c; --warn-soft: #361f1c; --amber: #d8b579; --amber-soft: #2b2516;
    --shadow: 0 1px 1px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --bg-2: #0e1528; --panel: #131b30; --ink: #e7ecf7;
  --muted: #95a0b9; --line: #25304a; --wash: #182138;
  --brand: #8fb2e8; --brand-soft: #17233c; --gold: #d9b67e;
  --warn: #e58a7c; --warn-soft: #361f1c; --amber: #d8b579; --amber-soft: #2b2516;
  --shadow: 0 1px 1px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

body {
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% -10%, var(--bg-2) 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.005em;
}

.wrap {
  max-width: 720px; margin: 0 auto; padding-block: 20px 100px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---- the logo, as supplied. Once per screen, top left. ---- */
.top { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.logo { height: 30px; width: auto; display: block; }
.logo-chip { background: #fff; border-radius: 7px; padding: 4px 7px; display: inline-block; line-height: 0; }
h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 27px;
  letter-spacing: .03em; margin: 0; line-height: 1; }
.who { margin-left: auto; font-size: 12.5px; color: var(--muted); text-align: right; }
.who button { background: none; border: none; color: var(--brand); font: inherit;
  font-size: 12.5px; cursor: pointer; padding: 0; border-bottom: 1px solid var(--gold); }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

/* The day/night switch. The person decides, not the phone. */
.theme-btn { background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; width: 34px; height: 34px; font-size: 15px; cursor: pointer;
  flex: none; line-height: 1; }
.theme-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---- tabs ---- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 8px; padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: color .15s, border-color .15s; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--gold); }

#search { width: 100%; font: inherit; font-size: 14px; color: inherit; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
#search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---- leads ---- */
.list { display: flex; flex-direction: column; gap: 9px; }
.lead { width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px 13px 16px; cursor: pointer;
  box-shadow: var(--shadow); color: inherit; font: inherit; display: block;
  position: relative; overflow: hidden; transition: transform .12s ease; }
.lead::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--line); }
.lead:active { transform: scale(.995); }
.lead.hot::before { background: var(--warn); }
.lead.warm::before { background: var(--amber); }
.lead.done::before { background: var(--gold); }
.lead .row1 { display: flex; gap: 9px; align-items: baseline; }
.lead .nm { font-weight: 600; letter-spacing: -.01em; }
.lead .clock { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--muted); letter-spacing: 0; }
.lead.hot .clock { color: var(--warn); font-weight: 700; }
.lead .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 30px 18px; color: var(--muted); text-align: center; font-size: 14px; }

.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 12px;
  padding: 14px 20px; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 24px rgba(21,34,60,.25); border-bottom: 3px solid var(--gold); }

/* ---- sheets ---- */
dialog { border: none; border-radius: 18px 18px 0 0; padding: 0; width: min(640px, 100%);
  max-width: 100%; margin: auto auto 0; background: var(--panel); color: var(--ink);
  box-shadow: 0 -10px 50px rgba(21,34,60,.25); }
dialog::backdrop { background: rgba(11,16,32,.5); }
.sheet { padding: 20px max(18px, env(safe-area-inset-left, 0px))
  calc(22px + env(safe-area-inset-bottom, 0px)); }
.sheet h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400;
  font-size: 25px; margin: 0 0 2px; letter-spacing: .01em; }
.sheet .said { background: var(--wash); border-left: 2px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 12px 14px; margin: 13px 0; white-space: pre-wrap;
  font-size: 14.5px; }

dl { margin: 0 0 14px; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; align-self: center; }
dd { margin: 0; font-size: 14.5px; }

.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
button.go { background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; }
button.plain { background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 15px; font: inherit; font-size: 14px; cursor: pointer; }
button.plain:hover { border-color: var(--brand); color: var(--brand); }
button.danger { color: var(--warn); border-color: var(--warn); }

.blocked { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 10px;
  padding: 12px 14px; font-size: 13.5px; margin-top: 10px; }
.blocked b { color: var(--warn); }
.blocked ul { margin: 6px 0 0; padding-left: 18px; }

label { display: block; font-size: 11.5px; color: var(--muted); margin: 12px 0 5px;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
input, textarea, select { width: 100%; font: inherit; font-size: 14.5px; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 74px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.hist { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 12px;
  font-size: 12.5px; color: var(--muted); }
.hist div { margin-bottom: 4px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.55; }
.offline { background: var(--amber-soft); border: 1px solid var(--amber); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px; }

/* ---- manager ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px;
  border-bottom: 1px solid var(--line); }
.card-head .dot { width: 5px; height: 14px; border-radius: 2px; background: var(--gold); flex: none; }
.card-head strong { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; }
.card dl { padding: 15px 16px; margin: 0; }
.card dd { font-family: "Instrument Serif", Georgia, serif; font-size: 21px;
  font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ---- the dialler. Always night: a call screen is not a place for white. ---- */
#call { position: fixed; inset: 0; background: #0b1020;
  background-image: radial-gradient(90% 50% at 50% 0%, #16233f 0%, #0b1020 70%);
  color: #eef2fa; z-index: 50; display: none; flex-direction: column; align-items: center;
  padding: calc(30px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-left, 0px))
           calc(26px + env(safe-area-inset-bottom, 0px)); }
#call.on { display: flex; }
#call .cname { font-family: "Instrument Serif", Georgia, serif; font-size: 30px;
  margin-top: 30px; text-align: center; letter-spacing: .01em; }
#call .cnum { opacity: .55; font-size: 14.5px; margin-top: 5px; font-variant-numeric: tabular-nums; }
#call .cstate { margin-top: 16px; font-size: 14.5px; opacity: .8; min-height: 22px; text-align: center; }
#call .ctime { font-family: "Instrument Serif", Georgia, serif; font-size: 40px;
  font-variant-numeric: tabular-nums; margin-top: 10px; }
#call .shows-as { margin-top: 20px; font-size: 12.5px; opacity: .5; text-align: center;
  max-width: 32ch; line-height: 1.55; }
#call .spacer { flex: 1; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; width: min(280px, 100%);
  margin-top: 18px; }
.keypad button { background: rgba(255,255,255,.07); color: inherit;
  border: 1px solid rgba(255,255,255,.1); border-radius: 999px; aspect-ratio: 1;
  font-size: 22px; font-family: inherit; cursor: pointer; }
.keypad button small { display: block; font-size: 9px; letter-spacing: .16em; opacity: .5; margin-top: -2px; }
.cbtns { display: flex; gap: 18px; align-items: center; margin-top: 24px; }
.cbtn { width: 62px; height: 62px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14);
  cursor: pointer; background: rgba(255,255,255,.07); color: #eef2fa; font-size: 12px;
  font-family: inherit; font-weight: 500; }
.cbtn.end { background: #b5342a; border-color: #b5342a; color: #fff; width: 72px; height: 72px;
  font-size: 13px; font-weight: 600; }
.cbtn[aria-pressed="true"] { background: #c8a063; border-color: #c8a063; color: #15223c; }
.after { width: min(360px, 100%); }
.after button { width: 100%; margin-top: 9px; background: rgba(255,255,255,.07); color: #eef2fa;
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 14px; font: inherit;
  font-size: 15px; cursor: pointer; }
.after button.primary { background: #c8a063; border-color: #c8a063; color: #15223c; font-weight: 700; }

/* ---------------------------------------------------------------------------
   Pages that are one column of form: signing in, choosing a password.

   `.pad` used to be the dialler keypad — a three-column grid of round
   buttons — and the sign-in form was written as `class="card pad"` meaning
   "a card with padding". The form became a keypad: labels and boxes side by
   side, a giant round Sign in. A name that generic will be reused by
   accident, so the keypad is now `.keypad` and padding is `.card-body`.
   Codex found this; it was visible on Istiak's screen the first time he
   opened the page.
   --------------------------------------------------------------------------- */
.wrap.narrow { max-width: 420px; }
.card-body { padding: 20px 20px 24px; }
.card-body label:first-of-type { margin-top: 0; }
.card-body button.go { width: 100%; margin-top: 18px; padding: 13px; font-size: 15.5px; }
.wrap.narrow .top { margin-bottom: 10px; }
.wrap.narrow .sub { margin-bottom: 16px; }

/* ---------------------------------------------------------------------------
   The admin page and the bar above the lead screen.

   Every class here starts with a- on purpose. The lead screen carries its own
   complete stylesheet inline, and the last time two files shared a class name
   the sign-in form inherited the dialler's keypad grid and Istiak saw it on
   screen. A prefix nobody else uses makes that impossible rather than
   unlikely.
   --------------------------------------------------------------------------- */

.a-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--panel); border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: 14px; }
.a-bar-right { display: flex; gap: 10px; align-items: center; }
.a-bar a { color: var(--brand); font-weight: 600; text-decoration: none; }
.a-bar a:hover { text-decoration: underline; }

.a-nav { display: flex; gap: 12px; align-items: baseline; font-size: 14px; }
.a-nav a { color: var(--brand); text-decoration: none; font-weight: 600; }

.a-small { color: var(--muted); font-size: 12.5px; }
.a-warn { color: var(--warn); font-size: 12.5px; font-weight: 600; }
.a-ok { color: var(--muted); font-size: 12.5px; }

.a-table { width: 100%; border-collapse: collapse; }
.a-table th { text-align: left; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--line); }
.a-table td { padding: 12px; border-bottom: 1px solid var(--line);
  vertical-align: top; font-size: 14px; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tr.a-off { opacity: .5; }

.a-inline { display: inline-block; margin: 0; }
.a-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a-edit-link {
  font: inherit; font-size: 13.5px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--wash); color: var(--ink); text-decoration: none;
  display: inline-block; }
.a-edit-link:hover { text-decoration: underline; }
.a-cancel { margin-left: 12px; color: var(--brand); font-weight: 600;
  text-decoration: none; font-size: 14px; }
.a-cancel:hover { text-decoration: underline; }
.a-username-warn { border-left: 3px solid var(--warn); padding-left: 10px; }
.a-table select, .a-table button, .a-bar button {
  font: inherit; font-size: 13.5px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--wash); color: var(--ink); cursor: pointer; }
.a-table button:disabled { opacity: .45; cursor: not-allowed; }

.a-good { background: var(--brand-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--brand); border-radius: 10px;
  padding: 12px 14px; margin: 14px 0; color: var(--ink); font-size: 14px; }

/* The one-time box: a temporary password or a new intake key. It is loud
   because it will never be shown again, and reading past it means somebody
   has to be given a new one. */
.a-once { border-left: 3px solid var(--gold); }
.a-secret { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px; word-break: break-all; background: var(--wash);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  margin: 10px 0; user-select: all; }

.a-signout { margin: 26px 0 40px; }
.a-signout button { font: inherit; font-size: 14px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink); cursor: pointer; }

@media (max-width: 560px) {
  .a-table thead { display: none; }
  .a-table tr { display: block; border-bottom: 1px solid var(--line); padding: 4px 0; }
  .a-table td { display: block; border-bottom: 0; padding: 6px 12px; }
}

/* A section heading on the admin page. The theme had h1 only, because until
   now every page was one thing. */
h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400;
  font-size: 21px; color: var(--ink); margin: 30px 0 12px; }

/* The theme makes every select full width, which is right in a form and wrong
   in a table cell beside a Save button. */
.a-table select { width: auto; min-width: 104px; }

/* ---------------------------------------------------------------------------
   The admin shell — sidebar and content.

   Collapses to a horizontal strip on a phone. Istiak does admin work on a
   phone often enough that a sidebar which pushes the content off screen would
   simply mean the admin never gets used away from a desk.
   --------------------------------------------------------------------------- */

.a-admin { display: flex; min-height: 100vh; align-items: stretch; }

.a-side { flex: 0 0 210px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 0; }
.a-side-top { padding: 0 16px 14px; }
.a-side-nav { display: flex; flex-direction: column; }
.a-side-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); }

.a-side-link { display: block; padding: 9px 16px; color: var(--ink); text-decoration: none;
  font-size: 14px; border-left: 3px solid transparent; }
.a-side-link:hover { background: var(--wash); }
.a-side-link.on { border-left-color: var(--gold); background: var(--brand-soft);
  font-weight: 600; color: var(--brand); }

.a-main { flex: 1 1 auto; min-width: 0; padding-block: 18px 40px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.a-main h2:first-child { margin-top: 0; }

/* Paging */
.a-pager { margin: 14px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.a-page { display: inline-block; padding: 6px 11px; border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.a-page.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* The rotation list: drag to reorder */
.a-sortable, .a-plain { list-style: none; margin: 6px 0 0; padding: 0; }
.a-row { display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px;
  background: var(--panel); }
.a-sortable .a-row { cursor: grab; }
.a-grip { color: var(--muted); letter-spacing: -2px; cursor: grab; }
.a-dragging { opacity: .45; }

@media (max-width: 760px) {
  .a-admin { display: block; }
  .a-side { flex: none; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 0; }
  .a-side-top { padding: 0 16px 8px; }
  .a-side-nav { flex-direction: row; overflow-x: auto; gap: 2px; padding: 0 10px; }
  .a-side-link { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent;
    padding: 8px 12px; }
  .a-side-link.on { border-left: 0; border-bottom-color: var(--gold); }
  .a-side-foot { margin-top: 0; display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; }
  .a-side-foot p { margin: 0; }
}

/* The theme makes every input full width, which is right for a form field and
   wrong for a tick box — it stretched across the row and pushed the name onto
   the line below. */
input[type="checkbox"], input[type="radio"] { width: auto; margin-right: 8px;
  vertical-align: middle; }
.a-row label { display: flex; align-items: center; gap: 4px; margin: 0;
  font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; }
