/* ---------- Company font: Merel ----------
   Merel is a commercial typeface (Inhouse Type / Adobe Fonts). The @font-face rules below
   are wired and waiting: drop the licensed Merel-*.woff2 files into public/fonts/ and every
   page and printed document picks them up at once — no other change anywhere. Until those
   files exist the browser cannot fetch them and falls back down the stack in --font, which
   is why the portal currently renders in the system face.

   If the licence comes as an Adobe Fonts web project instead of files, add the <link> Adobe
   gives you to each page's <head> and delete the four blocks below; "Merel" in --font then
   resolves through Adobe.

   font-display: swap means text is never invisible while a face loads. */
@font-face {
  font-family: "Merel"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/Merel-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Merel"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/Merel-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Merel"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/Merel-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Merel"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/fonts/Merel-Italic.woff2") format("woff2");
}

:root {
  --navy:        #16237a;
  --royal:       #3a63b8;
  --bright:      #1e7fd0;
  --ink:         #1b2433;
  --muted:       #6b7689;
  --line:        #e2e7f0;
  --bg-1:        #eef2fb;
  --bg-2:        #dde6f7;
  --white:       #ffffff;
  --danger:      #c0392b;
  --danger-bg:   #fdecea;
  --shadow:      0 18px 50px rgba(22, 35, 122, 0.18);
  --radius:      16px;
  --font: "Merel", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Traditional Arabic", sans-serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win, even over rules like display:flex
   (otherwise hidden modals/forms stay visible). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
}

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-2), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, #ffffff 55%, var(--bg-1) 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px 28px;
  animation: rise 0.4s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.brand-logo {
  width: 220px;
  max-width: 80%;
  height: auto;
}

.login-title {
  text-align: center;
  margin: 4px 0 2px;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.2px;
}

.login-subtitle {
  text-align: center;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fbfcfe;
}

.field input:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(58, 99, 184, 0.15);
  background: var(--white);
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.password-wrap { position: relative; }

.password-wrap input { padding-right: 64px; }

.toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--bright);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.toggle-pw:hover { background: var(--bg-1); }

.btn-primary {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--navy), var(--bright));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.05s, filter 0.15s, opacity 0.15s;
  letter-spacing: 0.3px;
}

.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-banner {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f5c6c2;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Confirmation counterpart of .error-banner (e.g. "reset link sent"). */
.success-banner {
  background: #eaf7ee;
  color: #1e7a45;
  border: 1px solid #c2e6cf;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 16px;
}

.success-banner .hint { color: #1e7a45; }

/* Secondary links under a login-card form ("Forgot password?", "Back to sign in"). */
.login-links {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
}

.login-links a {
  color: var(--bright);
  font-weight: 600;
  text-decoration: none;
}

.login-links a:hover { text-decoration: underline; }

/* .btn-primary rendered as an <a> (it is a <button> everywhere else). */
.btn-primary.btn-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* Vendor business & bank details in the contact form */
.vendor-fields {
  margin: 6px 0 4px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}
.vendor-fields legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--ink); }
.vendor-fields .muted { font-weight: 400; }
.vendor-docs { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.vendor-docs-head { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.vendor-docs-hint { font-size: 12px; margin: 10px 0 0; }
.doc-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-list li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 13px;
}
.doc-list .doc-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--royal);
  background: #eef2fb; border-radius: 5px; padding: 2px 6px; font-weight: 600; }
.doc-list .doc-fname { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list .doc-empty { color: var(--muted); font-style: italic; border: none; background: none; padding: 0; }
.doc-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-upload-row select, .doc-upload-row input[type="file"] { font-size: 13px; }
.bc-line .bc-doc-link { margin-right: 10px; }

/* ---------- To-Do List ---------- */
.todo-section { margin-top: 22px; }
.todo-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 10px; background: var(--white);
}
/* Urgent outranks High at a glance: a solid red edge and a filled badge, against High's
   lighter amber. Normal and Low carry no edge at all. */
