/* ─────────────────────────────────────────────────────────────────────────
   TATHKARAH · Daily Operations Log — design system
   Night-flight navy field, boarding-pass surfaces, single orange accent.
   ───────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,800&family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;600;700&family=Cairo:wght@500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  --navy-950: #050e20;
  --navy-900: #0a1a38;
  --navy-800: #10254c;
  --navy-700: #1b3767;
  --brand:    #2f5496;
  --sky:      #bdd6ee;
  --sky-dim:  #8fb0d4;
  --orange:   #f58220;
  --orange-hi:#ffa14e;
  --paper:    #f6f8fc;
  --paper-dim:#e7edf6;
  --ink:      #142443;
  --ink-soft: #47597c;
  --line:     rgba(189, 214, 238, .16);
  --danger:   #e5533d;
  --ok:       #3fae76;
  --radius:   14px;
  --font-display: "Bricolage Grotesque", "Cairo", sans-serif;
  --font-body: "IBM Plex Sans", "Tajawal", sans-serif;
  --font-mono: "IBM Plex Mono", "Tajawal", monospace;
  --font-display-ar: "Cairo", sans-serif;
  --font-body-ar: "Tajawal", "Cairo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--sky);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(47, 84, 150, .55), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(27, 55, 103, .5), transparent 55%),
    linear-gradient(168deg, var(--navy-900) 0%, var(--navy-950) 70%);
  min-height: 100vh;
  background-attachment: fixed;
}

/* faint star grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(rgba(189,214,238,.14) 1px, transparent 1px),
    radial-gradient(rgba(189,214,238,.08) 1px, transparent 1px);
  background-size: 160px 160px, 90px 90px;
  background-position: 0 0, 40px 60px;
}

/* dotted flight path arcing across the page */
.flightpath {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
}

.shell { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 28px 22px 80px; }

/* ── masthead ─────────────────────────────────────────────────────────── */
.masthead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 30px;
  animation: rise .5s ease both;
}
.brandmark { display: flex; align-items: center; gap: 14px; }
.brandmark .logoimg {
  display: block; height: 52px; width: auto;
  filter: drop-shadow(0 4px 18px rgba(3, 9, 24, .5));
}
.brandmark .tagline {
  margin: 8px 2px 0; font-size: 12.5px; letter-spacing: .34em;
  text-transform: uppercase; color: var(--sky-dim);
}
@media (max-width: 560px) { .brandmark .logoimg { height: 40px; } }
.mast-side { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
[dir="rtl"] .mast-side { align-items: flex-start; }
.mast-side .dateline {
  font-family: var(--font-mono); font-size: 13px; color: var(--sky-dim);
}
.mast-side .switch {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end;
}
[dir="rtl"] .mast-side .switch { justify-content: flex-start; }
.mast-side .switch a, .mast-side .switch button {
  background: rgba(16, 37, 76, .66); border: 1px solid var(--line);
  color: var(--sky-dim); font-size: 12.5px; font-weight: 500;
  border-radius: 999px; padding: 6px 15px; text-decoration: none;
  cursor: pointer; font-family: var(--font-body); line-height: 1;
  transition: all .15s;
}
.mast-side .switch a:hover, .mast-side .switch button:hover {
  color: #fff; border-color: var(--orange);
}
#logoutWrap { display: contents; }
#logoutWrap[hidden] { display: none; }
.scopebadge[hidden] { display: none; }

/* ── ticket surfaces ──────────────────────────────────────────────────── */
.ticket {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(3, 9, 24, .55), 0 2px 0 rgba(255,255,255,.06) inset;
}
/* perforation notches */
.ticket.notched::before, .ticket.notched::after {
  content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy-950); top: 50%; transform: translateY(-50%);
  box-shadow: 0 0 0 1px rgba(189,214,238,.07);
}
.ticket.notched::before { left: -13px; }
.ticket.notched::after { right: -13px; }

.ticket .rail {
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: repeating-linear-gradient(90deg,
    var(--brand) 0 34px, var(--orange) 34px 46px);
}

