/* VouchShare AI HQ — same brand tokens as the apps / CMS (design_specifications.md). */
:root {
  --blue: #1E38C9; --blue-deep: #152A9E; --tint: #E7EBFB; --cyan: #44EFE5; --coral: #F97360;
  --amber: #F5A524; --red: #E5484D; --green: #148B46;
  --bg: #F6F7FB; --surface: #FFFFFF; --surface-2: #F1F3FA; --border: #E3E6EF;
  --text: #1F2937; --muted: #6B7280; --on-blue: #FFFFFF;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 8px 24px rgba(17, 24, 39, .06);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
  --arabic: "Tajawal", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue: #7B93FF; --blue-deep: #5A72E6; --tint: #1F2A5C; --on-blue: #0B1A66;
    --bg: #0E1016; --surface: #171A23; --surface-2: #1E2230; --border: #2A2F3D;
    --text: #E8E9EE; --muted: #9AA0AE;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
       -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.ar { font-family: var(--arabic); direction: rtl; text-align: right; }

/* ---------- buttons, inputs ---------- */
.btn { font: 600 14px var(--font); border-radius: 999px; padding: 10px 18px; border: 1px solid transparent;
       cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-deep); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-approve { background: var(--green); color: #fff; }
.btn-reject { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.btn-revise { background: transparent; color: var(--text); border-color: var(--border); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, .desk:focus-visible
  { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }
input, textarea { font: 15px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border);
                  border-radius: 12px; padding: 11px 14px; width: 100%; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 12px 24px;
          background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
          border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand > span { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font: 700 17px var(--display); }
.brand-sub { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 14px;
          border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.active { color: var(--on-blue); background: var(--blue); }
.count { background: var(--coral); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; min-width: 20px;
         text-align: center; line-height: 20px; }
.tabs a.active .count { background: #fff; color: var(--blue); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.topbar-right form { margin: 0; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 24px 40px; }

/* ---------- office ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 16px; min-width: 120px; }
.stat b { display: block; font: 700 22px var(--display); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.hot b { color: var(--coral); }

.directive { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border);
             border-radius: 999px; padding: 6px 6px 6px 8px; box-shadow: var(--shadow); margin-bottom: 26px; }
.directive img { border-radius: 50%; flex: none; }
.directive input { border: 0; background: transparent; padding: 10px 4px; }
.directive input:focus-visible { outline: none; }

.role { display: inline-block; font-size: 12px; font-weight: 600; color: var(--blue); background: var(--tint);
        border-radius: 999px; padding: 2px 10px; }

/* virtual office: rooms */
.floor { position: relative; display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr));
         grid-template-areas: "ceo ceo ceo" "studio studio studio" "numbers server scout";
         padding: 22px; border-radius: 28px; border: 1px solid var(--border);
         background:
           radial-gradient(700px 320px at 50% 0%, color-mix(in srgb, var(--blue) 9%, transparent), transparent 70%),
           repeating-linear-gradient(0deg, transparent 0 39px, color-mix(in srgb, var(--border) 55%, transparent) 39px 40px),
           repeating-linear-gradient(90deg, transparent 0 39px, color-mix(in srgb, var(--border) 55%, transparent) 39px 40px),
           var(--surface-2); }
.room { --room: var(--blue); position: relative; border-radius: 22px; padding: 14px 14px 16px; min-width: 0;
        background:
          radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--room) 22%, transparent) 1px, transparent 1.5px) 0 0 / 18px 18px,
          color-mix(in srgb, var(--room) 7%, var(--surface));
        border: 1px solid color-mix(in srgb, var(--room) 22%, var(--border)); }
.room-ceo { grid-area: ceo; --room: #1E38C9; }
.room-studio { grid-area: studio; --room: #F97360; }
.room-numbers { grid-area: numbers; --room: #148B46; }
.room-server { grid-area: server; --room: #475569; }
.room-scout { grid-area: scout; --room: #0FB5AA; }
.room-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.room-head > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.room-head b { font: 700 15px var(--display); }
.room-head small { color: var(--muted); font-size: 12px; }
.room-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
             color: var(--room); background: color-mix(in srgb, var(--room) 14%, var(--surface)); }
.room-occ { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface);
            border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.room-floor { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: stretch; }

.station { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
           width: 220px; max-width: 100%; padding: 58px 14px 14px; margin-top: 4px; cursor: pointer;
           font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
           box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.station:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(17,24,39,.06), 0 14px 32px rgba(17,24,39,.12); }
.station:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }
.station .name { font: 700 16px var(--display); display: flex; gap: 6px; align-items: baseline; justify-content: center; flex-wrap: wrap; }
.station .name .ar { font: 700 17px var(--arabic); direction: rtl; }
.station .name .sep { color: var(--muted); font-weight: 500; }
.station .role { margin-top: 0; }
.station-meta { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 12px; margin-top: 2px; }
.bubble { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 2;
          font-size: 12.5px; font-weight: 600; line-height: 1.3; padding: 7px 10px; border-radius: 12px;
          background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble::after { content: ""; position: absolute; bottom: -6px; left: 50%; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg);
                 background: inherit; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.bubble.working { background: color-mix(in srgb, var(--cyan) 16%, var(--surface)); color: var(--text); border-color: color-mix(in srgb, var(--cyan) 50%, var(--border)); }
.bubble.waiting_owner { background: color-mix(in srgb, var(--coral) 14%, var(--surface)); color: var(--text); border-color: color-mix(in srgb, var(--coral) 45%, var(--border)); }
.bubble.in_review { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); color: var(--text); border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.bubble.alert { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.station .avatar { margin-top: 8px; }

.whiteboard { width: 300px; max-width: 100%; align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px;
              background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
              background-image: repeating-linear-gradient(180deg, transparent 0 27px, color-mix(in srgb, var(--blue) 10%, transparent) 27px 28px); }
.wb-label { font: 700 11px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wb-text { font: 600 16px/1.45 var(--display); flex: 1; }
.wb-inbox { align-self: flex-start; text-decoration: none; font-weight: 700; font-size: 13px; color: var(--green);
            background: color-mix(in srgb, var(--green) 12%, var(--surface)); border-radius: 999px; padding: 5px 12px; }
.wb-inbox.hot { color: #fff; background: var(--coral); }

/* handoff lines */
.floor-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; }
.stop-a { stop-color: var(--blue); } .stop-b { stop-color: var(--cyan); }
.handoff-path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 9; animation: dash 0.9s linear infinite; }
.handoff-dot { fill: var(--cyan); stroke: var(--surface); stroke-width: 2.5; filter: drop-shadow(0 0 4px var(--cyan)); }
@keyframes dash { to { stroke-dashoffset: -11; } }
@media (prefers-reduced-motion: reduce) { .handoff-path { animation: none; } .handoff-dot { display: none; } }
.handoff-strip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.strip-label { font: 700 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.strip-item { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 4px; }
.strip-item img { width: 22px; height: 22px; border-radius: 50%; }
.strip-item .arrow { color: var(--blue); font-weight: 700; }

/* campaign board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.lane { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 12px; min-width: 0; }
.lane-waiting { background: color-mix(in srgb, var(--coral) 7%, var(--surface-2)); border-color: color-mix(in srgb, var(--coral) 30%, var(--border)); }
.lane-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 12px; }
.lane-head > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.lane-head b { font: 700 14.5px var(--display); }
.lane-head small { font-size: 11.5px; color: var(--muted); }
.lane-head img { width: 28px; height: 28px; border-radius: 50%; }
.lane-step { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--display);
             background: var(--blue); color: var(--on-blue); flex: none; }
.lane-you { font: 700 11px var(--font); background: var(--tint); color: var(--blue); border-radius: 999px; padding: 4px 8px; }
.lane-count { font: 700 12px var(--font); color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.lane-cards { display: grid; gap: 10px; }
.lane-empty { margin: 0; padding: 18px 8px; text-align: center; color: var(--muted); font-size: 13px; border: 1.5px dashed var(--border); border-radius: 14px; }
.ccard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
         text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s ease; }
a.ccard:hover { transform: translateY(-2px); }
.cc-thumb { aspect-ratio: 4 / 3; background: var(--tint); overflow: hidden; }
.cc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.cc-placeholder { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 14px; color: #fff;
                  background: linear-gradient(150deg, #1E38C9, #152A9E); font: 700 15px var(--display); }
.cc-placeholder .ar { font: 700 20px var(--arabic); }
.cc-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; min-width: 0; }
.cc-title { font: 700 14.5px var(--display); }
.cc-title-ar { font: 700 15px var(--arabic); color: var(--muted); }
.cc-meta { font-size: 12.5px; color: var(--muted); }
.cc-body .chips { margin-top: 4px; }
.cc-body .chip { font-size: 11px; padding: 1px 8px; }
.cc-flag { align-self: flex-start; font: 700 11px var(--font); border-radius: 6px; padding: 2px 7px; }
.cc-flag.revision { background: color-mix(in srgb, var(--amber) 18%, var(--surface)); color: #A16207; }
.cc-flag.rejected { background: color-mix(in srgb, var(--red) 14%, var(--surface)); color: var(--red); }
.cc-posts { display: flex; gap: 5px; margin-top: 6px; }
.post-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--font); color: #fff; background: #A3A9B7; }
.post-dot.pending { background: var(--coral); } .post-dot.approved, .post-dot.executed { background: var(--green); }
.post-dot.revision { background: var(--amber); } .post-dot.rejected { background: var(--red); }

/* content calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 34px 0 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.cal-nav #calRange { min-width: 120px; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-day.today { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 25%, transparent); }
.cal-day.past { opacity: .6; }
.cal-date { font: 700 12.5px var(--font); color: var(--muted); }
.cal-day.today .cal-date { color: var(--blue); }
.cal-post { display: flex; gap: 6px; align-items: center; text-decoration: none; color: inherit; border-radius: 10px; padding: 5px;
            background: var(--surface-2); border-left: 3px solid #A3A9B7; min-width: 0; }
.cal-post.pending { border-left-color: var(--coral); } .cal-post.approved, .cal-post.executed { border-left-color: var(--green); }
.cal-post.revision { border-left-color: var(--amber); }
.cal-post img, .cal-noimg { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; object-position: top; flex: none; background: var(--tint); }
.cal-post-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 11.5px; min-width: 0; }
.cal-post-text b { font-size: 12px; }
.cal-status { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unsched { margin-top: 10px; font-size: 13px; }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px;
        background: var(--surface-2); color: var(--muted); }
.pill .dot { width: 8px; height: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #A3A9B7; }
.dot.working { background: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 30%, transparent); }
.dot.waiting_owner { background: var(--coral); }
.dot.in_review { background: var(--amber); }
.dot.alert { background: var(--red); }
.pill.working { color: #0B7F78; background: color-mix(in srgb, var(--cyan) 18%, var(--surface)); }
.pill.waiting_owner { color: #C2410C; background: color-mix(in srgb, var(--coral) 16%, var(--surface)); }
.pill.in_review { color: #A16207; background: color-mix(in srgb, var(--amber) 16%, var(--surface)); }
.pill.alert { color: var(--red); background: color-mix(in srgb, var(--red) 14%, var(--surface)); }
@media (prefers-color-scheme: dark) {
  .pill.working { color: var(--cyan); } .pill.waiting_owner { color: #FDBA74; } .pill.in_review { color: #FCD34D; }
}

/* avatar + live status aura */
.avatar { position: relative; width: 84px; height: 84px; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; position: relative; z-index: 1; }
.avatar::before, .avatar::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.avatar::before { border: 3px solid transparent; }
.avatar.idle::before { border-color: var(--border); }
.avatar.working::before { border-color: var(--cyan); border-right-color: transparent; border-bottom-color: color-mix(in srgb, var(--cyan) 35%, transparent);
                          animation: spin 2.4s linear infinite; }
.avatar.working::after { background: radial-gradient(closest-side, color-mix(in srgb, var(--cyan) 45%, transparent), transparent); animation: breathe 2.4s ease-in-out infinite; }
.avatar.waiting_owner::before { border-color: var(--coral); animation: pulse-ring 1.8s ease-out infinite; }
.avatar.in_review::before { border-color: var(--amber); border-style: dashed; animation: spin 6s linear infinite; }
.avatar.alert::before { border-color: var(--red); animation: blink 1s steps(2, start) infinite; }
.avatar.alert::after { background: radial-gradient(closest-side, color-mix(in srgb, var(--red) 40%, transparent), transparent); animation: breathe 1s ease-in-out infinite; }
.avatar.lg { width: 112px; height: 112px; }
.avatar.sm { width: 36px; height: 36px; }
.avatar.sm::before { inset: -3px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: .25; transform: scale(1); } 50% { opacity: .7; transform: scale(1.08); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--coral) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes blink { to { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .avatar::before, .avatar::after { animation: none !important; } }

.legend { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- sections ---------- */
.section-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.subhead { margin: 34px 0 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty b { display: block; font: 700 18px var(--display); color: var(--text); margin-bottom: 4px; }

/* approvals */
.approval-list { display: grid; gap: 16px; }
.approval { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
.approval.no-preview { grid-template-columns: 1fr; }
.approval .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); background: var(--tint);
        border-radius: 8px; padding: 3px 8px; }
.approval h3 { font-size: 18px; margin-bottom: 4px; }
.approval .from { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.approval .from img { width: 24px; height: 24px; border-radius: 50%; }
.payload { margin-top: 12px; display: grid; gap: 10px; }
.caption { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; }
.caption small { display: block; font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; direction: ltr; text-align: left; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; }
.facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.facts b { color: var(--text); font-weight: 600; }
.preview { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); align-self: start; }
.preview img { width: 100%; display: block; }
pre.diff, pre.json { background: #0F1220; color: #D7DAE5; border-radius: 12px; padding: 14px; overflow: auto; max-height: 420px;
                     font: 12.5px/1.5 "JetBrains Mono", ui-monospace, Menlo, monospace; margin: 0; }
pre.diff .add { color: #7EE2A8; } pre.diff .del { color: #FF8F8F; } pre.diff .hunk { color: #8FA8FF; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.actions textarea { flex-basis: 100%; min-height: 70px; }
.decision-list { display: grid; gap: 8px; }
.decision { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.decision .st { margin-left: auto; font-weight: 600; font-size: 12px; text-transform: capitalize; }
.st.approved, .st.executed { color: var(--green); } .st.rejected { color: var(--red); } .st.revision { color: var(--amber); }

/* briefing */
.date-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.date-chips button { font: 600 13px var(--font); border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.date-chips button.active { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--tint); opacity: .7; }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 600; position: relative; z-index: 1; }
.kpi .value { font: 700 26px var(--display); margin-top: 4px; position: relative; z-index: 1; overflow-wrap: anywhere; }
.kpi .value small { font: 600 13px var(--font); color: var(--muted); margin-left: 4px; }
.kpi .by { font-size: 12px; color: var(--muted); margin-top: 2px; position: relative; z-index: 1; }
.kpi.good .value { color: var(--green); } .kpi.bad .value { color: var(--red); }
.prose h1 { font-size: 24px; margin: 0 0 12px; } .prose h2 { font-size: 18px; margin: 22px 0 8px; color: var(--blue); }
.prose table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.prose th { background: var(--tint); color: var(--blue-deep); }
@media (prefers-color-scheme: dark) { .prose th { color: var(--text); } }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.prose pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow: auto; }
.prose li { margin: 4px 0; }

/* activity timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.day { font: 700 12px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.event { display: grid; grid-template-columns: 68px 40px 1fr; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 14px; }
.event:hover { background: var(--surface); }
.event time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); padding-top: 8px; text-align: right; }
.event .body { padding-top: 2px; min-width: 0; overflow-wrap: anywhere; }
.event .line { font-size: 14.5px; }
.event .chain { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin-right: 6px; }
.event .chain .arrow { color: var(--blue); }
.event .kindtag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.event.alert .line { color: var(--red); }
.sys-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--blue); font: 700 14px var(--display); }

/* drawer (workstation) */
.drawer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.drawer.open { pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 30, .45); opacity: 0; transition: opacity .2s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(620px, 100%); background: var(--bg); overflow-y: auto;
                transform: translateX(100%); transition: transform .25s ease; padding: 28px; box-shadow: -10px 0 40px rgba(0,0,0,.18); }
.drawer.open .drawer-panel { transform: none; }
/* Hide the closed panel completely (otherwise its shadow peeks in at the right edge). */
.drawer:not(.open) .drawer-panel { visibility: hidden; box-shadow: none; transition: transform .25s ease, visibility 0s .25s; }
.drawer-close { position: absolute; top: 14px; right: 16px; font-size: 28px; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }
.ws-head { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.ws-head .name { font: 700 24px var(--display); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ws-head .name .ar { font-family: var(--arabic); }
.ws-grid { display: grid; gap: 14px; }
.ws-block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; font-family: var(--font); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.list li .sub { color: var(--muted); font-size: 12px; white-space: nowrap; }
.deliverables { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.deliv { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.deliv .thumb { aspect-ratio: 1; background: var(--tint); display: grid; place-items: center; color: var(--blue); font: 700 13px var(--display); text-transform: uppercase; letter-spacing: .06em; }
.deliv .thumb img { width: 100%; height: 100%; object-fit: cover; }
.deliv .t { font-size: 12.5px; padding: 8px 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.sop { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 16px; }
details.sop summary { cursor: pointer; font-weight: 700; padding: 10px 0; }

/* footer, toast */
.footbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 24px; font-size: 13px;
           border-top: 1px solid var(--border); background: var(--surface); }
.meter { display: inline-block; width: 120px; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; vertical-align: middle; margin: 0 8px; }
.meter i { display: block; height: 100%; background: var(--blue); }
.meter.hot i { background: var(--coral); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); background: #111827; color: #fff; padding: 12px 18px;
         border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; transition: all .25s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* login */
.login-page { display: grid; place-items: center; padding: 24px;
              background: radial-gradient(800px 500px at 80% -10%, color-mix(in srgb, var(--cyan) 25%, transparent), transparent 60%),
                          radial-gradient(700px 500px at 0% 110%, color-mix(in srgb, var(--coral) 18%, transparent), transparent 60%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { margin: 22px 0 4px; }
.login-card form { display: grid; gap: 14px; margin-top: 20px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.login-card .btn { justify-content: center; padding: 12px; margin-top: 4px; }
.login-brand { display: flex; gap: 12px; align-items: center; }
.login-brand > div { display: flex; flex-direction: column; line-height: 1.15; }
.login-error { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); border-radius: 12px; padding: 10px 12px; margin: 14px 0 0; font-size: 14px; }
.login-team { display: flex; justify-content: center; margin-top: 26px; }
.login-team img { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--surface); margin-left: -8px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .floor { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "ceo ceo" "studio studio" "numbers server" "scout scout"; padding: 16px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar { grid-template-columns: repeat(7, 150px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cal-day { scroll-snap-align: start; }
  .approval { grid-template-columns: 1fr; }
  .preview { max-width: 360px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .topbar .brand-sub, .clock { display: none; }
  .tabs { order: 3; width: 100%; margin: 0 -4px; }
  main { padding: 20px 16px 32px; }
  h1 { font-size: 24px; }
  .floor { grid-template-columns: 1fr; grid-template-areas: "ceo" "studio" "numbers" "server" "scout"; padding: 10px; border-radius: 20px; gap: 12px; }
  .room { padding: 12px; }
  .station { width: 100%; padding-top: 54px; }
  .floor-lines { display: none; }   /* stacked rooms: the "Latest handoffs" strip shows the chain instead */
  .whiteboard { width: 100%; }
  .avatar { width: 68px; height: 68px; }
  .board { grid-template-columns: repeat(4, 82%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .lane { scroll-snap-align: start; }
  .directive { border-radius: 18px; flex-wrap: wrap; padding: 10px; }
  .directive img { display: none; }
  .directive .btn { width: 100%; justify-content: center; }
  .event { grid-template-columns: 56px 36px 1fr; gap: 8px; padding: 8px 4px; }
  .drawer-panel { padding: 22px 16px; }
  .footbar { padding: 12px 16px; }
}