.todo-item.prio-urgent { border-left-color: var(--danger); background: #fffafa; }
.todo-item.prio-high { border-left-color: #d97706; }
.todo-item.is-done { background: #f6f8fc; opacity: 0.75; }
.todo-check { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; cursor: pointer; font-weight: 400; }
.todo-check input { width: 18px; height: 18px; flex: none; }
.todo-text { font-size: 15px; color: var(--ink); }
.is-done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-prio { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 2px 8px; border-radius: 999px; }
.todo-prio.prio-urgent { background: var(--danger); color: #fff; }
.todo-prio.prio-high { background: #fff3d6; color: #b45309; }
.todo-prio.prio-low { background: #eef2f7; color: var(--muted); }
.todo-due { font-size: 12px; font-weight: 600; color: var(--muted); background: #eef2fb; border-radius: 6px; padding: 2px 8px; }
.todo-due.due-today { background: #fff3d6; color: #a16207; }
.todo-due.due-overdue { background: var(--danger-bg); color: var(--danger); }
.todo-assign { font-size: 12px; color: var(--muted); font-style: italic; }
.todo-actions { display: flex; gap: 6px; margin-left: auto; }
.todo-done .todo-item .todo-prio { display: none; }

/* Site-wide copyright footer (author owns the IP) */
.app-footer {
  margin: 40px auto 20px;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.app-footer a { color: inherit; text-decoration: none; }
@media print { .app-footer { display: none !important; } }

/* ---------- Dashboard ---------- */
.app-page { background: var(--bg-1); min-height: 100vh; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}

.topbar img { height: 40px; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip { text-align: right; line-height: 1.25; }
.user-chip .name { font-weight: 600; font-size: 14px; color: var(--ink); }
.user-chip .role { font-size: 12px; color: var(--bright); font-weight: 600; }

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--bg-1); }

.container { max-width: 1320px; margin: 0 auto; padding: 32px 24px; }

.welcome-h {
  font-size: 24px;
  color: var(--navy);
  margin: 0 0 4px;
}
.welcome-sub { color: var(--muted); margin: 0 0 28px; }

/* ---------- Function tiles (coloured squares) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  color: #fff;
  background: var(--tile-color, var(--royal));
  background-image: linear-gradient(150deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.14));
  box-shadow: 0 10px 24px rgba(22, 35, 122, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(22, 35, 122, 0.26);
  filter: brightness(1.05);
}
.tile:active { transform: translateY(-1px); }
.tile:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; }

.tile-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.tile-tags {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.9;
}

/* Count badge (e.g. Payments awaiting the CEO/DCEO) shown on a tile. */
.tile-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  background: #e11d48;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

/* Voided payment voucher banner. */
.void-banner { background: #fdecec; border: 1px solid #e0a3a3; color: #b00; font-weight: 800; letter-spacing: 1px;
  text-align: center; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }

/* Payment-voucher line total under the items editor. */
.pv-total-row { margin-top: 8px; text-align: right; font-size: 14px; }
.pv-total-row strong { color: var(--navy); }

/* HR landing cards */
.hr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.hr-card { display: flex; flex-direction: column; gap: 6px; padding: 20px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--white); text-decoration: none; color: var(--ink);
  border-left: 6px solid var(--c, #2c3e8f); box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
a.hr-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,45,.12); }
.hr-card-title { font-size: 17px; font-weight: 800; color: var(--navy); }
.hr-card-sub { font-size: 12.5px; color: var(--muted); }
.hr-card-soon { opacity: .6; cursor: default; }

/* Onboarding checklist */
.onb-req { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px; background: #fbfcfe; }
.onb-req .req-label { flex: 1; font-weight: 600; font-size: 13px; }
.onb-req a.req-link { color: var(--royal); text-decoration: none; }
.onb-req a.req-link:hover { text-decoration: underline; }
.onb-req .req-status { font-size: 12px; }
.onb-ok { color: #1a8a4f; font-weight: 700; }
.onb-miss { color: #b45309; font-weight: 700; }
.onb-na { color: #6b7689; font-weight: 700; }
.onb-actions { display: flex; gap: 6px; align-items: center; }
.onb-group-head { margin: 12px 0 6px; font-size: 13px; color: var(--navy); border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.forms-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.token-ref { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #f0f3f9; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; color: #33507e; line-height: 1.9; }
.token-ref code { background: #dfe7f5; border-radius: 4px; padding: 1px 5px; cursor: pointer; }
.form-tmpl textarea { width: 100%; min-height: 220px; font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; resize: vertical; line-height: 1.6; }
.tmpl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tmpl-cols label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--navy); }
@media (max-width: 720px) { .tmpl-cols { grid-template-columns: 1fr; } }

/* Search bar (e.g. Outgoing Register). */
.filter-row { margin: 14px 0 10px; }
.search-input {
  width: 100%; max-width: 420px; font-size: 14px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--royal, #2a6db0); }

.empty-state {
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Topbar extras ---------- */
.topbar-brand { display: inline-flex; }
/* Professional breadcrumb trail (replaces the old single back-link) */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  margin: 0 0 20px; font-size: 15px; font-weight: 600; line-height: 1.4;
}
.breadcrumb a {
  color: var(--royal); text-decoration: none; padding: 5px 9px; border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.breadcrumb a:first-child::before { content: "←"; margin-right: 7px; font-weight: 800; }
.breadcrumb a:hover { background: var(--bg-1); color: var(--navy); }
.breadcrumb .sep { color: var(--muted); font-weight: 400; margin: 0 2px; }
.breadcrumb .current { color: var(--ink); padding: 5px 6px; }

/* Fallback for any remaining single back-links — clean, professional (no orange pill) */
.back-link {
  display: inline-block; margin-bottom: 18px; color: var(--royal);
  text-decoration: none; font-size: 15px; font-weight: 700;
}
.back-link:hover { text-decoration: underline; }

/* ---------- Notifications ---------- */
.notif { position: relative; }
.notif-bell {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.notif-bell:hover { background: var(--bg-1); }
.notif-count {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.notif-panel {
  position: absolute;
  right: 0;
  top: 46px;
  width: 340px;
  max-width: 86vw;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
  overflow: hidden;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.notif-readall {
  background: none; border: none; color: var(--bright);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-item.unread { background: #f3f7ff; }
.notif-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.notif-body { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-when { font-size: 11px; color: #9aa3b2; margin-top: 4px; }

/* ---------- Document table ---------- */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  overflow-x: auto;
}
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th {
  text-align: left;
  padding: 13px 16px;
  background: #f6f8fc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
}
.doc-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr.row-click { cursor: pointer; }
.doc-table tr.row-click:hover { background: #f7faff; }

/* ---- Offboarding case page ---- */
.ob-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .ob-grid { grid-template-columns: 1fr; } }
.ob-banner { border-radius: 10px; padding: 10px 14px; margin: 10px 0 4px; font-size: 13px; border: 1px solid var(--line); }
.ob-b-draft { background: #fff7ed; border-color: #f4c98a; color: #92500f; }
.ob-b-pending { background: #fef9c3; border-color: #e6cf5a; color: #825e05; }
.ob-b-approved { background: #ecfdf5; border-color: #86e0b8; color: #0b6b45; }
.ob-b-rejected { background: #fef2f2; border-color: #f1a3a3; color: #a11b1b; }
.ob-b-done { background: #eef2ff; border-color: #b4c0ee; color: #2c3e8f; }
.ob-check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.ob-check input { width: auto; }
.ob-preview-sec { position: sticky; top: 84px; }
.sp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.sp-tile { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; }
.sp-lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.sp-val { font-size: 17px; font-weight: 800; color: var(--ink); }
.sp-sub { font-size: 10.5px; color: var(--muted); }
.sp-lines { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sp-line { display: flex; justify-content: space-between; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.sp-line:last-child { border-bottom: none; }
.sp-line .neg { color: var(--danger); }
.sp-net { background: #eef2ff; font-weight: 800; }
.ob-actions { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.ob-sub { font-size: 13px; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.ob-note input { width: 100%; }
.btn-block { display: block; text-align: center; margin: 6px 0; }
.doc-name { font-weight: 600; color: var(--ink); }
.doc-sub { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.muted-cell { padding: 26px; text-align: center; color: var(--muted); }
.actions-col { white-space: nowrap; }

.cat {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.cat.license { background: #e7f1fb; color: #1f5fb0; }
.cat.legal { background: #eee9f7; color: #6c3fb0; }

/* Leave / vacation summary tiles */
.leave-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 20px; }
.leave-stat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.leave-stat .ls-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.leave-stat .ls-value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.15; margin-top: 4px; }
.leave-stat .ls-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.leave-stat.accent { border-left: 4px solid var(--c, #0f766e); }
.leave-legend { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.type-annual { background: #e7f1fb; color: #1f5fb0; }
.type-sick { background: #fdeaea; color: #c0392b; }
.type-unpaid { background: var(--bg-2); color: var(--muted); }
.type-other { background: #eee9f7; color: #6c3fb0; }

/* Users' Admin — privileges matrix */
.priv-fn { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.priv-fn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.priv-fn-name { font-weight: 800; color: var(--navy); border-left: 4px solid var(--c, #556); padding-left: 8px; }
.priv-acts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.priv-act { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.priv-act input { width: auto; margin: 0; }
.priv-quick { font-size: 12px; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--royal); cursor: pointer; font-size: 12px; padding: 0; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.badge-ok { background: #e6f6ec; color: #1f8a4c; }
.badge-warn { background: #fef3e0; color: #b9760f; }
/* A letter that has not been issued yet: no reference number, still editable. */
.badge-draft { background: #eef0f4; color: #6b7385; border: 1px dashed #c3c9d4; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.btn-primary.btn-danger { background: var(--danger); }
.badge-muted { background: var(--bg-2); color: var(--muted); }

.row-btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 6px;
}
.row-btn:first-child { margin-left: 0; }
.row-btn:hover { background: var(--bg-1); border-color: var(--royal); }
.row-btn-danger { color: var(--danger); }
.row-btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* Payment terms section + due highlights */
.pt-title { margin: 18px 0 4px; font-size: 14px; color: var(--navy); border-top: 1px solid var(--line); padding-top: 14px; }
.payment-terms textarea {
  font-size: 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fbfcfe; font-family: inherit; resize: vertical;
}
.pay-overdue { color: var(--danger); font-weight: 700; }

/* ---------- Upload card / form ---------- */
.upload-card { margin-bottom: 20px; }
.btn-inline { width: auto; display: inline-block; padding: 10px 18px; }
.upload-form {
  margin-top: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; gap: 6px; color: var(--ink); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.form-grid label.chk input { width: auto; }
.onb-actions .chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea {
  font-size: 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fbfcfe; font-weight: 400;
  font-family: inherit;
}
.form-grid textarea { resize: vertical; min-height: 68px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--royal); }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.form-actions .btn-primary, .form-actions .btn-ghost { width: auto; }
.form-msg { font-size: 13px; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: #1f8a4c; }

/* ---------- New hires waiting for a username (Users' Admin) ---------- */
.req-panel {
  border-left: 4px solid var(--bright);
  background: #f7faff;
  margin-bottom: 18px;
}

.req-panel-title {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--navy);
}

.req-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.req-row:first-of-type { border-top: none; }

.req-who { flex: 1 1 220px; }
.req-who .small { margin-top: 2px; }

.req-assign {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.req-assign .req-email {
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  min-width: 220px;
  outline: none;
}

.req-assign .req-email:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(58, 99, 184, 0.15);
}

.req-msg { flex-basis: 100%; }

/* ---------- Contacts toolbar ---------- */
.contacts-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.contacts-toolbar #search, .contacts-toolbar input[type="search"] {
  flex: 1; min-width: 220px; font-size: 14px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe;
}
.contacts-toolbar select {
  font-size: 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fbfcfe;
  /* A select sizes itself to its longest option — one issuer called "National Center
     for Environmental Compliance (NCEC)" was stretching the bar across the page. */
  max-width: 220px;
}
.contacts-toolbar #search:focus, .contacts-toolbar input[type="search"]:focus,
.contacts-toolbar select:focus { outline: none; border-color: var(--royal); }
/* A filter that is doing something should look like it is. */
.contacts-toolbar .filter-on { border-color: var(--royal); background: #f4f7fd; }
.container-wide { max-width: 1320px; }

/* ---------- Contacts table ---------- */
.contacts-table { min-width: 900px; }
.contacts-table th, .contacts-table td { padding: 11px 8px; }
.contacts-table th:first-child, .contacts-table td:first-child { padding-left: 16px; }
.contacts-table th:last-child, .contacts-table td:last-child { padding-right: 16px; }
.contacts-table th { white-space: nowrap; }
.contacts-table td { white-space: nowrap; vertical-align: middle; }
.contacts-table tbody tr { transition: background 0.12s ease; }
.contacts-table tbody tr:hover { background: #f7faff; }
.contacts-table .col-type { width: 1%; }
.contacts-table .col-company { white-space: normal; min-width: 140px; max-width: 190px; }
.contacts-table .col-company .doc-name { line-height: 1.3; }
.contacts-table .col-name .cn-en { font-weight: 600; color: var(--ink); }
.contacts-table .col-name .cn-ar { font-size: 15px; color: var(--muted); font-weight: 400; margin-top: 3px; text-align: center; }
.contacts-table .col-phone { font-variant-numeric: tabular-nums; width: 1%; }
.contacts-table .col-phone .ph-num { display: block; white-space: nowrap; }
.contacts-table .col-phone .ph-ext { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.contacts-table .col-job { white-space: normal; min-width: 140px; max-width: 200px; line-height: 1.35; font-size: 13px; }
.contacts-table .actions-col .row-btn { padding: 5px 9px; margin-left: 4px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.page-btn {
  min-width: 36px; padding: 7px 11px; border: 1px solid var(--line); background: var(--white);
  color: var(--ink); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.page-btn:hover:not(:disabled):not(.page-btn-current) { background: var(--bg-1); border-color: var(--royal); }
.page-btn-current { background: var(--royal); border-color: var(--royal); color: #fff; cursor: default; }
.page-btn:disabled { opacity: 0.45; cursor: default; }
.page-gap { padding: 0 4px; color: var(--muted); }

.type-field { display: flex; gap: 8px; align-items: stretch; }
.type-field .type-select { flex: 1; min-width: 0; }
.add-type-btn {
  flex: none; border: 1px solid var(--line); background: #fbfcfe; color: var(--royal);
  border-radius: 9px; padding: 0 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.add-type-btn:hover { background: var(--bg-1); border-color: var(--royal); }

.contacts-toolbar .toolbar-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.contact-link { color: var(--royal); text-decoration: none; }
.contact-link:hover { text-decoration: underline; }

/* ---------- Business card ---------- */
.modal-card { max-width: 420px; }
.business-card {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--white); box-shadow: 0 2px 10px rgba(16,24,45,0.06);
}
.bc-top { background: var(--navy, #16235a); color: #fff; padding: 20px 22px; position: relative; }
.bc-top .bc-logo { position: absolute; top: 16px; right: 18px; height: 26px; opacity: 0.9; }
.business-card .bc-name { font-size: 21px; font-weight: 700; margin: 0; color: #fff; }
.bc-arabic { font-size: 15px; opacity: 0.92; margin-top: 2px; }
.bc-job { font-size: 13px; opacity: 0.85; margin-top: 6px; }
.bc-type { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.16); padding: 3px 10px; border-radius: 999px; }
.bc-body { padding: 16px 22px 20px; }
.bc-company { font-weight: 700; color: var(--navy, #16235a); margin-bottom: 12px; }
.bc-line { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.bc-line:first-of-type { border-top: none; }
.bc-line .bc-label { width: 74px; flex: none; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.bc-line a { color: var(--royal); text-decoration: none; }
.bc-note { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* Print: show only the business card */
@media print {
  /* Written for the business-card print, where only the modal should appear — but it
     hid the content of EVERY app page, which is why printing the payroll sheet produced
     a blank PDF. Pages that are meant to print themselves say so with .printable. */
  body.app-page:not(.printable) > .topbar,
  body.app-page:not(.printable) > .container { display: none !important; }
  #card-modal { position: static; background: none; padding: 0; display: block; }
  #card-modal[hidden] { display: none !important; }
  #card-modal .modal { box-shadow: none; max-width: none; padding: 0; }
  .card-actions, #card-share-menu { display: none !important; }
  .business-card { border: none; box-shadow: none; }
}

/* ---------- HR ---------- */
.hr-table { min-width: 1080px; }
.hr-table th, .hr-table td { padding: 11px 10px; white-space: nowrap; vertical-align: middle; }
.hr-table th:first-child, .hr-table td:first-child { padding-left: 16px; }
.hr-table tbody tr { transition: background 0.12s ease; }
.hr-table tbody tr:hover { background: #f7faff; }
.hr-table .col-name { font-weight: 600; color: var(--ink); }
.hr-table .col-arabic { color: var(--ink); text-align: right; }
.modal-lg { max-width: 760px; }
.modal-md { max-width: 560px; }
.split-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.split-head .btn-primary { width: auto; align-self: center; }
.req-tag { display: inline-block; font-size: 10px; font-weight: 700; color: var(--danger); background: var(--danger-bg); padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.staff-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.staff-actions .btn-inline { width: auto; padding: 7px 12px; }
.form-sec { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: 5px; margin-top: 20px; }
.form-grid > .form-sec:first-child { margin-top: 4px; }
.emp-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; margin: 10px 0 6px; }
.ed-sec { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-top: 12px; }
.ed-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #f0f3f8; font-size: 13px; }
.ed-label { color: var(--muted); }
.ed-val { font-weight: 600; text-align: right; }
.ed-gross { grid-column: 1 / -1; background: #f7f9fd; padding: 8px 10px; border-radius: 8px; border: none; margin-top: 4px; }
.ed-gross .ed-val { color: var(--navy); font-size: 15px; }

/* ---------- Procurement ---------- */
.po-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.po-panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; }
.po-panel .section-h { margin-top: 0; }
.po-sub { font-size: 14px; color: var(--navy); margin: 18px 0 6px; }
.items-table { margin-bottom: 8px; }
.items-table .num-col { width: 130px; }
.items-table input { width: 100%; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfe; }
.items-table td.it-amount { font-weight: 600; text-align: right; }
th.num-col, td.num-col { text-align: right; }
.terms-check { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.term-item { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.term-item input { margin-top: 2px; }
.quote-form { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.waiver-row { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.waiver-check { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.approvals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.appr { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.appr-role { font-size: 12px; font-weight: 700; color: var(--navy); }
.appr-name { font-size: 13px; }
.issue-reqs { margin: 14px 0 0; padding: 12px 16px 12px 30px; background: #fdf6e9; border: 1px solid #e7c98a; border-radius: 9px; }
.issue-reqs li { font-size: 13px; color: #8a5a12; margin: 3px 0; }
.issue-reqs li.req-head { list-style: none; margin-left: -14px; font-weight: 700; }
.issue-actions { margin-top: 16px; gap: 10px; }
.issue-actions .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.terms-manage { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 320px; overflow: auto; }
.term-manage-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.term-add { display: flex; gap: 8px; margin: 12px 0; }
.term-add input { flex: 1; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.term-add-col { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.term-add-col textarea { width: 100%; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; font-family: inherit; resize: vertical; }
.term-manage-row span:first-child { flex: 1; white-space: normal; line-height: 1.4; }
.term-manage-row .tm-actions { display: flex; gap: 6px; flex: none; }
.pt-select { width: 100%; }
.po-panel .form-grid select.pt-select { min-height: 40px; }
td.c, th.c { text-align: center; }

@media (max-width: 640px) { .approvals { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.doc-section { margin-bottom: 28px; }
.section-h {
  font-size: 16px; color: var(--navy); margin: 0 0 12px;
  display: flex; align-items: baseline; gap: 8px;
}
.section-sub { font-size: 13px; font-weight: 400; }
.section-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.doc-sub.num { font-size: 12px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 45, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--white); border-radius: 14px; padding: 24px;
  width: 100%; max-width: 480px; box-shadow: var(--shadow);
  max-height: calc(100vh - 40px); overflow-y: auto;   /* never taller than the screen */
}
.modal.modal-sm { max-width: 380px; }
/* The directory form asks for registration, contact and full bank details at once —
   at 480px that is a single column sixteen rows tall, taller than the screen. */
.modal.modal-wide { max-width: 720px; }

/* Paste-a-QR box. A vendor's IBAN and VAT number are long strings that get copied
   wrongly by eye — reading them off the code the vendor already published is both
   faster and right. */
.qr-drop { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start;
           justify-content: space-between; background: #f4f7fd; border: 1px dashed #b9c7e4;
           border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; }
/* min-width, or the thumbnail squeezes the wording into a one-word-per-line column
   inside the 480px Edit-contact modal. Below that width the two simply stack. */
.qr-drop-main { flex: 1 1 240px; min-width: 240px; display: flex; flex-direction: column; gap: 3px; }
.qr-drop kbd { background: #fff; border: 1px solid #c9d3e6; border-bottom-width: 2px;
               border-radius: 4px; padding: 0 5px; font-size: 11px; font-family: inherit; }
.qr-drop .qr-preview { flex: 0 0 auto; width: 84px; height: 84px; object-fit: contain;
                       background: #fff; border: 1px solid #d7deec; border-radius: 8px; padding: 4px; }
.qr-drop .link-btn { color: var(--blue, #2a6db0); text-decoration: underline; cursor: pointer; }
.modal h3 { margin: 0 0 6px; color: var(--navy); }
/* Long forms (e.g. HR): keep the title and the Save/Cancel bar visible while scrolling. */
.modal-lg h3 { position: sticky; top: -24px; background: var(--white); padding-top: 4px; z-index: 1; }
.modal-lg .form-actions { position: sticky; bottom: -24px; background: var(--white);
  margin: 12px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px; }
.small { font-size: 12px; margin-top: 12px; }

/* Share options */
.share-options { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 4px; }
.share-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; font-size: 14px; font-weight: 600; color: var(--ink);
  cursor: pointer; text-align: left;
}
.share-opt span { font-size: 18px; }
.share-opt:hover { background: var(--bg-1); border-color: var(--royal); }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Candidate self-intake (Step 1) */
.intake-status { margin: 4px 0 12px; }
.intake-linkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.intake-linkbox input { flex: 1 1 320px; min-width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-1); font-family: monospace; font-size: 13px; }
.intake-file { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin-right: 6px; font-size: 13px; }

/* Fixed Assets */
.inline-add { display: flex; gap: 6px; align-items: center; }
.inline-add select { flex: 1; }
.dep-out { grid-column: 1 / -1; display: flex; gap: 24px; flex-wrap: wrap; background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.dep-out > div { display: flex; flex-direction: column; }
.dep-out strong { font-size: 16px; }
.link-btn { background: none; border: none; color: var(--royal); cursor: pointer; font-size: 12px; padding: 0 4px; }
.link-btn:hover { text-decoration: underline; }

/* Company landing — 'coming soon' tile */
.tile-soon { opacity: 0.72; }
.tile-soon .tile-tags { font-style: italic; }

/* To-Do: compact "Add a task" row that expands into the fields */
.todo-add-row {
  width: 100%; text-align: left; background: var(--bg-1); border: 1px dashed var(--line);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--royal);
}
.todo-add-row:hover { background: #eef2fb; border-color: var(--royal); }
.todo-add-plus { font-weight: 800; margin-right: 6px; }

/* On phones, tiles become short rectangles instead of big squares */
@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { aspect-ratio: auto; min-height: 88px; padding: 16px 20px; }
  .tile-title { font-size: 20px; }
}

/* ---------- Outgoing letters on ANSAM letterhead ----------------------------
   One A4 sheet whose header and footer are the real letterhead graphics, lifted
   from the letters the company already sends. The margins are set so the typed
   text starts where it does on the paper originals. */
.letter-body { background: #eef0f4; margin: 0; padding: 0 0 40px; }

.letter-toolbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; background: #fff; border-bottom: 1px solid #e3e6ec;
  position: sticky; top: 0; z-index: 5;
}
.letter-toolbar .muted { margin-inline-start: auto; }

.letter-sheet {
  width: 210mm; min-height: 297mm; margin: 24px auto; background: #fff;
  box-shadow: 0 6px 24px rgba(20, 30, 60, .12);
  padding: 0 0 20mm;
  position: relative;
  font-family: var(--font);
  font-size: 11.5pt; line-height: 1.55; color: #10131a;
}
/* The rule under the letterhead used to be a border on this element, which meant it ran
   the full width of the sheet while the logo sat 14mm in and the body text 16mm in — the
   line overshot the logo at both ends. Margin rather than padding insets the rule itself,
   so the logo, the rule and every line of the letter below it start on the same edge. */
.letter-head {
  margin: 0 16mm; padding: 12mm 0 1mm; direction: ltr;
  border-bottom: 2px solid var(--navy);
}
/* logo-mark.png is logo.png with its transparent border trimmed off. The original carries
   ~16% empty space each side, which at this size printed as a 9mm gap — so the mark sat
   9mm inside the margin every other line of the letter starts on, however the box was
   aligned. Trimmed, the ink itself starts on the margin. */
.letter-head img { display: block; height: 14mm; width: auto; }
/* Address and registrations read as one line under the logo, divided by bars, rather
   than as two stacked lines. The bar is drawn by CSS and only when there is something
   after it, so a company with no registration recorded gets no dangling separator. */
/* The line sits low under the logo, close to the rule. Its 2.5mm of space above and the
   header's 1mm below add up to what the header used to hold the other way round, so the
   text moves down toward the rule and the rule itself does not move at all. */
.letter-head-block { margin-top: 2.5mm; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 2mm; }
/* One face, one size, no bold: it is the company's address and numbers, not a heading. */
.letter-head-addr, .letter-head-reg { font-size: 8pt; font-weight: 400; color: #3a4a6b; }
.letter-head-addr:not(:empty) + .letter-head-reg:not(:empty)::before {
  content: "|"; margin-inline-end: 2mm; color: #93a2c4; font-weight: 400;
}

.letter-meta { padding: 8mm 16mm 0; font-size: 10.5pt; text-align: start; }
.letter-label { font-weight: 700; }

.letter-content { padding: 10mm 16mm 0; }
.letter-subject { font-weight: 700; margin: 0 0 5mm; }
.letter-recipient { margin: 0 0 3.5mm; font-weight: 700; }
.letter-greeting { margin: 0 0 4mm; }
.letter-text p { margin: 0 0 2.5mm; text-align: justify; }
.letter-closing { margin: 5mm 0 0; }

.letter-sign { margin-top: 5mm; }
.letter-sheet[dir="ltr"] .letter-sign { display: flex; flex-direction: column; }
.letter-sheet[dir="ltr"] .letter-sign-space { order: 1; }
.letter-sheet[dir="ltr"] .letter-sign-name { order: 2; }
.letter-sheet[dir="ltr"] .letter-sign-title { order: 3; font-weight: 400; }
.letter-sign-title { font-weight: 700; }
.letter-sign-space { height: 15mm; }        /* signature and stamp go here */
.letter-sign-name { font-weight: 700; }



/* Arabic sets right-to-left and reads better a touch larger. */
.letter-sheet[dir="rtl"] { font-size: 12pt; }
.letter-sheet[dir="rtl"] .letter-text p { text-align: justify; }

@media print {
  /* NOTE: @page belongs to the document, not to a selector — a rule here would apply to
     every page that loads this stylesheet, which is all 35 of them. Each page that prints
     declares its own size in its own <style>. See outgoing-letter.html. */
  .letter-body { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .letter-sheet { width: auto; margin: 0; box-shadow: none; min-height: 297mm; }
  /* Without this the letterhead graphics print as blank boxes in Chrome. */
  .letter-head img, .letter-foot img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 820px) {
  .letter-sheet { width: auto; margin: 12px; padding-bottom: 26mm; }
}

/* The three ways to create an outgoing entry, chosen before anything is typed. */
.kind-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.kind-option {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fbfcfe; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.kind-option:hover { border-color: var(--royal); }
.kind-option:has(input:checked) { border-color: var(--royal); background: #eef2fb; box-shadow: 0 0 0 3px rgba(58, 99, 184, .12); }
.kind-option input { margin-inline-end: 8px; }
.kind-title { font-weight: 700; font-size: 14px; }
.kind-sub { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .kind-choice { grid-template-columns: 1fr; } }

/* ---------- To-do notes (rich text) ----------
   A small editor built into the portal: one toolbar row and a writing area, styled
   like every other field on the form. No third-party editor, so nothing to load. */
.rich-note { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.rich-note:focus-within { border-color: var(--royal); box-shadow: 0 0 0 3px rgba(58, 99, 184, .12); }

/* Folded away until the box is clicked into — the note field then looks like a plain
   place to write, and the icons arrive only when there is something to format. */
.note-tools {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 0 6px; background: #f6f8fc;
  max-height: 0; opacity: 0; overflow: hidden; border-bottom: 1px solid transparent;
  transition: max-height .16s ease, opacity .16s ease, padding .16s ease;
}
.rich-note.is-writing .note-tools {
  max-height: 90px; opacity: 1; padding: 5px 6px; border-bottom-color: var(--line);
}
@media (prefers-reduced-motion: reduce) { .note-tools { transition: none; } }
.note-tools .sep { width: 1px; align-self: stretch; margin: 2px 5px; background: var(--line); }
.note-btn {
  min-width: 30px; height: 28px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--ink); font-size: 14px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s;
}
.note-btn:hover { background: #e8edf8; border-color: var(--line); }
.note-btn.is-on { background: #dfe7f7; border-color: var(--royal); color: var(--royal); }
.note-btn b, .note-btn i, .note-btn u { font-size: 14px; }
.note-btn svg { display: block; }

.note-area {
  min-height: 150px; max-height: 420px; overflow-y: auto; padding: 10px 12px;
  font-size: 14px; line-height: 1.6; color: var(--ink); outline: none;
}
.note-area p { margin: 0 0 8px; }
.note-area ul, .note-area ol { margin: 0 0 8px; padding-inline-start: 22px; }
.note-area blockquote { margin: 0 0 8px; padding-inline-start: 10px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.note-area:empty::before, .note-area.is-empty::before {
  content: attr(data-placeholder); color: var(--muted); pointer-events: none;
}
/* Nothing flips a right-to-left paragraph by hand: dir="rtl" already starts the text at
   the right edge, and the logical padding above puts its bullets there too. Alignment
   chosen with the buttons is written inline, which outranks any of this.

   A paragraph nobody set a direction on reads its own first word instead — so Arabic
   typed straight in runs right-to-left, in the editor and in the saved note alike,
   without anyone having to press a button. Paragraphs that DO carry dir are excluded,
   so an explicit choice is never second-guessed by the text inside it. */
.note-area :is(p, li, ul, ol, blockquote, h2, h3, h4, pre):not([dir]),
.todo-note-body :is(p, li, ul, ol, blockquote, h2, h3, h4, pre):not([dir]) {
  unicode-bidi: plaintext;
  text-align: start;
}

.todo-note { flex-basis: 100%; margin: 8px 0 0; border-top: 1px dashed var(--line); padding-top: 8px; }
.todo-note > summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--royal);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.todo-note > summary::before { content: "▸"; transition: transform .15s; }
.todo-note[open] > summary::before { transform: rotate(90deg); }
.todo-note-body { font-size: 14px; line-height: 1.6; color: var(--ink); margin-top: 6px; }
.todo-note-body p { margin: 0 0 8px; }
.todo-note-body ul, .todo-note-body ol { margin: 0 0 8px; padding-inline-start: 22px; }
.todo-note-body h2, .todo-note-body h3, .todo-note-body h4 { margin: 10px 0 6px; font-size: 15px; }
.todo-note-body blockquote { margin: 0 0 8px; padding-inline-start: 12px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.todo-note-body a { color: var(--bright); }

/* Hand-over / comment thread on a task. */
.thread-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.thread-item { font-size: 13.5px; line-height: 1.5; border-inline-start: 3px solid var(--line); padding: 2px 0 2px 10px; }
.thread-item.thread-handoff { border-inline-start-color: var(--bright); }
.thread-head { font-weight: 600; color: var(--ink); }
.thread-when { color: var(--muted); font-size: 12px; margin-inline-start: 6px; }
.thread-body { color: var(--ink); margin-top: 3px; white-space: pre-wrap; }

/* Task type: a free-text label, shown as a chip and usable as a filter. */
.todo-type {
  font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  background: #eef2fb; color: var(--royal); border-radius: 5px; padding: 2px 7px;
}
.type-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.type-chip {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); color: var(--muted); cursor: pointer;
}
.type-chip:hover { border-color: var(--royal); color: var(--royal); }
.type-chip.is-on { background: var(--royal); border-color: var(--royal); color: var(--white); }

/* ---------- Payroll sheets ---------- */
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.inline-field input, .inline-field select { font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.payroll-table { min-width: 2100px; font-size: 12.5px; }
.payroll-table th, .payroll-table td { padding: 6px 7px; white-space: nowrap; }
.payroll-table .pay-in { width: 84px; text-align: right; }
.payroll-table .pay-note { width: 130px; }
.payroll-table .pay-iban { width: 190px; }
.payroll-table input { font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.payroll-table input[readonly] { background: #f4f6fa; color: var(--muted); }
.payroll-table .net-cell { background: #eef7f1; }
/* The part banner: each group of columns is one shade, so a wide sheet stays readable. */
.payroll-parts th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid #fff; }
.payroll-parts .part-info { background: #eef2fb; color: var(--navy); }
.payroll-parts .part-pay  { background: #e9f0ff; color: var(--navy); }
.payroll-parts .part-adj  { background: #fdf3e3; color: #8a5a10; }
.payroll-parts .part-net  { background: #e6f6ec; color: #1f8a4c; }
.payroll-parts .part-misc { background: #f4f6fa; color: var(--muted); }
.payroll-parts .part-bank { background: #f0eefb; color: #5a4fcf; }
.payroll-parts .part-gosi { background: #fdecea; color: #b03a2b; }
.payroll-total th { background: #f4f6fa; border-top: 2px solid var(--navy); }
@media print {
  .payroll-table { min-width: 0; font-size: 7pt; table-layout: auto; }
  .payroll-table input { border: none; background: none; padding: 0; }
  /* The A3 landscape @page this needs lives in payroll-sheet.html, not here: declared in
     the shared stylesheet it turned every other page's printout sideways too — the
     outgoing letter among them. */
  /* The banner row spans fixed numbers of columns, and hiding the empty ones leaves it
     pointing at the wrong ones. The column names alone say what each is. */
  .payroll-parts { display: none !important; }
  /* Never break a word or a figure across two lines: "25,000.00" split over two rows is
     not a number anyone can read, and "EMPL OYEE" is not a heading. */
  .payroll-table th, .payroll-table td { word-break: normal !important; overflow-wrap: normal !important; hyphens: none; }
  .payroll-table .num-col, .payroll-table th { white-space: nowrap; }
  .payroll-table td { vertical-align: middle; }
  /* Names and notes may wrap — on whole words. */
  .payroll-table .doc-name, .payroll-table .note-col { white-space: normal; }
}

/* ---------- "Waiting for you" (CEO / Deputy CEO landing) ---------- */
.waiting-card {
  margin: 0 0 26px; padding: 18px 20px; background: var(--white);
  border: 1px solid var(--line); border-left: 5px solid var(--danger);
  border-radius: 14px; box-shadow: 0 6px 20px rgba(22, 35, 122, .07);
}
.waiting-head { margin: 0 0 12px; font-size: 17px; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.waiting-count {
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 13px; padding: 2px 10px; font-weight: 700;
}
.waiting-group { padding: 10px 0; border-top: 1px dashed var(--line); }
.waiting-group:first-child { border-top: none; }
.waiting-title { font-weight: 700; font-size: 14px; color: var(--royal); text-decoration: none; }
.waiting-title:hover { text-decoration: underline; }
.waiting-pill { background: #eef2fb; color: var(--royal); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.waiting-list { margin: 6px 0 0; padding-inline-start: 18px; font-size: 13px; color: var(--ink); }
.waiting-list li { margin: 2px 0; }
.waiting-label { font-weight: 600; }

/* A scrollable box prints only the slice you can see, which on a sheet 2100px wide
   is nothing at all — the "empty PDF". When printing, let it spill and lay out fully. */
@media print {
  .table-wrap { overflow: visible !important; border: none; border-radius: 0; }
  .container-wide, .container { max-width: none !important; padding: 0 !important; }
  .payroll-table { width: 100% !important; min-width: 0 !important; table-layout: auto; }
  .payroll-table th, .payroll-table td { padding: 2px 3px; }
  .payroll-table .pay-in, .payroll-table .pay-note, .payroll-table .pay-iban { width: 100%; }
  .payroll-table input { border: none !important; background: none !important; padding: 0 !important; font-size: 7.5pt; }
  .welcome-h { font-size: 16pt; }
}
/* The value shown in place of an input while printing. */
.print-only-value { display: none; }
@media print { .print-only-value { display: inline; font-size: 7.5pt; } }
/* The reasons, grouped after the figures. Slightly wider than a money box. */
.payroll-table .note-col input { width: 150px; }
@media print { .payroll-table .no-print, .payroll-table th.no-print { display: none !important; } }
/* A column with nothing in it is not printed. It stays on screen, where you would type
   the first value into it. */
@media print { .payroll-table .col-empty { display: none !important; } }
/* All the reasons for one person in a single cell, each behind the label it explains —
   the salary slip's arrangement, still typed in place. */
.payroll-table .reasons-col { min-width: 230px; white-space: normal; }
.reason-line { display: flex; align-items: center; gap: 6px; margin: 1px 0; }
.reason-label { font-size: 10px; color: var(--muted); min-width: 92px; text-align: right; }
.reason-line input { flex: 1; min-width: 110px; }
/* A reason nobody filled in is not printed; the rest stay on their own line. */
@media print {
  .reason-line input:placeholder-shown { display: none; }
  .reason-line:has(input:placeholder-shown) { display: none; }
  .reason-label { min-width: 0; font-weight: 700; color: #16203a; }
  .reason-line input { border: none; }
}

/* ---------- Payroll sheet toolbar ---------- */
.sheet-summary {
  margin: 18px 0 10px; padding: 10px 14px; border-radius: 10px;
  background: #eef2fb; border: 1px solid #dbe3f5; color: var(--navy);
  font-size: 14px; font-weight: 700; letter-spacing: .2px;
}
.sheet-controls, .sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sheet-controls { margin-bottom: 8px; }
.sheet-controls .search-input { flex: 1; min-width: 240px; max-width: 420px; }
.sheet-controls .btn-primary { margin-inline-start: auto; }
.sheet-actions { margin-bottom: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
/* A filter under each column name, as a spreadsheet does. */
.filter-row th { padding: 3px 4px; background: #f7f9fd; border-bottom: 2px solid var(--line); }
.filter-row .col-filter {
  width: 100%; min-width: 90px; font-size: 11px; padding: 3px 5px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink);
}
.filter-row .col-filter:not([value=""]) { border-color: var(--royal); }
@media print { .filter-row { display: none !important; } }
/* Read-receipt on an assigned task. */
.todo-seen { font-size: 11px; font-weight: 600; border-radius: 5px; padding: 1px 7px; }
.todo-seen.seen-yes { color: #1f8a4c; background: #e6f6ec; }
.todo-seen.seen-no  { color: #b9760f; background: #fef3e0; }
/* Signed-document slots on a purchase order. */
.doc-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: #fbfcfe; }
.doc-slot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-replace, .doc-upload { cursor: pointer; }

/* Payment-voucher Notes field — a proper, comfortable box rather than a cramped strip. */
.pv-notes-field { display: block; margin-top: 14px; }
.pv-notes {
  width: 100%; min-height: 96px; margin-top: 6px; padding: 11px 13px;
  font: inherit; font-size: 14px; line-height: 1.6; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; resize: vertical;
}
.pv-notes:focus { border-color: var(--royal); box-shadow: 0 0 0 3px rgba(58,99,184,.15); background: #fff; outline: none; }

/* "Save first" banner on the attachments panel — visible, not a grey whisper. */
.attach-banner {
  padding: 10px 14px; margin: 4px 0 10px; border-radius: 10px;
  background: #fef3e0; border: 1px solid #f3d19a; color: #8a5a10; font-size: 13px;
}
.attach-banner strong { color: #7a4e0d; }
/* Voucher print: confirmation that attachments were added. */
#attach-done { text-align:center; color:#1f8a4c; background:#e6f6ec; border:1px solid #bfe3cd;
  border-radius:8px; padding:8px; font-size:13px; margin:10px 0; }
@media print { #attach-done { display:none; } }

/* Payment voucher: the rarely-used fields, folded away. Most vouchers never need
   a PO link, a currency other than SAR, or the supplier's CR/VAT repeated here. */
/* The PO link leads the voucher form — tinted so it reads as the first decision
   ("is this paying an order?") rather than as one more field among twenty. */
.pv-po-link { background: #f4f7fd; border: 1px solid #d7e1f3; border-radius: 10px;
              padding: 12px 14px; margin-bottom: 14px; }
.pv-po-link #po-link-hint { margin: 6px 0 0; color: #46577a; }

.pv-more { margin: 14px 0 4px; border: 1px solid var(--line, #e4e8ef); border-radius: 10px; padding: 10px 14px; background: #fff; }
.pv-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted, #6b7689); list-style: none; }
.pv-more > summary::-webkit-details-marker { display: none; }
.pv-more > summary::before { content: '▸ '; }
.pv-more[open] > summary::before { content: '▾ '; }

/* The employee information-form reminder on the company chooser. Deliberately a
   note rather than a card: it must be readable and ignorable in the same glance. */
.info-form-note { margin: 4px 0 18px; padding: 10px 14px; border-radius: 9px;
  background: #fff8e6; border: 1px solid #f5e0b0; color: #8a6100; font-size: 13.5px; }
.info-form-note a { color: #8a6100; font-weight: 600; }

/* ---------- Petty Cash ----------
   The balance leads the page: it is the one number anyone opening this screen came to
   see, so it is stated once, large, before any table. */
.cash-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin: 6px 0 4px; padding: 16px 20px; background: var(--white);
  border: 1px solid var(--line); border-left: 5px solid #c2410c; border-radius: 14px;
}
.cash-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.cash-figure {
  font-size: 34px; font-weight: 800; color: var(--navy); line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
/* An empty or overdrawn box is a fact worth noticing, not a styling flourish. */
.cash-figure.is-low { color: var(--danger); }
.cash-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.cash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 620px) { .cash-head { flex-direction: column; align-items: flex-start; } }

/* The particulars table inside the voucher form, and the read-only "Show" view. */
.sn-col { width: 46px; text-align: center; }
.pc-total-row { margin-top: 8px; text-align: right; font-size: 14px; }
.pc-total-row strong { font-variant-numeric: tabular-nums; }
.pc-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 10px 0 14px; }
.pc-fact .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.pc-fact .v { font-size: 14px; color: var(--ink); }
#pc-items input { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; }
#pc-items .num-col input { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Writing a voucher: the cheque writer ----------
   The shape the accounting system uses, because that is the shape the people writing
   these already know: the account the money leaves and what it holds, then the cheque
   face, then the expense splits underneath adding up to the figure on it. Built as
   .chq-* so the bank payment voucher can wear the same clothes. */
.modal.modal-cheque {
  max-width: 1040px; width: 97vw; background: #fff; padding: 0; border-radius: 10px;
  box-shadow: 0 24px 60px rgba(22, 35, 122, .28); overflow: hidden;
}
.chq { font-size: 13px; color: var(--ink); }

/* The account strip above the cheque. */
.chq-top {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 14px 20px; background: #f6f8fc; border-bottom: 1px solid var(--line);
}
.chq-acct { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.chq-acct select { font: inherit; font-size: 13.5px; font-weight: 400; letter-spacing: 0;
  text-transform: none; color: var(--ink); padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; min-width: 260px; }
.chq-bal { text-align: right; }
.chq-bal .k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.chq-bal .v { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.chq-bal .v.is-low { color: var(--danger); }

/* The cheque itself: tinted, ruled, and laid out like one. */
.chq-face {
  margin: 18px 20px; padding: 18px 22px 20px; border: 1px solid #cfe0cf; border-radius: 6px;
  background:
    repeating-linear-gradient(115deg, rgba(120,170,120,.07) 0 2px, transparent 2px 7px),
    linear-gradient(#f4faf4, #eef7ee);
}
.chq-face .k { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #5d7a5d; }
.chq-face input { font: inherit; border: none; background: transparent; color: #10131a;
  border-bottom: 1px solid #7f9b7f; padding: 3px 6px; }
.chq-face input:focus { outline: none; border-bottom: 1.5px solid var(--royal); background: rgba(255,255,255,.75); }

.chq-meta { display: flex; justify-content: flex-end; gap: 26px; }
.chq-meta > div { display: flex; align-items: center; gap: 8px; }
.chq-meta .v { font-family: "Courier New", monospace; font-size: 15px; font-weight: 700; }

.chq-pay { display: flex; align-items: flex-end; gap: 12px; margin-top: 14px; }
.chq-payee { flex: 1; min-width: 0; font-size: 16px !important; font-weight: 700; }
.chq-amount {
  display: inline-flex; align-items: baseline; gap: 8px; border: 1.5px solid #4d6b4d;
  border-radius: 4px; background: rgba(255,255,255,.8); padding: 6px 14px; min-width: 150px;
  justify-content: flex-end; font-family: "Courier New", monospace; font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chq-amount .ccy { font-family: inherit; font-size: 10px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: #5d7a5d; }

/* The long ruled line the amount is spelled out along. */
.chq-words { display: flex; align-items: flex-end; gap: 10px; margin-top: 16px; }
.chq-wordline { flex: 1; border-bottom: 1.5px solid #10131a; min-height: 22px; padding: 0 4px 3px;
  font-size: 14px; font-style: italic; color: #10131a; }
.chq-memo { display: flex; align-items: flex-end; gap: 10px; margin-top: 16px; }
.chq-memo input { flex: 1; min-width: 0; }

/* The splits, as a grid under the cheque. */
.chq-splits { margin: 0 20px 8px; }
.chq-tabs { display: flex; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--line); }
.chq-tabs .tab { font-size: 12.5px; font-weight: 700; padding: 7px 14px; border: 1px solid var(--line);
  border-bottom: none; border-radius: 7px 7px 0 0; background: #f6f8fc; color: var(--muted); }
.chq-tabs .tab.is-on { background: #fff; color: var(--ink); position: relative; top: 1px; }
.chq-tabs .tot { margin-inline-start: auto; font-family: "Courier New", monospace; font-weight: 700;
  font-size: 14px; font-variant-numeric: tabular-nums; padding-bottom: 6px; }
.chq-tabs .ccy { font-family: var(--font); font-size: 10px; letter-spacing: .6px; color: var(--muted); margin-inline-end: 6px; }

.chq-grid { width: 100%; border-collapse: collapse; }
.chq-grid th { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted);
  text-align: start; font-weight: 700; padding: 8px 8px 6px; border-bottom: 1px solid var(--line); }
.chq-grid td { border-bottom: 1px solid #eef1f7; padding: 0; }
.chq-grid tr:nth-child(even) td { background: #f7faff; }
.chq-grid input, .chq-grid select {
  width: 100%; font: inherit; font-size: 13px; border: 1px solid transparent; background: transparent;
  padding: 7px 8px; border-radius: 6px; color: var(--ink);
}
.chq-grid input:focus, .chq-grid select:focus { outline: none; border-color: var(--royal); background: #fff; }
.c-acct { width: 30%; } .c-amt { width: 120px; } .c-div { width: 130px; } .c-x { width: 38px; }
.chq-grid td.c-amt input { text-align: right; font-variant-numeric: tabular-nums; }
.chq-del { border: none; background: transparent; color: var(--danger); cursor: pointer;
  font-size: 13px; padding: 5px 7px; border-radius: 6px; }
.chq-del:hover { background: var(--danger-bg); }
.chq-add { margin-top: 8px; border: none; background: transparent; color: var(--royal);
  font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 2px; }
.chq-add:hover { text-decoration: underline; }

.chq-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px; margin-top: 12px; background: #f6f8fc; border-top: 1px solid var(--line); }
.chq-prep { font-size: 12px; color: var(--muted); }
.chq-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .chq-pay, .chq-words, .chq-memo { flex-wrap: wrap; }
  .chq-amount { width: 100%; }
}

/* Supporting documents on a petty cash voucher. */
.pc-files { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.pc-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; font-size: 13px; }
.pc-file .kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--royal); background: #eef2fb; border-radius: 5px; padding: 2px 7px; }
.pc-file .who { color: var(--muted); font-size: 12px; margin-inline-start: auto; }
.pc-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-upload select, .pc-upload input[type=text], .pc-upload input[name=label] {
  font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
/* The file picker sits in the same row as the label box, and reads like part of it. */
.pc-upload input[type=file] { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; max-width: 100%; }
.pc-upload input[name=label], .pc-upload input#e-file-label { min-width: 200px; }

/* The journal voucher is written six columns wide — account, description, division,
   debit, credit and the button that removes the line. At the 720px modal the last two
   fell off the right-hand edge, and an entry whose debit column cannot be seen is not an
   entry anybody can check. The dialog is given the width the entry needs, and the table
   is laid out to fit it rather than to fit its content. */
.modal.modal-jv { max-width: min(1020px, calc(100vw - 32px)); }
.jv-lines { table-layout: fixed; }
.jv-lines th, .jv-lines td { padding: 9px 8px; }
.jv-lines th:first-child, .jv-lines td:first-child { padding-inline-start: 14px; }
.jv-lines th:last-child, .jv-lines td:last-child { padding-inline-end: 14px; }
.jv-lines th:nth-child(1), .jv-lines td:nth-child(1) { width: 33%; }
.jv-lines th:nth-child(2), .jv-lines td:nth-child(2) { width: 23%; }
.jv-lines th:nth-child(3), .jv-lines td:nth-child(3) { width: 14%; }
.jv-lines th:nth-child(4), .jv-lines td:nth-child(4),
.jv-lines th:nth-child(5), .jv-lines td:nth-child(5) { width: 12%; }
.jv-lines th:nth-child(6), .jv-lines td:nth-child(6) { width: 4%; }
/* Every control fills its own cell, so nothing sticks out past the column it is in. */
.jv-lines select, .jv-lines input { width: 100%; max-width: 100%; font: inherit; font-size: 13px;
  padding: 6px 8px; border: 1px solid var(--line, #d7deec); border-radius: 7px; background: #fff; }
.jv-lines input.num-in { width: 100%; text-align: right; }
.jv-lines .l-del { width: auto; }
/* On a narrow screen the table keeps its own width and scrolls sideways inside the
   dialog, rather than squeezing the account name down to nothing. */
@media (max-width: 900px) { .jv-lines { table-layout: auto; min-width: 760px; } }

/* The quotation's lines: a serial, what is being supplied, then the figures. */
#items-table th:nth-child(1), #items-table td:nth-child(1) { width: 6%; }
#items-table th:nth-child(2), #items-table td:nth-child(2) { width: 38%; }
#items-table th:nth-child(3), #items-table td:nth-child(3) { width: 13%; }
#items-table th:nth-child(4), #items-table td:nth-child(4) { width: 11%; }
#items-table th:nth-child(5), #items-table td:nth-child(5) { width: 14%; }
#items-table th:nth-child(6), #items-table td:nth-child(6) { width: 14%; }
#items-table th:nth-child(7), #items-table td:nth-child(7) { width: 4%; }
#items-table .q-no { font-weight: 700; color: var(--muted); }

/* A date should never wrap onto two lines in a table cell. */
.doc-table td.nowrap { white-space: nowrap; }

/* Shown to whoever may correct a record that is otherwise locked — an issued purchase
   order, a paid voucher. It should never feel like editing a draft. */
.unlock-note {
  margin: 0 0 14px; padding: 10px 14px; font-size: 13px; line-height: 1.5;
  color: #8a5a12; background: #fdf6e9; border: 1px solid #e7c98a;
  border-left: 4px solid #d97706; border-radius: 9px;
}

/* The opening trial balance is typed straight into its table — a figure box that sits in
   a cell without making it look like a form. */
.doc-table input.num-in { width: 118px; text-align: right; padding: 4px 6px; border: 1px solid var(--line, #d7deec);
  border-radius: 6px; font: inherit; background: #fff; }
.doc-table input.note-in { width: 100%; padding: 4px 6px; border: 1px solid var(--line, #d7deec);
  border-radius: 6px; font: inherit; background: #fff; }
.doc-table input.num-in:focus, .doc-table input.note-in:focus { outline: 2px solid #1f3c88; outline-offset: 1px; }

/* The entry a payment voucher makes, shown as it is typed: debits, then the cash or bank
   credited. Deliberately quiet — it is a check on the figures, not a form. */
.pv-entry { margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--line, #d7deec); border-radius: 8px; background: #fbfcfe; }
.pv-entry .lbl { font-size: 11px; font-weight: 700; color: #6b7689; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 4px; }
.pv-entry .entry-row { display: flex; gap: 10px; align-items: baseline; font-size: 13px; padding: 2px 0; }
.pv-entry .entry-row .dc { width: 26px; font-weight: 700; color: #1f3c88; }
.pv-entry .entry-row .acc { flex: 1; }
/* A paying bank with no chart account behind it. Said in red rather than left as the
   bank's own number, because a number that is not on the chart cannot be mapped to one. */
.pv-entry .entry-warn { color: #b3261e; font-style: normal; font-weight: 600; }
.pv-entry .entry-row .amt { font-variant-numeric: tabular-nums; }
.pv-entry .entry-row.is-cr { border-top: 1px solid var(--line, #d7deec); margin-top: 3px; padding-top: 5px; }
.pv-entry .entry-row.is-cr .dc { color: #b9760f; }
.pv-entry .entry-row.is-cr .acc { padding-left: 22px; }

/* ---------- Calendar ---------------------------------------------------------
   Three views over one month's worth of data: the month as a grid, a week and a day
   as hours. Everything is laid out in the page's own vocabulary — the same cards,
   lines and blues as the registers — so it reads as part of the portal rather than a
   calendar bolted onto it. */
.cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
/* Create is a button, not a banner: the page's primary button is a full-width block by
   default, which inside a flex bar swallows the whole row. */
.cal-bar > button, .cal-bar .btn-primary { flex: none; width: auto; }
.cal-nav { display: inline-flex; gap: 4px; }
.cal-nav button { min-width: 36px; font-size: 18px; line-height: 1; padding: 6px 10px; }
.cal-title { font-size: 22px; font-weight: 700; color: var(--navy); margin: 0 4px; }
.cal-views { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--white); }
.cal-view { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none;
  border: none; border-inline-end: 1px solid var(--line); padding: 8px 14px; cursor: pointer; }
.cal-view:last-child { border-inline-end: none; }
.cal-view.is-on { background: var(--navy); color: #fff; }
.cal-bar .inline-field { margin-inline-start: auto; }

.cal-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } }

/* The side rail: the month at a glance, and what is drawn on it. */
.cal-side { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cal-mini-head { display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); padding-bottom: 3px; }
.mini-day { font: inherit; font-size: 11.5px; line-height: 1; padding: 5px 0; border: none; border-radius: 6px;
  background: none; color: var(--ink); cursor: pointer; }
.mini-day:hover { background: var(--bg-1); }
.mini-day.is-other { color: #b6bfd0; }
.mini-day.is-today { font-weight: 800; color: var(--bright); }
.mini-day.is-on { background: var(--navy); color: #fff; }
.cal-legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.cal-legend label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
/* The division key is read, not ticked. */
.cal-legend .cal-key-row { cursor: default; }
.cal-note { font-size: 12px; line-height: 1.5; margin: 14px 0 0; }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* The palette an entry can be given, and the one the drawn-in dates use. */
.c-royal  { --cal-ink: #1f3c88; --cal-bg: #e8effc; --cal-edge: #b9cbee; }
.c-green  { --cal-ink: #14663f; --cal-bg: #e6f6ee; --cal-edge: #a8dcc3; }
.c-amber  { --cal-ink: #8a5a12; --cal-bg: #fdf3e2; --cal-edge: #e7cb96; }
.c-red    { --cal-ink: #9b2c20; --cal-bg: #fdecea; --cal-edge: #eeb3aa; }
.c-purple { --cal-ink: #5b2c86; --cal-bg: #f3ecfa; --cal-edge: #cdb6e6; }
.c-teal   { --cal-ink: #0d6b6b; --cal-bg: #e4f5f4; --cal-edge: #a6dbd8; }
.c-grey   { --cal-ink: #4a5468; --cal-bg: #eef1f6; --cal-edge: #ccd4e2; }
.cal-dot { background: var(--cal-ink, var(--royal)); }

/* The month. */
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--white);
  border: 1px solid var(--line); border-bottom: none; border-radius: 12px 12px 0 0; }
.cal-dow-cell { padding: 9px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted); text-align: center; }
/* minmax(0, 1fr), not 1fr: a long entry title otherwise widens the day it falls on and
   the seven columns stop being seven equal days. */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(104px, auto);
  background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: 0 0 12px 12px; overflow: hidden; }
.cal-cell { background: var(--white); padding: 6px 7px; min-height: 104px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; }
.cal-cell:hover { background: #f8faff; }
.cal-cell.is-other { background: #fafbfe; }
.cal-cell.is-other .cal-daynum { color: #b6bfd0; }
.cal-cell.is-today .cal-daynum { background: var(--navy); color: #fff; }
.cal-daynum { align-self: flex-start; font-size: 12.5px; font-weight: 700; color: var(--ink);
  min-width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { font-size: 11.5px; line-height: 1.35; padding: 3px 6px; border-radius: 5px;
  background: var(--cal-bg, #e8effc); color: var(--cal-ink, #1f3c88);
  border-inline-start: 3px solid var(--cal-ink, #1f3c88);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A drawn-in date is somebody else's record, shown here: outlined, not filled, so it never
   reads as something typed into this calendar. */
.cal-chip.is-feed { background: transparent; border: 1px solid var(--cal-edge, #b9cbee);
  border-inline-start: 3px solid var(--cal-ink, #1f3c88); }
.cal-chip .t { font-weight: 700; }
.cal-more { font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); background: none;
  border: none; padding: 1px 4px; cursor: pointer; text-align: start; }
.cal-more:hover { color: var(--navy); text-decoration: underline; }

/* The week and the day, as hours. */
.cal-time-head { display: grid; grid-template-columns: 58px repeat(var(--cal-days, 7), minmax(0, 1fr));
  background: var(--white); border: 1px solid var(--line); border-bottom: none; border-radius: 12px 12px 0 0; }
.cal-time-day { padding: 8px 6px; text-align: center; font-size: 12px; color: var(--muted); }
.cal-time-day .num { font-size: 16px; font-weight: 700; color: var(--ink); display: block; }
.cal-time-day.is-today .num { color: #fff; background: var(--navy); border-radius: 50%;
  width: 28px; height: 28px; line-height: 28px; margin: 2px auto 0; }
.cal-time-wrap { display: grid; grid-template-columns: 58px minmax(0, 1fr); background: var(--white);
  border: 1px solid var(--line); border-radius: 0 0 12px 12px; max-height: 62vh; overflow: auto; }
.cal-hours { border-inline-end: 1px solid var(--line); }
.cal-hour { height: 48px; font-size: 11px; color: var(--muted); text-align: end; padding-inline-end: 6px; }
.cal-hour span { position: relative; top: -6px; }
.cal-cols { display: grid; grid-template-columns: repeat(var(--cal-days, 7), minmax(0, 1fr)); }
.cal-col { border-inline-start: 1px solid var(--line); }
.cal-col:first-child { border-inline-start: none; }
/* The whole-day band sits in the head, above the hour rails and outside their scroll, so
   the hour labels stay level with the columns whatever the band is holding. */
.cal-allday { min-height: 24px; padding: 3px; display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line);
  background: #fbfcfe; cursor: pointer; }
.cal-time-head .cal-time-corner:nth-of-type(2) { border-top: 1px solid var(--line); background: #fbfcfe; }
.cal-slots { position: relative; height: 1152px; }        /* 24 hours × 48px */
.cal-slot { height: 48px; border-bottom: 1px solid #eef1f7; }
.cal-slot:nth-child(even) { background: #fcfdff; }
.cal-block { position: absolute; inset-inline: 3px; overflow: hidden; padding: 3px 6px; border-radius: 6px;
  font-size: 11.5px; line-height: 1.3; cursor: pointer;
  background: var(--cal-bg, #e8effc); color: var(--cal-ink, #1f3c88);
  border-inline-start: 3px solid var(--cal-ink, #1f3c88); }
.cal-block strong { display: block; font-weight: 700; }
.cal-block.is-feed { background: transparent; border: 1px solid var(--cal-edge, #b9cbee);
  border-inline-start: 3px solid var(--cal-ink, #1f3c88); }

/* One day, listed. */
.cal-day-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.cal-day-row[data-id] { cursor: pointer; }
.cal-day-row[data-id]:hover { background: var(--bg-1); }
.cal-day-main { flex: 1; min-width: 0; }
.cal-day-title { font-weight: 600; color: var(--ink); }
.cal-day-row .muted { font-size: 12px; }

/* "All day" is a tick, not a field with a box drawn round it. */
.form-grid label.check-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.form-grid label.check-row input { width: auto; }

/* The chart of accounts reads on two levels: a heading account, and the accounts that sit
   under it. Flat, ninety-odd rows all look equally important, which none of them are. */
/* A heading account is set in navy and sits on its own tint; the accounts under it are
   stepped to the right, each level further in, with a rule drawn down the step so the eye
   follows the branch rather than counting spaces. */
.coa-parent td:first-child, .coa-parent td:nth-child(2) { font-weight: 700; color: var(--navy); }
.coa-parent { background: #f4f8ff; }
.coa-parent[style*="--coa-depth:0"] td { border-top: 1px solid #cfdcf2; }
.coa-parent td:first-child, .coa-child td:first-child {
  padding-inline-start: calc(18px + var(--coa-depth, 0) * 30px); position: relative; }
/* The elbow into the row, and the trunk it hangs from. */
.coa-child td:first-child::before, .coa-parent:not([style*="--coa-depth:0"]) td:first-child::before {
  content: ''; position: absolute; top: 0; bottom: 50%;
  inset-inline-start: calc(var(--coa-depth, 0) * 30px - 12px);
  width: 12px; border-inline-start: 1px solid #c2cee4; border-bottom: 1px solid #c2cee4;
  border-end-start-radius: 4px; }
/* The trunk carries on past a row that has more accounts beneath it. */
.coa-child td:first-child::after, .coa-parent:not([style*="--coa-depth:0"]) td:first-child::after {
  content: ''; position: absolute; top: 50%; bottom: 0;
  inset-inline-start: calc(var(--coa-depth, 0) * 30px - 12px);
  border-inline-start: 1px solid #c2cee4; }
.coa-last td:first-child::after { display: none; }
.coa-child td:first-child { color: var(--ink); }

/* ---------- Sales: division logos ------------------------------------------
   Each division trades under its own mark, kept here and printed at the head of
   everything that division sends out. */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 12px 0 24px; }
.logo-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; }
.logo-frame { height: 92px; display: flex; align-items: center; justify-content: center;
  background: #fbfcfe; border: 1px dashed #ccd4e2; border-radius: 9px; overflow: hidden; }
.logo-frame img { max-height: 76px; max-width: 100%; object-fit: contain; }
.logo-name { font-weight: 700; color: var(--navy); }
.logo-title { font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; width: 100%; }
.logo-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.logo-pick { cursor: pointer; }
/* A next action whose date has passed. */
.overdue { color: var(--danger); font-weight: 600; }
/* Who sells what: a row of divisions per person. */
.sell-ticks { display: flex; flex-wrap: wrap; gap: 12px; }
.sell-tick { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }

/* ---------- A dropdown you can type into --------------------------------------
   The account list is ninety-odd long and every account begins with its number, so a
   plain dropdown's type-to-jump never finds "petty". The box in front of the list
   filters on any part of the number or the name. */
.ss-wrap { position: relative; width: 100%; }
.ss-hidden { display: none !important; }
.ss-input { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line, #d7deec); border-radius: 7px; background: #fff; }
.ss-input:focus { outline: 2px solid #1f3c88; outline-offset: 1px; }
.ss-list { position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + 2px);
  max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; box-shadow: 0 12px 30px rgba(22, 35, 122, 0.16); padding: 4px; }
.ss-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); padding: 7px 8px 3px; }
.ss-item { padding: 6px 9px; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.ss-item:hover, .ss-item.is-on { background: var(--bg-1); color: var(--navy); }
.ss-item.ss-add { color: var(--royal); font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; }
.ss-none { padding: 9px; font-size: 13px; color: var(--muted); }

/* The kind of account, in front of its name: an expense and a bank account look alike
   until you know which is which, and reading it across the row loses the tree. */
.coa-type { display: inline-block; width: 84px; margin-inline-end: 10px; padding: 1px 6px;
  border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; text-align: center; vertical-align: 1px; }
.ct-bank       { background: #e8effc; color: #1f3c88; }
.ct-receivable { background: #e4f5f4; color: #0d6b6b; }
.ct-payable    { background: #fdf3e2; color: #8a5a12; }
.ct-asset      { background: #eef7ff; color: #1c5b8f; }
.ct-fixed      { background: #e6f6ee; color: #14663f; }
.ct-liability  { background: #fdecea; color: #9b2c20; }
.ct-equity     { background: #f3ecfa; color: #5b2c86; }
.ct-income     { background: #e6f6ee; color: #14663f; }
.ct-cogs       { background: #fdf3e2; color: #8a5a12; }
.ct-expense    { background: #f7ece6; color: #8a4b24; }
.ct-other      { background: #eef1f6; color: #4a5468; }
/* It is a dropdown, and says so: the caret is there whether or not anything is typed. */
.ss-input { padding-inline-end: 26px; }
.ss-caret { position: absolute; inset-inline-end: 9px; top: 50%; width: 0; height: 0; margin-top: -2px;
  border-inline-start: 4px solid transparent; border-inline-end: 4px solid transparent;
  border-top: 5px solid #6b7689; pointer-events: auto; cursor: pointer; }
.ss-wrap.is-open .ss-caret { border-top-color: var(--navy); transform: rotate(180deg); }