/* ── check-in (agent select) ──────────────────────────────────────────── */
.checkin { max-width: 560px; margin: 8vh auto 0; padding: 42px 40px 36px; animation: rise .55s .08s ease both; }
.backcircle {
  position: absolute; top: 18px; inset-inline-start: 18px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--paper-dim); border: 1.5px solid transparent;
  color: var(--ink-soft); font-size: 16px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.backcircle:hover { color: var(--orange); border-color: var(--orange); background: rgba(245, 130, 32, .08); }
[dir="rtl"] .backcircle { transform: scaleX(-1); }
.checkin h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 27px;
  margin: 14px 0 4px; color: var(--ink);
}
.checkin p.sub { margin: 0 0 24px; color: var(--ink-soft); font-size: 14.5px; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.teamhead {
  margin: 20px 0 10px; padding-bottom: 6px;
  border-bottom: 2px solid var(--paper-dim);
  display: flex; align-items: baseline; gap: 6px;
}
.teamhead:first-child { margin-top: 4px; }
.teamhead b {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--brand);
}
.teamhead b::before { content: "▸ "; color: var(--orange); }
.teamhead .mgr { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.leaderlink {
  margin-inline-start: auto; font-size: 12px; font-weight: 600;
  color: var(--role-sub); text-decoration: none;
  border: 1px solid rgba(217, 111, 18, .35); border-radius: 999px;
  padding: 3px 12px; background: rgba(217, 111, 18, .07);
  transition: all .14s; white-space: nowrap;
}
.leaderlink:hover { background: rgba(217, 111, 18, .16); border-color: var(--role-sub); }
[dir="rtl"] .teamhead b { font-family: var(--font-display-ar); }
.agent-card {
  border: 1.5px solid var(--paper-dim); border-radius: 12px;
  background: #fff; padding: 15px 17px; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 15.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.agent-card .seat {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--brand);
  background: var(--paper-dim); border-radius: 6px; padding: 3px 7px;
}
.agent-card:hover {
  border-color: var(--orange); transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 36, 67, .14);
}
.addagent { margin-top: 20px; font-size: 13px; color: var(--ink-soft); }
.addagent button {
  background: none; border: none; color: var(--brand); cursor: pointer;
  font-weight: 600; font-size: 13px; padding: 0;
  border-bottom: 1px dashed var(--brand);
}

/* ── log page layout ──────────────────────────────────────────────────── */
.logwrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; }
@media (max-width: 980px) { .logwrap { grid-template-columns: 1fr; } }

.entryform { padding: 30px 30px 26px; animation: rise .5s .05s ease both; }
.entryform h3, .stub h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  margin: 4px 0 2px; letter-spacing: .02em;
}
.formhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.formhead .who { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand); }
.formhead .who b { color: var(--orange); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 18px; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

label.f { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
label.f .req { color: var(--orange); }
.reftag {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; letter-spacing: .08em; font-weight: 700;
  background: rgba(47, 84, 150, .12); color: var(--brand);
  border: 1px solid rgba(47, 84, 150, .3); text-transform: uppercase;
  animation: pop .15s ease both;
}
.reftag.phone { background: rgba(63, 174, 118, .12); color: #2c8a5c; border-color: rgba(63, 174, 118, .4); }
.entry-row .code small.rt { display: block; font-size: 10px; letter-spacing: .1em; color: var(--sky-dim); text-transform: uppercase; }
input[type=text], input[type=number], input[type=date], textarea {
  width: 100%; border: 1.5px solid var(--paper-dim); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: var(--font-body);
  font-size: 15px; padding: 11px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 84, 150, .14);
}
input.mono { font-family: var(--font-mono); letter-spacing: .04em; }

/* searchable action combobox */
.combo { position: relative; }
.combo input { padding-right: 40px; }
.combo .chev {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); pointer-events: none; font-size: 12px;
}
.combo-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1.5px solid var(--paper-dim); border-radius: 12px;
  max-height: 320px; overflow-y: auto;
  box-shadow: 0 24px 48px rgba(8, 18, 40, .25);
  display: none;
}
.combo-pop.open { display: block; animation: pop .14s ease both; }
.combo-pop .grp {
  position: sticky; top: 0; background: var(--paper);
  font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand); padding: 8px 14px 6px; border-bottom: 1px solid var(--paper-dim);
}
.combo-pop .opt {
  padding: 10px 14px; cursor: pointer; font-size: 14.5px; color: var(--ink);
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.combo-pop .opt small { color: var(--ink-soft); font-size: 11.5px; }
.combo-pop .opt:hover, .combo-pop .opt.hi { background: rgba(245, 130, 32, .1); }
.combo-pop .opt.hi { box-shadow: inset 3px 0 0 var(--orange); }
.combo-pop .none { padding: 16px 14px; color: var(--ink-soft); font-size: 14px; }

.btn {
  font-family: var(--font-display); font-weight: 600; font-size: 15.5px;
  letter-spacing: .04em; cursor: pointer; border: none; border-radius: 11px;
  padding: 13px 26px; transition: transform .14s, box-shadow .14s, background .14s;
}
.btn-primary {
  background: linear-gradient(180deg, var(--orange-hi), var(--orange));
  color: #24150a; box-shadow: 0 10px 26px rgba(245, 130, 32, .35);
}
.btn-primary:hover { transform: translateY(-1.5px); box-shadow: 0 14px 30px rgba(245, 130, 32, .45); }
.btn-ghost { background: var(--paper-dim); color: var(--ink); }
.btn-ghost:hover { background: #dce5f2; }
.formfoot { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.formfoot .msg { font-size: 13.5px; }
.formfoot .msg.ok { color: var(--ok); }
.formfoot .msg.err { color: var(--danger); }

/* ── day stub (right column) ──────────────────────────────────────────── */
.stub { padding: 24px 24px 20px; color: var(--ink); animation: rise .5s .12s ease both; }
.stub .bignum {
  font-family: var(--font-display); font-weight: 800; font-size: 54px;
  line-height: 1; color: var(--brand); margin: 8px 0 2px;
}
.stub .bignum .unit { font-size: 14px; letter-spacing: .2em; color: var(--ink-soft); }
.stub .barcode {
  margin-top: 16px; height: 42px; border-radius: 6px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 11px,
    var(--ink) 11px 14px, transparent 14px 17px);
  opacity: .85;
}
.stub .kwd { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); margin-top: 10px; }

/* ── entries list ─────────────────────────────────────────────────────── */
.entries { margin-top: 26px; display: grid; gap: 10px; }
.entry-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 16px;
  align-items: center;
  background: rgba(16, 37, 76, .66); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 18px;
  animation: rise .35s ease both;
}
.entry-row .code { font-family: var(--font-mono); font-size: 13.5px; color: var(--sky); }
.entry-row .code b { color: var(--orange-hi); font-weight: 600; }
.entry-row .what { min-width: 0; }
.entry-row .what .chip {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  background: rgba(47, 84, 150, .5); border: 1px solid rgba(189, 214, 238, .25);
  color: #fff; border-radius: 999px; padding: 3px 11px; margin-right: 8px;
}
.entry-row .what small { color: var(--sky-dim); font-size: 12.5px; }
.entry-row .kwd { font-family: var(--font-mono); font-size: 13.5px; color: var(--sky); white-space: nowrap; }
.entry-row .ops { display: flex; gap: 4px; }
.entry-row .ops button {
  background: none; border: none; cursor: pointer; color: var(--sky-dim);
  font-size: 14px; padding: 4px 6px; border-radius: 6px;
}
.entry-row .ops button:hover { color: var(--orange-hi); background: rgba(245,130,32,.12); }
.empty-day {
  text-align: center; color: var(--sky-dim); font-size: 14px;
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 30px;
}

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
  color: var(--sky-dim); margin: 30px 0 12px;
}

.backlink {
  background: none; border: none; cursor: pointer;
  color: var(--sky-dim); font-family: var(--font-body); font-size: 13.5px;
  padding: 0 0 14px; display: block;
  transition: color .14s;
}
.backlink:hover { color: var(--orange-hi); }
[dir="rtl"] .backlink { font-family: var(--font-body-ar); }

/* ── manager ──────────────────────────────────────────────────────────── */
.gate { max-width: 420px; margin: 14vh auto 0; padding: 40px 36px; text-align: center; }
.gate h2 { font-family: var(--font-display); font-weight: 800; margin: 10px 0 6px; color: var(--ink); }
.gate p { color: var(--ink-soft); font-size: 14px; margin: 0 0 20px; }
.gate input { text-align: center; font-family: var(--font-mono); font-size: 20px; letter-spacing: .3em; }
.gate .btn { width: 100%; margin-top: 14px; }
.gate .err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 24px; }
.toolbar .f { margin-bottom: 0; }
.toolbar input[type=date], .toolbar select {
  background: rgba(16,37,76,.66); border: 1.5px solid var(--line); color: var(--sky);
  color-scheme: dark; border-radius: 10px; font-family: var(--font-body);
  font-size: 15px; padding: 11px 13px; outline: none;
}
.toolbar select:focus, .toolbar input[type=date]:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 84, 150, .25);
}
.pillrow { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: rgba(16,37,76,.66); color: var(--sky-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px;
  transition: all .14s;
}
.pill:hover, .pill.on { color: #fff; border-color: var(--orange); }
.pill.on { background: rgba(245,130,32,.16); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.tile {
  background: rgba(16, 37, 76, .66); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px 16px;
  animation: rise .45s ease both;
}
.tile .k { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--sky-dim); }
.tile .v {
  font-family: var(--font-display); font-weight: 800; font-size: 38px;
  color: #fff; margin-top: 6px; line-height: 1;
}
.tile .v small { font-size: 15px; color: var(--sky-dim); font-weight: 400; }
.tile.accent { border-color: rgba(245, 130, 32, .5); }
.tile.accent .v { color: var(--orange-hi); }

.board { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line);
  background: rgba(10, 26, 56, .8); }
table.matrix { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14px; }
.matrix th, .matrix td { padding: 11px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.matrix thead th {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--sky-dim);
  background: rgba(16, 37, 76, .9); position: sticky; top: 0;
}
.matrix td.action, .matrix th.action { text-align: left; }
.matrix td.action { color: #fff; font-weight: 500; }
.matrix td.action small { display: block; color: var(--sky-dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.matrix td.num { font-family: var(--font-mono); color: var(--sky); }
.matrix td.num.zero { color: rgba(143, 176, 212, .3); }
.matrix td.tot, .matrix tr.totals td { font-family: var(--font-mono); font-weight: 600; color: var(--orange-hi); }
.matrix tr.totals td { border-top: 2px solid rgba(245, 130, 32, .4); background: rgba(245, 130, 32, .06); }
.matrix tbody tr:hover td { background: rgba(47, 84, 150, .18); }

.loglist { margin-top: 10px; }
.loglist table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.loglist th, .loglist td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.loglist th { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--sky-dim); padding-bottom: 9px; }
.loglist td { color: var(--sky); vertical-align: middle; }
.loglist .mono { font-family: var(--font-mono); font-size: 13px; }
.loglist tbody tr:not(.dayhead):hover td { background: rgba(47, 84, 150, .14); }

.loglist tr.dayhead td {
  background: linear-gradient(90deg, rgba(47, 84, 150, .3), rgba(47, 84, 150, .06));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 9px 18px;
}
.loglist tr.dayhead .d {
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: #fff;
}
.loglist tr.dayhead .d::before { content: "▸ "; color: var(--orange); }
.loglist tr.dayhead .meta {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--sky-dim);
  margin-inline-start: 14px;
}
.loglist .agentcell { white-space: nowrap; color: #fff; }
.loglist .avatar {
  display: inline-grid; place-items: center; width: 27px; height: 27px;
  border-radius: 50%; font-size: 10.5px; font-weight: 700; color: #fff;
  margin-inline-end: 9px; vertical-align: middle;
  font-family: var(--font-body); letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.loglist .logchip {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  background: rgba(47, 84, 150, .45); border: 1px solid rgba(189, 214, 238, .22);
  color: #fff; border-radius: 999px; padding: 4px 13px; white-space: nowrap;
}
.loglist .refcell { white-space: nowrap; }
.loglist .refpill {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; border-radius: 999px; padding: 2px 8px;
  margin-inline-start: 8px; vertical-align: 1px;
  background: rgba(47, 84, 150, .35); color: var(--sky-dim);
  border: 1px solid rgba(189, 214, 238, .2);
}
.loglist .refpill.phone { background: rgba(63, 174, 118, .18); color: #7fd4ab; border-color: rgba(63, 174, 118, .35); }
.loglist .sysref { color: var(--sky-dim); margin-inline-start: 8px; font-size: 12px; }
.loglist .kwdcell { color: var(--orange-hi); font-weight: 600; white-space: nowrap; }
.loglist .notecell { color: var(--sky-dim); font-size: 13px; max-width: 300px; }
.loglist .notecell .dash { opacity: .35; }

dialog {
  border: none; border-radius: var(--radius); padding: 28px 28px 24px;
  background: var(--paper); color: var(--ink); max-width: 400px; width: 92vw;
  box-shadow: 0 40px 90px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(5, 14, 32, .72); backdrop-filter: blur(3px); }
dialog h3 { font-family: var(--font-display); margin: 0 0 14px; }
dialog .row { margin-bottom: 12px; }
dialog .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ── manager gate: color-coded groups + inline password bars ──────────── */
:root { --role-manager: #2f5496; --role-sub: #d96f12; --role-acc: #0d8577; }

.gate-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; align-items: start;
}
.person { min-width: 0; }
.person .agent-card { width: 100%; }
.person.grp-manager .agent-card { border-inline-start: 4px solid var(--role-manager); }
.person.grp-sub .agent-card { border-inline-start: 4px solid var(--role-sub); }
.person.grp-acc .agent-card { border-inline-start: 4px solid var(--role-acc); }
.teamhead.grp-manager b, .teamhead.grp-manager b::before { color: var(--role-manager); }
.teamhead.grp-sub b, .teamhead.grp-sub b::before { color: var(--role-sub); }
.teamhead.grp-acc b, .teamhead.grp-acc b::before { color: var(--role-acc); }
.grp-manager .seat { background: rgba(47, 84, 150, .1); color: var(--role-manager); }
.grp-sub .seat { background: rgba(217, 111, 18, .1); color: var(--role-sub); }
.grp-acc .seat { background: rgba(13, 133, 119, .1); color: var(--role-acc); }
.person.open .agent-card {
  border-radius: 12px 12px 0 0; border-bottom-color: transparent;
  transform: none; box-shadow: none;
}
.person.grp-manager.open .agent-card { border-color: var(--role-manager); border-inline-start-width: 4px; }
.person.grp-sub.open .agent-card { border-color: var(--role-sub); border-inline-start-width: 4px; }
.person.grp-acc.open .agent-card { border-color: var(--role-acc); border-inline-start-width: 4px; }

.pinbar {
  background: #fff; border: 1.5px solid var(--paper-dim); border-top: none;
  border-radius: 0 0 12px 12px; padding: 13px 15px 12px;
  animation: pop .15s ease both;
}
.person.grp-manager.open .pinbar { border-color: var(--role-manager); border-top: none; }
.person.grp-sub.open .pinbar { border-color: var(--role-sub); border-top: none; }
.person.grp-acc.open .pinbar { border-color: var(--role-acc); border-top: none; }
.pb-title { font-weight: 700; color: var(--ink); margin: 0 0 3px; font-size: 13.5px; }
.pb-sub, .pb-hint { color: var(--ink-soft); font-size: 11.5px; margin: 0 0 8px; }
.pb-hint { margin: 6px 0 0; }
.pb-row { display: flex; gap: 8px; margin-top: 6px; }
.pb-pin {
  flex: 1; min-width: 0; text-align: center; letter-spacing: .25em; font-size: 17px;
}
.btn.pb-go { padding: 10px 16px; font-size: 13.5px; white-space: nowrap; }
.pb-err { color: var(--danger); font-size: 12px; min-height: 15px; margin-top: 4px; }
.members {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--paper-dim);
  font-size: 11.5px; color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
}
.memberchip {
  background: var(--paper-dim); border-radius: 999px; padding: 3px 10px;
  color: var(--ink); text-decoration: none; font-size: 11.5px; font-weight: 500;
  transition: background .13s;
}
.memberchip:hover { background: rgba(245, 130, 32, .18); }

.rolecell-manager { color: #9db9e8; font-weight: 600; }
.rolecell-sub { color: var(--orange-hi); font-weight: 600; }
.rolecell-acc { color: #5fc9bb; font-weight: 600; }

/* ── manager tabs (the three windows) ─────────────────────────────────── */
.tabs {
  display: flex; gap: 6px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.tab {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  background: none; border: none; cursor: pointer; color: var(--sky-dim);
  padding: 10px 20px 12px; border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: #fff; }
.tab.on { color: var(--orange-hi); border-bottom-color: var(--orange); }
[dir="rtl"] .tab { font-family: var(--font-display-ar); }

.ghostbtn {
  background: rgba(47, 84, 150, .35); border: 1px solid rgba(189, 214, 238, .25);
  color: var(--sky); border-radius: 8px; padding: 6px 14px; cursor: pointer;
  font-size: 12.5px; font-family: inherit; transition: all .14s;
}
.ghostbtn:hover { border-color: var(--orange); color: var(--orange-hi); }
.dangerbtn {
  background: rgba(229, 83, 61, .12); border: 1px solid rgba(229, 83, 61, .4);
  color: #f08a7a; border-radius: 8px; padding: 6px 14px; cursor: pointer;
  font-size: 12.5px; font-family: inherit; margin-inline-start: 6px;
}
.dangerbtn:hover { background: rgba(229, 83, 61, .25); }

/* ── edited-row highlights: purple = accountant, cyan = agent late edit ── */
.loglist tr.edited-agent td { background: rgba(56, 168, 201, .12); }
.loglist tr.edited-agent td:first-child { box-shadow: inset 3px 0 0 #38a8c9; }
.loglist tr.edited-agent:hover td { background: rgba(56, 168, 201, .19) !important; }
.loglist tr.edited-acc td { background: rgba(142, 108, 199, .13); }
.loglist tr.edited-acc td:first-child { box-shadow: inset 3px 0 0 #8e6cc7; }
.loglist tr.edited-acc:hover td { background: rgba(142, 108, 199, .2) !important; }
.editpill {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  background: rgba(142, 108, 199, .22); color: #c9b3ec;
  border: 1px solid rgba(142, 108, 199, .5); border-radius: 999px;
  padding: 2px 9px; margin-inline-start: 8px; vertical-align: 1px;
}
.editpill.agentpill {
  background: rgba(56, 168, 201, .16); color: #9adef0;
  border-color: rgba(56, 168, 201, .5);
}
/* agent's own day list */
.entry-row.edited-agent { border-color: rgba(56, 168, 201, .5); background: rgba(56, 168, 201, .1); }
.entry-row.edited-acc { border-color: rgba(142, 108, 199, .55); background: rgba(142, 108, 199, .13); }

/* duplicate reference (possible double claim) — red, wins over other tints */
.loglist tr.dup-ref td { background: rgba(229, 83, 61, .13); }
.loglist tr.dup-ref td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.loglist tr.dup-ref:hover td { background: rgba(229, 83, 61, .2) !important; }
.refpill.duppill {
  background: rgba(229, 83, 61, .18); color: #f5a094;
  border-color: rgba(229, 83, 61, .55); font-weight: 700;
}
.pill.dup-pill { color: #f5a094; border-color: rgba(229, 83, 61, .45); }
.pill.dup-pill.on {
  background: rgba(229, 83, 61, .18); color: #ffb7ac;
  border-color: var(--danger);
}
.rowedit {
  background: rgba(47, 84, 150, .35); border: 1px solid rgba(189, 214, 238, .25);
  color: var(--sky); border-radius: 8px; padding: 5px 11px; cursor: pointer;
  font-size: 13px; transition: all .14s;
}
.rowedit:hover { border-color: var(--orange); color: var(--orange-hi); }

/* ── scope badge ──────────────────────────────────────────────────────── */
.scopebadge {
  display: inline-block; font-size: 12px; font-weight: 700;
  background: rgba(245, 130, 32, .14); color: var(--orange-hi);
  border: 1px solid rgba(245, 130, 32, .4); border-radius: 999px;
  padding: 6px 15px; line-height: 1;
}

/* ── language button ──────────────────────────────────────────────────── */
.langbtn {
  color: var(--orange-hi) !important; font-weight: 700 !important;
  border-color: rgba(245, 130, 32, .4) !important;
}
.langbtn:hover { color: #fff !important; border-color: var(--orange) !important; }

/* ── RTL (Arabic) — Cairo for headings, Tajawal for text ──────────────── */
[dir="rtl"] body, [dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] select,
[dir="rtl"] .btn, [dir="rtl"] .pill, [dir="rtl"] .agent-card {
  font-family: var(--font-body-ar);
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] .checkin h2, [dir="rtl"] .entryform h3, [dir="rtl"] .stub h3,
[dir="rtl"] .gate h2, [dir="rtl"] dialog h3,
[dir="rtl"] .stub .bignum, [dir="rtl"] .tile .v, [dir="rtl"] .btn {
  font-family: var(--font-display-ar); font-weight: 700;
}
[dir="rtl"] .checkin h2, [dir="rtl"] .gate h2 { font-weight: 800; font-size: 25px; }
[dir="rtl"] .tagline { letter-spacing: 0; font-weight: 500; font-size: 13.5px; }
[dir="rtl"] .section-label { letter-spacing: 0; font-weight: 700; font-size: 13px; }
[dir="rtl"] label.f { letter-spacing: 0; font-weight: 700; font-size: 12.5px; }
[dir="rtl"] .tile .k { letter-spacing: 0; font-weight: 500; font-size: 12px; }
[dir="rtl"] .stub .bignum .unit { letter-spacing: 0; font-size: 15px; font-weight: 500; }
[dir="rtl"] .entry-row .what .chip { font-family: var(--font-body-ar); font-weight: 500; font-size: 13px; }
[dir="rtl"] .combo-pop .grp { letter-spacing: 0; font-size: 12px; }
[dir="rtl"] .combo-pop .opt { font-size: 15px; }
[dir="rtl"] .checkin p.sub, [dir="rtl"] .gate p { font-size: 15px; }
[dir="rtl"] input[type=text], [dir="rtl"] textarea { font-size: 15.5px; }
[dir="rtl"] .entry-row .code small.rt, [dir="rtl"] .reftag { letter-spacing: 0; font-size: 11px; }
[dir="rtl"] .matrix td.action small { letter-spacing: 0; font-size: 11.5px; }
[dir="rtl"] .matrix thead th, [dir="rtl"] .loglist th { font-family: var(--font-body-ar); letter-spacing: 0; font-size: 12.5px; font-weight: 700; }
[dir="rtl"] .stub .kwd, [dir="rtl"] .formhead .who { font-family: var(--font-body-ar); }
[dir="rtl"] .mast-side { text-align: left; }
[dir="rtl"] .combo .chev { right: auto; left: 13px; }
[dir="rtl"] .combo input { padding-right: 13px; padding-left: 40px; }
[dir="rtl"] .combo-pop .opt.hi { box-shadow: inset -3px 0 0 var(--orange); }
[dir="rtl"] .agent-card { text-align: right; }
[dir="rtl"] .matrix td.action, [dir="rtl"] .matrix th.action { text-align: right; }
[dir="rtl"] .loglist th, [dir="rtl"] .loglist td { text-align: right; }
/* keep codes, dates and amounts left-to-right inside RTL layout */
[dir="rtl"] .mono, [dir="rtl"] .entry-row .code, [dir="rtl"] .entry-row .kwd,
[dir="rtl"] .stub .kwd, [dir="rtl"] .dateline, [dir="rtl"] .loglist td.mono,
[dir="rtl"] .matrix td.num, [dir="rtl"] .matrix td.tot {
  direction: ltr; unicode-bidi: isolate;
}
[dir="rtl"] .formhead .who { direction: ltr; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }
