/* Miss Helpers brand: navy #2E2B80 + coral #FFA19C */
:root {
  color-scheme: light;
  --navy: #2e2b80;
  --coral: #ffa19c;
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-2: #f1f0f8;
  --border: #e4e3f0;
  --text: #1b1a3d;
  --text-2: #55537a;
  --muted: #8b89a8;
  --brand: #2e2b80;
  --brand-2: #5a56b8;
  --brand-soft: #ecebf8;
  --on-brand: #ffffff;
  --accent: #ffa19c;
  --accent-soft: #fff0ef;
  --good: #1e7a3c;   --good-soft: #e5f4ea;
  --warn: #9a6200;   --warn-soft: #fcf1dc;
  --bad: #b3261e;    --bad-soft: #fbe7e5;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --shadow: 0 1px 2px rgba(46,43,128,.06), 0 4px 16px rgba(46,43,128,.05);
  --radius: 12px;
  --side-bg: #2e2b80;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12112a; --surface: #1b1a3a; --surface-2: #242349; --border: #33325e;
    --text: #f3f2fb; --text-2: #c7c5e2; --muted: #8f8db3;
    --brand: #ffa19c; --brand-2: #ffbcb8; --brand-soft: #3a2c4b; --on-brand: #2e2b80;
    --accent: #ffa19c; --accent-soft: #3a2c4b;
    --good: #5cc67e; --good-soft: #1a2e2a; --warn: #e3a93a; --warn-soft: #33290f; --bad: #f07d74; --bad-soft: #3a1e24;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --shadow: none;
    --side-bg: #17163a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12112a; --surface: #1b1a3a; --surface-2: #242349; --border: #33325e;
  --text: #f3f2fb; --text-2: #c7c5e2; --muted: #8f8db3;
  --brand: #ffa19c; --brand-2: #ffbcb8; --brand-soft: #3a2c4b; --on-brand: #2e2b80;
  --accent: #ffa19c; --accent-soft: #3a2c4b;
  --good: #5cc67e; --good-soft: #1a2e2a; --warn: #e3a93a; --warn-soft: #33290f; --bad: #f07d74; --bad-soft: #3a1e24;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --shadow: none;
  --side-bg: #17163a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* Arabic text: Thmanyah Sans (files in public/thmanyah typeface, kept out of git — its licence forbids redistributing them); Latin stays Montserrat.
   No 600 file: the browser uses Bold for semibold. IBM Plex Sans Arabic stays as the fallback. */
@font-face { font-family: "Thmanyah Sans"; font-weight: 300; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
  src: local("Thmanyah Sans Light"), url("thmanyah%20typeface/thmanyahsans/woff2/thmanyahsans-Light.woff2") format("woff2"), url("thmanyah%20typeface/thmanyahsans/otf/thmanyahsans-Light.otf") format("opentype"); }
@font-face { font-family: "Thmanyah Sans"; font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
  src: local("Thmanyah Sans Regular"), url("thmanyah%20typeface/thmanyahsans/woff2/thmanyahsans-Regular.woff2") format("woff2"), url("thmanyah%20typeface/thmanyahsans/otf/thmanyahsans-Regular.otf") format("opentype"); }
@font-face { font-family: "Thmanyah Sans"; font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
  src: local("Thmanyah Sans Medium"), url("thmanyah%20typeface/thmanyahsans/woff2/thmanyahsans-Medium.woff2") format("woff2"), url("thmanyah%20typeface/thmanyahsans/otf/thmanyahsans-Medium.otf") format("opentype"); }
@font-face { font-family: "Thmanyah Sans"; font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
  src: local("Thmanyah Sans Bold"), url("thmanyah%20typeface/thmanyahsans/woff2/thmanyahsans-Bold.woff2") format("woff2"), url("thmanyah%20typeface/thmanyahsans/otf/thmanyahsans-Bold.otf") format("opentype"); }
@font-face { font-family: "Thmanyah Sans"; font-weight: 900; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
  src: local("Thmanyah Sans Black"), url("thmanyah%20typeface/thmanyahsans/woff2/thmanyahsans-Black.woff2") format("woff2"), url("thmanyah%20typeface/thmanyahsans/otf/thmanyahsans-Black.otf") format("opentype"); }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Montserrat", "Thmanyah Sans", "IBM Plex Sans Arabic", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.hidden { display: none !important; }
[dir="ltr"], .ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 8px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; letter-spacing: .5px; }

label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
.error { color: var(--bad); min-height: 1em; margin: 0; font-size: 13px; }

.btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 14px; min-height: 38px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.link { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 6px 0; text-align: start; }
.link:hover { color: var(--brand); }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100%; }
.sidebar { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.nav-scrim { display: none; } /* the phone menu's dimmed page (shown under 800px) */
nav { display: grid; gap: 2px; flex: 1; align-content: start; }
nav .group { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 14px 10px 4px; }
nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; }
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a.active { background: var(--brand-soft); color: var(--brand); }
nav a .badge { background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }
.sidebar-foot { display: grid; border-top: 1px solid var(--border); padding-top: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 19px; margin: 0; flex: 1; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }
.view { padding: 20px 24px 40px; display: grid; gap: 18px; align-content: start; }

/* ---------- cards / tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h2 small { color: var(--muted); font-weight: 400; font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { color: var(--text-2); font-size: 13px; }
.tile .value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: 12px; }
.tile.accent { border-top: 3px solid var(--brand); }
.tile.bad .value { color: var(--bad); }
.tile.good .value { color: var(--good); }
.leads-tiles { margin-bottom: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .leads-tiles { grid-template-columns: repeat(2, 1fr); } }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.chart-box { position: relative; height: 300px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filters > * { flex: 0 1 auto; }
.filters input[type="search"] { min-width: 240px; flex: 1 1 240px; }
.filters select, .filters input[type="month"], .filters input[type="date"] { width: auto; min-width: 130px; }
.filters .count { color: var(--muted); font-size: 13px; margin-inline-start: auto; align-self: center; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 12px; text-align: start; white-space: nowrap; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 600; color: var(--text-2); position: sticky; top: 0; cursor: pointer; user-select: none; }
th.nosort { cursor: default; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
tfoot td { font-weight: 700; background: var(--surface-2); }
td.num, th.num { text-align: end; }
td.wrap { white-space: normal; min-width: 200px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

.pill { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); }
.pill.new { background: var(--brand-soft); color: var(--brand); }
.pill.rf-switch { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.pill.rf-switch:hover { outline: 1px solid currentColor; }
.pill.rf-dup { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-weight: 700; margin-inline-start: 4px; cursor: help; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pay-sel.good, .pay-sel.good + .dd-btn { background: var(--good-soft); color: var(--good); font-weight: 600; }
.pay-sel.warn, .pay-sel.warn + .dd-btn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.visa { background: color-mix(in srgb, #3b82f6 16%, transparent); color: #3b82f6; } /* With Visa — blue, apart from Available's green */
.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar-cell .bar { height: 8px; border-radius: 4px; background: var(--brand-2); min-width: 2px; }

/* ---------- modal ---------- */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(10,10,15,.45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-content { padding: 18px 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.req::after { content: " *"; color: var(--bad); }
.modal-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.modal-foot .spacer { flex: 1; }
.history { margin-top: 16px; font-size: 12px; color: var(--text-2); display: grid; gap: 6px; }
.history div { border-inline-start: 2px solid var(--border); padding-inline-start: 10px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--bad); color: #fff; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-inline-end: 6px; vertical-align: -1px; }

@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: min(300px, 84vw); z-index: 20; transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow); overscroll-behavior: contain; }
  /* the dimmed page behind the open menu: a tap closes it */
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(10,10,15,.45); opacity: 0; pointer-events: none; transition: opacity .22s; }
  .nav-scrim.on { opacity: 1; pointer-events: auto; }
  body.nav-locked { overflow: hidden; }
  .sidebar.open { transform: none; }
  .menu-btn { display: block; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .view { padding: 16px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters input[type="search"] { min-width: 0; }
  .tile .value { font-size: 24px; }
}

/* ---------- return flow ---------- */
.btn.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.btn.warn:hover { filter: brightness(1.05); }
.banner { background: var(--brand-soft); color: var(--text); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.banner.bad { background: var(--bad-soft); }
.banner.warn { background: var(--warn-soft); }
.banner .link { color: var(--brand); font-weight: 600; padding: 0; }
tr.returned td { color: var(--muted); }
.pill.tiny { font-size: 10px; padding: 1px 6px; vertical-align: middle; }

/* ---------- segmented controls ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.small button { padding: 4px 10px; font-size: 13px; }

/* ---------- deltas & sparklines ---------- */
.delta { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 8px; direction: ltr; unicode-bidi: isolate; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--surface-2); color: var(--muted); }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-fill { fill: color-mix(in srgb, var(--brand-2) 14%, transparent); }
.spark-dot { fill: var(--brand-2); stroke: var(--surface); stroke-width: 2; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 22px 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--surface)), var(--surface) 60%); }
.eyebrow { color: var(--text-2); font-size: 13px; font-weight: 500; }
.hero-num { font-size: 52px; font-weight: 700; line-height: 1.1; margin: 6px 0; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.hero-num span { font-size: 18px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.hero-sub { color: var(--text-2); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero .legend { margin: 10px 0 0; }
.hero .legend b { color: var(--text); margin-inline-start: 4px; }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.mini .label { font-size: 12px; color: var(--text-2); }
.mini .val { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mini .delta { justify-self: start; }

.stackbar { display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: hidden; margin-top: 12px; background: var(--surface-2); }
.stackbar.big { height: 14px; margin-top: 18px; }
.stackbar i { background: var(--c); min-width: 3px; }

/* ---------- awards ---------- */
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.award { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.award-ico { font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; flex: none; }
.award small { display: block; color: var(--text-2); font-size: 12px; }
.award b { display: block; font-size: 16px; }
.award .num { font-size: 12px; color: var(--muted); }

/* ---------- leaderboard ---------- */
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.section-head h2 { font-size: 17px; margin: 0; flex: 1; }
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lead-card { text-align: start; font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; transition: transform .12s, border-color .12s; }
.lead-card:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.lead-top { display: flex; align-items: center; gap: 10px; }
.lead-top .who { flex: 1; min-width: 0; }
.lead-top .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-top .who small { color: var(--muted); font-size: 12px; }
.lead-top .spark { width: 90px; height: 30px; }
.rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); flex: none; }
.rank.r1 { background: #f5c542; color: #4a3500; }
.rank.r2 { background: #cfd4dc; color: #2d3440; }
.rank.r3 { background: #e0a47a; color: #4a2a12; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; direction: ltr; }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; vertical-align: middle; }
.lead-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lead-nums > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.lead-nums .big { font-size: 24px; font-weight: 700; line-height: 1.15; }
.lead-nums .big.neg { color: var(--bad); }
.lead-nums small { color: var(--text-2); font-size: 12px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.lead-card .stackbar { margin-top: 0; height: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-2); }
.chips span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-inline-end: 5px; }
.chips b { color: var(--text); }

/* ---------- TOTAL heat table ---------- */
.heat td, .heat th { padding: 10px 12px; }
.heat td.num { font-weight: 500; }
.heat .strong { font-weight: 700; border-inline-start: 2px solid var(--border); }
.heat .sticky { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.heat thead .sticky, .heat tfoot .sticky { background: var(--surface-2); }
.note { color: var(--muted); font-size: 12px; margin: 0; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .hero-num { font-size: 40px; }
  .page-actions { width: 100%; overflow-x: auto; }
  .lead-grid { grid-template-columns: 1fr; }
}
.topbar h1 { white-space: nowrap; }
.page-actions select { width: auto; }
.page-actions select.on { border-color: var(--brand-2); color: var(--brand); }
.view > * { min-width: 0; }

/* ---------- shared bits ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.neg { color: var(--bad); }
.btn.block { width: 100%; min-height: 44px; font-size: 15px; }
.table-wrap.flat { border: 0; border-radius: 0; background: none; }
tbody tr.current td { background: var(--brand-soft); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-inline-end: 8px; }
.stars-ro { color: #e8a200; letter-spacing: 1px; }

/* ---------- KPI grid on sales cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kpi-grid > div { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 8px; padding: 5px 9px; font-size: 12px; color: var(--text-2); }
.kpi-grid b { font-size: 15px; color: var(--text); }
.kpi-grid .neg { background: var(--bad-soft); }
.kpi-grid .neg b { color: var(--bad); }
.kpi-grid .zero b { color: var(--muted); font-weight: 500; }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), var(--surface) 65%); }
.avatar.xl { width: 72px; height: 72px; border-radius: 20px; font-size: 24px; }
.ph-info { flex: 1; min-width: 220px; }
.ph-info h2 { margin: 0; font-size: 24px; }
.ph-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; color: var(--text-2); font-size: 13px; }
.ph-stats b { font-size: 18px; color: var(--text); margin-inline-end: 3px; }
.ph-stats b.neg { color: var(--bad); }
.ph-score { display: flex; align-items: center; gap: 12px; }
.grade { font-size: 22px; font-weight: 700; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring-num { font-size: 30px; font-weight: 700; text-anchor: middle; fill: var(--text); font-family: inherit; }
.ring-sub { font-size: 11px; text-anchor: middle; fill: var(--muted); font-family: inherit; }

.profile-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.side-col { display: grid; gap: 14px; }
.comm td { padding: 8px 10px; vertical-align: middle; }
.comm .big-n { font-size: 17px; font-weight: 700; }
.comm .amt { font-weight: 600; min-width: 90px; }
.comm tfoot td { font-size: 14px; }
.comm tr.neg-row td:first-child { color: var(--bad); }
.rate-in { display: flex; align-items: center; gap: 6px; max-width: 150px; }
.rate-in input { min-height: 34px; padding: 5px 8px; text-align: center; }
.rate-in input:disabled { background: var(--surface-2); color: var(--text); border-color: transparent; opacity: 1; }
.rate-in span { color: var(--muted); font-size: 12px; }

.payout { background: linear-gradient(135deg, color-mix(in srgb, var(--good) 16%, var(--surface)), var(--surface)); }
.payout-num { font-size: 40px; font-weight: 700; line-height: 1.15; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.payout-num span { font-size: 16px; color: var(--text-2); font-weight: 500; }
.payout-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }

.target-block { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.target-block:last-child { border-bottom: 0; padding-bottom: 0; }
.tb-head { display: flex; justify-content: space-between; align-items: baseline; }
.tb-head .num { font-size: 18px; font-weight: 700; }
.tb-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tb-edit input { min-height: 34px; padding: 5px 8px; }
.tb-edit input:disabled { background: var(--surface-2); border-color: transparent; color: var(--text); }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--warn); transition: width .3s; }
.progress.met i { background: var(--good); }
details summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 8px; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.checks input { width: auto; min-height: 0; }

.stars { display: flex; gap: 2px; direction: ltr; justify-content: flex-end; margin-bottom: 10px; }
.stars button { background: none; border: 0; font-size: 28px; line-height: 1; color: var(--border); padding: 0 2px; }
.stars.editable button { cursor: pointer; }
.stars button.on { color: #e8a200; }
.score-parts { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; }
.score-parts div { display: flex; justify-content: space-between; color: var(--text-2); }

.review { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; }

@media (max-width: 1000px) {
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .tb-edit { grid-template-columns: 1fr; }
}

/* ---------- per-item targets ---------- */
.ok { color: var(--good); }
.comm .amt .pill { font-size: 11px; margin-top: 2px; }
.comm .rate-in { max-width: 130px; }

/* ---------- review screenshots ---------- */
.label-like { font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.drop { border: 2px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-2); font-size: 13px; transition: .15s; }
.drop.over, .drop:focus { border-color: var(--brand-2); background: var(--brand-soft); outline: none; }
.drop .link { color: var(--brand); font-weight: 600; padding: 0; display: inline; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; cursor: zoom-in; display: block; }
.thumb button { position: absolute; top: 4px; inset-inline-end: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; }
.rv-list { display: grid; gap: 12px; align-content: start; }
.rv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
#p-reviews .rv-card { box-shadow: none; padding: 12px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
#p-reviews .rv-card:last-child { border-bottom: 0; }
.rv-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.rv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rv-notes { margin-top: 8px; color: var(--text-2); font-size: 13px; }
.rv-noimg { margin-top: 8px; font-size: 12px; color: var(--warn); }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5,5,10,.9); display: grid; place-items: center; padding: 50px 60px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-close { position: absolute; top: 14px; inset-inline-end: 16px; }
.lb-close, .lb-nav { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 42px; height: 42px; font-size: 20px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 30px; }
.lb-prev { inset-inline-start: 12px; } .lb-next { inset-inline-end: 12px; }
.lb-count { position: absolute; bottom: 14px; color: #ddd; font-size: 13px; }
.lb-count a { color: #fff; }
@media (max-width: 800px) { .lightbox { padding: 50px 8px; } }

.comm td, .comm th { padding: 7px 8px; }
.comm .rate-in { max-width: none; gap: 6px; }
.comm .rate-in input { flex: none; width: 70px; min-width: 70px; padding: 5px 6px; }
.comm .rate-in span { white-space: nowrap; }
.comm tr.info-row td:first-child, .comm tr.info-row td { color: var(--muted); }
.comm .big-n small { font-size: 12px; font-weight: 500; }
@media (max-width: 1300px) { .comm .prev-col { display: none; } }

/* ---------- attendance & payroll ---------- */
.att-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.att-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.att td { padding: 5px 6px; }
.att select, .att input { min-height: 32px; padding: 4px 6px; }
.att select { width: 92px; }
.att input[type="time"] { width: 112px; }
.att input[data-f="notes"] { min-width: 110px; }
.att input:disabled, .att select:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
.att tr.weekend td { background: var(--surface-2); }
.att tr.weekend td:first-child::after { content: " إجازة"; color: var(--muted); font-size: 11px; }
.att tr.is-absent td:first-child { box-shadow: inset calc(-3px * var(--dir, 1)) 0 var(--bad); }
.att tr.is-late td:first-child { box-shadow: inset calc(-3px * var(--dir, 1)) 0 var(--warn); }
.chk { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; cursor: pointer; }
.chk input { width: auto; min-height: 0; }
.net { background: linear-gradient(135deg, color-mix(in srgb, var(--s1) 14%, var(--surface)), var(--surface)); }
.net-lines { display: grid; gap: 6px; font-size: 13px; }
.net-lines div { display: flex; justify-content: space-between; }
.net-lines .neg b { color: var(--bad); } .net-lines .ok b { color: var(--good); }
.tb-edit small { font-weight: 400; }
.tb-edit.three { grid-template-columns: repeat(3, 1fr); }

.policy { display: grid; gap: 16px; max-width: 900px; }
.tier { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.tier input { width: 80px; min-height: 34px; text-align: center; }
.tier select { width: auto; min-height: 34px; }
.tier .icon-btn { width: 32px; height: 32px; }
#add-tier { margin-top: 10px; }
.examples { margin-top: 14px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; font-size: 13px; }
.checks.days { grid-template-columns: repeat(7, auto); justify-content: start; }

@media (max-width: 1100px) { .att-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .tb-edit.three { grid-template-columns: 1fr; } .checks.days { grid-template-columns: repeat(2, 1fr); } }
.kpi-grid .success { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 45%, transparent); }
.success-box { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 45%, transparent); }
/* stays a table cell (display: flex on a <td> made its divider line sit apart from the row's) */
.row-actions { white-space: nowrap; }
.row-actions > * { vertical-align: middle; }
.row-actions > * + * { margin-inline-start: 4px; }
.card h2 .btn.primary { margin-inline-start: auto; }
.big-chk { align-self: end; min-height: 38px; font-size: 15px; }
.big-chk input { width: 18px; height: 18px; }
.day-preview { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; min-height: 20px; font-size: 14px; }
.day-preview:empty { display: none; }

/* dashboard: extra series colours (validated reference palette slots 6–8) */
:root { --s6: #008300; --s7: #4a3aa7; --s8: #e34948; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s6: #008300; --s7: #9085e9; --s8: #e66767; } }
:root[data-theme="dark"] { --s6: #008300; --s7: #9085e9; --s8: #e66767; }
.legend.toggles { gap: 6px; }
.legend.toggles button { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 3px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.legend.toggles button::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-inline-end: 6px; vertical-align: -1px; }
.legend.toggles button.off { opacity: .45; text-decoration: line-through; }
.split-list { display: grid; gap: 8px; margin-top: 14px; }
.split-list div { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.split-list b { margin-inline-start: auto; font-size: 18px; }
.split-list small { width: 44px; text-align: end; }
.lead-nums { grid-template-columns: repeat(2, 1fr); }
.mini.wide { grid-column: 1 / -1; }
.mini.wide .spark { width: 100%; }

/* ---------- dashboard hero tiles (first 3) ---------- */
.hero-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hero-tile { position: relative; overflow: hidden; display: block; text-decoration: none; color: var(--text); border-radius: 16px; padding: 20px 22px 18px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border));
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 26%, var(--surface)) 0%, var(--surface) 75%);
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.hero-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 25%, transparent); }
.hero-tile::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 6px; background: var(--c); }
.hero-tile.h1 { --c: var(--s1); } .hero-tile.h2 { --c: var(--s2); } .hero-tile.h3 { --c: var(--s3); }
.hero-tile .label { font-size: 15px; font-weight: 600; color: var(--text); }
.hero-tile .value { font-size: 54px; font-weight: 700; line-height: 1.1; margin: 8px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.hero-tile .sub { color: var(--text-2); font-size: 13px; }
@media (max-width: 900px) { .hero-tiles { grid-template-columns: 1fr; } .hero-tile .value { font-size: 42px; } }

.hero-tiles { grid-template-columns: repeat(4, 1fr); }
.hero-tile.h4 { --c: var(--s4); }
@media (max-width: 1100px) { .hero-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hero-tiles { grid-template-columns: 1fr; } }

/* ---------- overdue renewals alert tile ---------- */
.alert-tile { grid-column: span 2; position: relative; display: grid; gap: 6px; text-decoration: none; color: var(--text); border-radius: var(--radius); padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--bad) 55%, var(--border));
  background: linear-gradient(140deg, color-mix(in srgb, var(--bad) 22%, var(--surface)), var(--surface) 80%);
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.alert-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-tile .label { font-size: 14px; font-weight: 600; }
.alert-badge { position: absolute; top: 12px; inset-inline-end: 12px; display: inline-flex; align-items: center; gap: 6px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 3px 10px; }
.alert-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.8); } 100% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }
@media (prefers-reduced-motion: reduce) { .alert-badge .pulse { animation: none; } }
.alert-body { display: flex; gap: 28px; }
.alert-body .value { font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--bad); font-variant-numeric: tabular-nums; }
.alert-body .value.soon { color: var(--warn); }
.alert-body .sub { color: var(--text-2); font-size: 12px; }
.alert-cta { font-size: 12px; font-weight: 600; color: var(--bad); }
.alert-tile.clear { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); background: linear-gradient(140deg, color-mix(in srgb, var(--good) 16%, var(--surface)), var(--surface) 80%); }
.alert-tile.clear .alert-badge { background: var(--good); }
.alert-tile.clear .alert-body .value:not(.soon), .alert-tile.clear .alert-cta { color: var(--good); }
@media (max-width: 600px) { .alert-tile { grid-column: auto; } }

/* row numbers + record count */
th.rownum, td.rownum { width: 1%; text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; padding-inline: 10px; border-inline-end: 1px solid var(--border); }
tbody tr:hover td.rownum { color: var(--brand); }
.filters .count { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand-2) 40%, transparent); border-radius: 12px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.filters .count b { font-size: 24px; line-height: 1; font-weight: 700; color: var(--brand); }
.filters .count span { color: var(--text-2); font-weight: 500; }
.ren-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ren-summary p { margin: 0; flex: 1 1 260px; }
.count-box { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand-2) 40%, transparent); border-radius: 12px; padding: 6px 14px; font-weight: 600; }
.count-box b { font-size: 26px; line-height: 1; color: var(--brand); }
.count-box span { color: var(--text-2); font-size: 13px; }
.ren-split { display: flex; gap: 6px; flex-wrap: wrap; }
.ren-split .pill { font-size: 13px; padding: 3px 10px; }
.ren-split b { margin-inline-start: 4px; }

/* ---------- roles & permissions ---------- */
.role-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.role-chips .role-chip { font-size: 13px; padding: 5px 12px; }
.role-chip b { color: var(--text); }
.role-chip.r-admin { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.role-chip.r-supervisor { background: color-mix(in srgb, var(--s1) 15%, var(--surface)); color: var(--s1); }
.role-chip.r-accountant { background: var(--good-soft); color: var(--good); }
.role-chip.r-cs { background: color-mix(in srgb, var(--s3) 15%, var(--surface)); color: var(--s3); }
.role-chip.r-sales { background: var(--warn-soft); color: var(--warn); }
.perm-matrix td, .perm-matrix th { padding: 9px 12px; }
.perm-matrix .center { text-align: center; }
.perm-matrix tr.grp td { background: var(--surface-2); font-weight: 700; font-size: 12px; color: var(--text-2); }
.perm-matrix input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; cursor: pointer; accent-color: var(--brand); }
#save-roles { margin-top: 4px; max-width: 320px; }
.comm.no-money th:nth-child(n+5), .comm.no-money td:nth-child(n+5), .comm.no-money tfoot { display: none; }

.role-chip.r-supply { background: color-mix(in srgb, var(--s2) 15%, var(--surface)); color: var(--s2); }
.role-chip.r-supply_admin { background: color-mix(in srgb, var(--s2) 30%, var(--surface)); color: var(--s2); font-weight: 700; }
.role-chip.r-hr { background: color-mix(in srgb, var(--s5) 16%, var(--surface)); color: var(--s5); }

/* ---------- Miss Helpers branding ---------- */
.btn.primary { color: var(--on-brand); }
.logo-img { display: block; height: auto; }
.logo-img.on-light { display: block; } .logo-img.on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img.on-light { display: none; } :root:not([data-theme="light"]) .logo-img.on-dark { display: block; } }
:root[data-theme="dark"] .logo-img.on-light { display: none; } :root[data-theme="dark"] .logo-img.on-dark { display: block; }

/* login */
.login { background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--coral) 22%, transparent), transparent 70%), var(--bg); }
.login-card { border-top: 4px solid var(--coral); }
.login-logo { display: grid; justify-items: center; gap: 6px; margin-bottom: 10px; }
.login-logo .logo-img { width: 220px; }
.login-logo small { color: var(--muted); font-size: 13px; }

/* sidebar: brand navy with the white logo */
.sidebar { background: var(--side-bg); border-inline-end: 0; color: #fff; }
.side-logo { display: block; padding: 4px 6px 0; }
.side-logo img { width: 170px; }
.side-user { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.07); border-radius: 12px; padding: 8px 10px; }
.side-user .avatar { background: var(--coral); color: var(--navy); width: 34px; height: 34px; border-radius: 10px; }
.side-user b { display: block; font-size: 14px; color: #fff; }
.side-user small { color: rgba(255,255,255,.6); font-size: 12px; }
.sidebar nav .group { color: rgba(255,255,255,.45); }
.sidebar nav a { color: rgba(255,255,255,.78); position: relative; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: rgba(255,161,156,.16); color: var(--coral); }
.sidebar nav a.active::before { content: ""; position: absolute; inset-block: 8px; inset-inline-start: -14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--coral); }
.sidebar nav a .badge { background: var(--coral); color: var(--navy); font-weight: 700; }
.sidebar-foot { border-top-color: rgba(255,255,255,.12); }
.sidebar-foot .link { color: rgba(255,255,255,.7); }
.sidebar-foot .link:hover { color: var(--coral); }
.sidebar::-webkit-scrollbar { width: 6px; } .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 6px; }

/* topbar accent + brand touches */
.topbar { box-shadow: inset 0 -1px 0 var(--border); border-bottom: 0; }
.topbar h1 { color: var(--text); }
.topbar h1::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); margin-inline-start: 8px; vertical-align: middle; }
.tile.accent { border-top-color: var(--coral); }
.seg button.on { box-shadow: inset 0 -2px 0 var(--coral), 0 1px 3px rgba(0,0,0,.12); }
input:focus, select:focus, textarea:focus { outline-color: var(--coral); }
.spark-line { stroke: var(--coral); } .spark-fill { fill: color-mix(in srgb, var(--coral) 18%, transparent); } .spark-dot { fill: var(--coral); }
.bar-cell .bar { background: var(--coral); }
.avatar { background: var(--accent-soft); color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: var(--coral); } }
:root[data-theme="dark"] .avatar { color: var(--coral); }
.shell .sidebar .side-user .avatar { background: var(--coral); color: var(--navy); }

/* ---------- security ---------- */
.gate-card { max-width: 440px; }
.gate-card h2 { margin: 0; font-size: 18px; text-align: center; }
.pw-form { display: grid; gap: 12px; }
.pw-form small { font-weight: 400; }
.code-input { font-size: 26px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.twofa-setup { display: grid; gap: 12px; }
.twofa-setup ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--text-2); }
.twofa-setup .qr { justify-self: center; width: 190px; background: #fff; border-radius: 12px; padding: 8px; }
.twofa-setup .qr svg { display: block; width: 100%; height: auto; }
.secret { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: 13px; user-select: all; }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.sidebar-foot a.link { text-decoration: none; }
@media (max-width: 900px) { .sec-grid { grid-template-columns: 1fr; } }
.link.inline { display: inline; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; }

/* English names read left-to-right, aligned left */
th.en, td.en { direction: ltr; text-align: left; unicode-bidi: isolate; }
input[name="sponsor_name"], input[name="housemaid_name"], input[name="replacement_for"] { text-align: left; }

/* ---------- Ads ---------- */
.spend-table td { padding: 6px 8px; vertical-align: middle; }
.spend-table input { width: 92px; min-height: 32px; padding: 4px 8px; text-align: center; font-variant-numeric: tabular-nums; }
.spend-table input:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
.ad-save { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; }
.ad-tiles .value { font-size: 24px; }
.print-head { display: none; }

/* print / PDF: report only */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff !important; color: #000; }
  .sidebar, .topbar, .ad-save, .menu-btn, .toast { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; }
  .card, .tile { box-shadow: none !important; border-color: #ccc !important; background: #fff !important; break-inside: avoid; }
  .print-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
  .print-head img { height: 44px; }
  .print-head b { display: block; font-size: 18px; color: #2e2b80; }
  .spend-table input { border: 0 !important; background: transparent !important; }
  .chart-box { height: 220px !important; }
}

/* ---------- Ads table: centered, readable, strong total ---------- */
.spend-table th, .spend-table td { text-align: center !important; }
.spend-table th:first-child, .spend-table td:first-child { text-align: start !important; }
.spend-table th { font-size: 13px; color: var(--text); white-space: nowrap; padding: 10px 8px; }
.spend-table td { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.spend-table td:first-child { font-size: 14px; }
.spend-table input { width: 100px; margin: 0 auto; display: block; font-size: 15px; font-weight: 600; color: var(--text); text-align: center; }
.spend-table input:disabled { color: var(--text); }
.spend-table td[data-o="cpl"], .spend-table td[data-o="cpc"] { color: var(--text); }
.spend-table .bar-cell { justify-content: center; }
.contracts-badge { display: inline-block; min-width: 44px; padding: 3px 10px; border-radius: 99px; font-size: 16px; font-weight: 700;
  background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.contracts-badge.zero { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.spend-table tfoot td { background: var(--brand) !important; color: var(--on-brand) !important; font-size: 16px; font-weight: 700; padding: 12px 8px; border: 0; }
.spend-table tfoot td:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.spend-table tfoot td:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.spend-table tfoot .contracts-badge.total { background: var(--coral); color: var(--navy); border-color: transparent; font-size: 17px; }
@media print { .spend-table tfoot td { background: #2e2b80 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.spend-table tfoot .contracts-badge.total { background: var(--on-brand); color: var(--brand); }
.spend-table input { width: 88px; }

/* ---------- "Classic dark": the original grey + purple dark theme ---------- */
:root[data-theme="dark-classic"] {
  color-scheme: dark;
  --bg: #121214; --surface: #1b1b1e; --surface-2: #242428; --border: #2f2f35;
  --text: #f2f2f4; --text-2: #c3c2c9; --muted: #8b8a93;
  --brand: #a58ff0; --brand-2: #b9a7f5; --brand-soft: #2a2440; --on-brand: #16161a;
  --accent: #a58ff0; --accent-soft: #2a2440; --coral: #a58ff0; --navy: #16161a;
  --good: #5cc67e; --good-soft: #1a2e21; --warn: #e3a93a; --warn-soft: #33290f; --bad: #f07d74; --bad-soft: #3a1e1c;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --shadow: none;
  --side-bg: #1b1b1e;
}
:root[data-theme="dark-classic"] .logo-img.on-light { display: none; }
:root[data-theme="dark-classic"] .logo-img.on-dark { display: block; }
:root[data-theme="dark-classic"] .avatar { color: var(--brand); }
:root[data-theme="dark-classic"] .sidebar { border-inline-end: 1px solid var(--border); }
:root[data-theme="dark-classic"] .sidebar nav a { color: var(--text-2); }
:root[data-theme="dark-classic"] .sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
:root[data-theme="dark-classic"] .sidebar nav a.active { background: var(--brand-soft); color: var(--brand); }
:root[data-theme="dark-classic"] .sidebar nav a.active::before { background: var(--brand); }
:root[data-theme="dark-classic"] .sidebar nav a .badge { background: var(--bad); color: #fff; }
:root[data-theme="dark-classic"] .side-user { background: var(--surface-2); }
:root[data-theme="dark-classic"] .login { background: var(--bg); }
:root[data-theme="dark-classic"] .login-card { border-top-color: var(--brand); }
:root[data-theme="dark-classic"] .topbar h1::after { background: var(--brand); }
:root[data-theme="dark-classic"] .hero-tile.h1, :root[data-theme="dark-classic"] .hero-tile.h2,
:root[data-theme="dark-classic"] .hero-tile.h3, :root[data-theme="dark-classic"] .hero-tile.h4 { background: var(--surface); }

/* theme picker in the sidebar */
.theme-pick { display: grid; gap: 4px; margin-bottom: 6px; font-size: 12px; color: rgba(255,255,255,.6); }
.theme-pick select { min-height: 32px; padding: 4px 8px; font-size: 13px; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.15); }
.theme-pick select option { color: #000; }
.login-prefs { position: fixed; top: 12px; inset-inline-start: 12px; display: flex; gap: 10px; z-index: 2; }
.login .theme-pick { color: var(--muted); width: 170px; }
.login .theme-pick select { background: var(--surface); color: var(--text); border-color: var(--border); }

/* ---------- mobile lines: monthly bill + paid button ---------- */
.mob-grid { grid-template-columns: 2.4fr 1fr; }
.mob-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mob-table td { vertical-align: middle; padding: 7px 8px; }
.mob-table th, .mob-table td:nth-child(5), .mob-table td:nth-child(6), .mob-table td:nth-child(7) { text-align: center; }
.mob-table tfoot td { text-align: center; font-weight: 700; }
.bill-in { width: 96px; min-height: 32px; padding: 4px 8px; text-align: center; font-weight: 600; margin: 0 auto; display: block; }
.bill-in:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
.bill-in:placeholder-shown { color: var(--muted); }
.pay-btn { min-width: 104px; min-height: 34px; border-radius: 99px; border: 1.5px dashed var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; cursor: pointer; padding: 3px 12px; line-height: 1.15; }
.pay-btn:hover:not(:disabled) { border-color: var(--good); color: var(--good); }
.pay-btn.paid { border: 1.5px solid color-mix(in srgb, var(--good) 45%, transparent); background: var(--good-soft); color: var(--good); }
.pay-btn.paid small { display: block; font-size: 10px; font-weight: 500; opacity: .85; }
.pay-btn:disabled { cursor: default; }
.mob-table tr.is-paid td:not(:last-child) { opacity: .85; }
.icon-btn.sm { width: 30px; height: 30px; font-size: 14px; }
@media (max-width: 1100px) { .mob-grid { grid-template-columns: 1fr; } }

/* ---------- subscriptions ---------- */
.subs-table td { vertical-align: middle; }
.subs-table tr.due-soon td:first-child { box-shadow: inset calc(-3px * var(--dir, 1)) 0 var(--warn); }
.subs-table td .muted.small { display: block; margin-top: 2px; }

/* payroll: separator before non-sales staff */
tr.group-start td { border-top: 2px solid var(--border); }

/* ---------- Monthly applicants ---------- */
.pivot th, .pivot td { text-align: center; }
.pivot th:first-child, .pivot td:first-child { text-align: start; }
.pivot tfoot td { background: var(--brand) !important; color: var(--on-brand) !important; font-weight: 700; }
.pivot td.muted { color: var(--muted); }
.hero-tile .sub { font-variant-numeric: tabular-nums; }
.apl-table td { vertical-align: middle; }
.exit-box { background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; }
.ad2-table td { vertical-align: middle; text-align: center; }
.ad2-table td.en, .ad2-table th.en { text-align: left; }
.pay-pair { white-space: nowrap; }
.pay-pair .pay-btn { min-width: 86px; margin-inline: 2px; }
.pay-btn.rej:hover { border-color: var(--bad); color: var(--bad); }
.pay-btn.rej.on { border: 1.5px solid color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); color: var(--bad); }
.rem-in { min-height: 30px; padding: 3px 8px; min-width: 140px; }
.rem-in:disabled { background: transparent; border-color: transparent; color: var(--text); }
.clickable-name { cursor: pointer; text-decoration: underline dotted; }
a.tile { text-decoration: none; color: inherit; }

/* ---------- Applicants attendance ---------- */
.grid-2.even { grid-template-columns: 1fr 1fr; }
.rs-table td { vertical-align: middle; }
.pivot h2 small, .card h2 small { font-weight: 400; }
@media (max-width: 1000px) { .grid-2.even { grid-template-columns: 1fr; } }

/* ---------- KPI cards (clickable filters) ---------- */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi-card { display: grid; gap: 4px; text-align: start; font: inherit; color: var(--text); cursor: pointer; background: var(--surface);
  border: 1px solid var(--border); border-inline-start: 5px solid var(--c); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, background .12s; min-height: 108px; align-content: start; }
.kpi-card:hover:not(.static) { transform: translateY(-2px); box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 22%, transparent); }
.kpi-card.static { cursor: default; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 14%, var(--surface)), var(--surface) 70%); }
.kpi-card.on { background: color-mix(in srgb, var(--c) 14%, var(--surface)); box-shadow: 0 0 0 2px var(--c); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi-value { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--c); }
.kpi-card.static .kpi-value { color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--muted); }

/* ---------- English (left-to-right) layout ---------- */
html[dir="ltr"] { --dir: -1; }
html[lang="en"] body { font-family: "Montserrat", system-ui, sans-serif; }
@media (max-width: 800px) {
  html[dir="ltr"] .sidebar { inset: 0 auto 0 0; transform: translateX(-100%); }
  html[dir="ltr"] .sidebar.open { transform: none; }
}
/* appearance and language: each label on its own small line above a full-width list, so no label ("Appearance") or choice
   ("Dark — Miss Helpers") gets squeezed in either language */
.side-prefs { display: grid; gap: 10px; margin-bottom: 10px; }
.side-prefs .theme-pick { grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; min-width: 0; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.side-prefs .theme-pick .dd-btn, .side-prefs .theme-pick select { min-width: 0; width: 100%; }
@media (max-width: 520px) { .login-prefs { flex-direction: column; gap: 4px; } }

/* ---------- sidebar folders ---------- */
nav#nav { gap: 4px; }
.sidebar nav .nav-top { display: flex; align-items: center; justify-content: flex-start; gap: 10px; font-weight: 600; }
.nav-ico { width: 22px; text-align: center; flex: none; font-size: 15px; line-height: 1; }
.nav-sec { border-radius: 10px; }
.nav-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 10px; background: none;
  color: rgba(255,255,255,.85); font: inherit; font-weight: 600; cursor: pointer; text-align: start; }
.nav-head:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-head:focus-visible { outline: 2px solid var(--coral); outline-offset: -2px; }
.nav-title { flex: 1; min-width: 0; }
.nav-count { font-size: 11px; color: rgba(255,255,255,.45); font-weight: 500; }
.nav-head .badge { background: var(--coral); color: var(--navy); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; }
.chev { width: 8px; height: 8px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .55;
  transform: rotate(45deg); transition: transform .2s; margin-inline-start: 2px; margin-top: -3px; flex: none; }
.nav-sec.open .chev { transform: rotate(225deg); margin-top: 3px; }
.nav-sec.has-active > .nav-head { color: var(--coral); }
.nav-sec.open { background: rgba(255,255,255,.05); }
/* smooth open/close without measuring heights */
.nav-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-sec.open .nav-items { grid-template-rows: 1fr; }
.nav-items > div { overflow: hidden; display: grid; gap: 1px; padding-inline-start: 18px; }
.nav-sec.open .nav-items > div { padding-bottom: 6px; }
.sidebar nav .nav-items a { padding: 7px 10px; font-size: 13.5px; border-inline-start: 1px solid rgba(255,255,255,.14); border-radius: 0 8px 8px 0; }
html[dir="rtl"] .sidebar nav .nav-items a { border-radius: 8px 0 0 8px; }
.sidebar nav .nav-items a.active::before { inset-inline-start: -1px; inset-block: 6px; width: 3px; }
.nav-sub { font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 8px 10px 3px; }
@media (prefers-reduced-motion: reduce) { .nav-items, .chev { transition: none; } }
/* groups of folders under small headings (Sales · Housemaids · Finance & papers · System); a group folds like a folder */
.nav-grp { display: grid; margin-top: 8px; }
.nav-grp-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px 5px; border: 0; background: none; cursor: pointer; text-align: start;
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.45); }
html[lang="ar"] .nav-grp-head { font-size: 12px; letter-spacing: 0; }
.nav-grp-head > span:first-child { flex: 1; }
.nav-grp-head:hover { color: rgba(255,255,255,.85); }
.nav-grp-head:focus-visible { outline: 2px solid var(--coral); outline-offset: -2px; border-radius: 8px; }
.nav-grp-head .chev { width: 7px; height: 7px; }
.nav-grp.open > .nav-grp-head .chev { transform: rotate(225deg); margin-top: 3px; }
.nav-grp.has-active > .nav-grp-head { color: var(--coral); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); flex: none; }
.nav-grp.open .nav-dot { display: none; }
.nav-grp-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.nav-grp.open > .nav-grp-body { grid-template-rows: 1fr; }
.nav-grp-body > div { overflow: hidden; display: grid; gap: 2px; }
:root[data-theme="fern"] .nav-grp-head, :root[data-theme="dark-classic"] .nav-grp-head { color: var(--muted); }
:root[data-theme="fern"] .nav-grp-head:hover, :root[data-theme="dark-classic"] .nav-grp-head:hover { color: var(--text); }
:root[data-theme="fern"] .nav-grp.has-active > .nav-grp-head { color: var(--brand); }
:root[data-theme="dark-classic"] .nav-grp.has-active > .nav-grp-head { color: var(--brand); }
@media (prefers-reduced-motion: reduce) { .nav-grp-body { transition: none; } }
/* the sidebar's foot, compact: appearance + language side by side (each list says what it is), then the two links on one line */
.sidebar .sidebar-foot { grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
.sidebar .sidebar-foot .side-prefs { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebar .side-prefs .theme-pick > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sidebar .sidebar-foot > .link { font-size: 13px; }

/* ---------- sidebar as an icon rail (computers): folded to icons, opens over the page under the mouse; the pin keeps it open ---------- */
.side-pin { display: none; }
@media (min-width: 801px) and (hover: hover) {
  .side-pin { display: grid; place-items: center; position: absolute; top: 20px; inset-inline-end: 12px; z-index: 2; width: 28px; height: 28px; padding: 0;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: rgba(255,255,255,.75); cursor: pointer; transition: opacity .2s, transform .2s; }
  .side-pin:hover { color: #fff; background: rgba(255,255,255,.16); }
  .side-pin[aria-pressed="true"] svg { transform: scaleX(-1); }
  html[dir="rtl"] .side-pin svg { transform: scaleX(-1); } html[dir="rtl"] .side-pin[aria-pressed="true"] svg { transform: none; }
  :root:is([data-theme="fern"], [data-theme="dark-classic"]) .side-pin { border-color: var(--border); background: var(--surface-2); color: var(--text-2); }
  :root:is([data-theme="fern"], [data-theme="dark-classic"]) .side-pin:hover { color: var(--text); }

  .shell.nav-rail:not(.no-side) { grid-template-columns: 76px minmax(0, 1fr); }
  :root[data-theme="fern"] .shell.nav-rail:not(.no-side) { grid-template-columns: 88px minmax(0, 1fr); }
  .shell.nav-rail .sidebar { width: 76px; z-index: 40; transition: width .24s cubic-bezier(.3,.7,.3,1), box-shadow .24s; }
  .shell.nav-rail .sidebar.expanded { width: 264px; box-shadow: 0 18px 50px rgba(8,8,30,.38); }
  .shell.nav-rail .sidebar :is(.nav-head, nav a, .nav-grp-head, .side-user) { white-space: nowrap; }
  .shell.nav-rail .side-logo { overflow: hidden; flex-shrink: 0; }
  .shell.nav-rail .side-user { overflow: hidden; flex-shrink: 0; }

  /* folded: icons only — the crown of the logo, the avatar, Home / Dashboard and one icon per folder (all groups shown, a line between them) */
  .shell.nav-rail .sidebar:not(.expanded) .side-logo { direction: ltr; width: 40px; padding: 4px 0 0; margin-inline: auto; }
  .shell.nav-rail .sidebar:not(.expanded) .side-logo img { width: 150px; max-width: none; }
  .shell.nav-rail .sidebar:not(.expanded) { scrollbar-width: none; }
  .shell.nav-rail .sidebar:not(.expanded)::-webkit-scrollbar { width: 0; }
  .shell.nav-rail .sidebar:not(.expanded) :is(.nav-top, .nav-head) { font-size: 0; min-height: 40px; justify-content: center; gap: 0; padding-inline: 0; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-title { display: none; }
  .shell.nav-rail .sidebar:not(.expanded) .side-user { justify-content: center; gap: 0; padding-inline: 0; }
  .shell.nav-rail .sidebar:not(.expanded) .side-user > div { display: none; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-ico { font-size: 18px; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-head :is(.badge, .chev) { display: none; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-grp-head { font-size: 0; height: 1px; padding: 0; margin: 9px 10px; background: rgba(255,255,255,.14); pointer-events: none; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-grp-head > * { display: none; }
  :root:is([data-theme="fern"], [data-theme="dark-classic"]) .shell.nav-rail .sidebar:not(.expanded) .nav-grp-head { background: var(--border); }
  .shell.nav-rail .sidebar:not(.expanded) .nav-grp-body { grid-template-rows: 1fr; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-sec .nav-items { display: none; } /* not just 0fr: an open folder's list keeps its bottom padding */
  .shell.nav-rail .sidebar:not(.expanded) .nav-sec.open { background: none; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-sec.has-active > .nav-head { background: rgba(255,161,156,.16); }
  :root:is([data-theme="fern"], [data-theme="dark-classic"]) .shell.nav-rail .sidebar:not(.expanded) .nav-sec.has-active > .nav-head { background: var(--brand-soft); }
  .shell.nav-rail .sidebar:not(.expanded) .nav-sec:has(.nav-head .badge) .nav-ico { position: relative; }
  .shell.nav-rail .sidebar:not(.expanded) .nav-sec:has(.nav-head .badge) .nav-ico::after { content: ""; position: absolute; top: -3px; inset-inline-end: -3px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--side-bg); }
  .shell.nav-rail .sidebar:not(.expanded) :is(.sidebar-foot, .side-pin) { opacity: 0; pointer-events: none; }
}
@media (min-width: 801px) and (hover: hover) and (prefers-reduced-motion: reduce) { .shell.nav-rail .sidebar { transition: none; } }

/* ---------- customer service team ---------- */
.cs-team h2 .btn { margin-inline-start: auto; }
.team-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.team-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
html[dir="rtl"] .team-chip { padding: 5px 10px 5px 6px; }
.team-chip .avatar.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
.team-chip .icon-btn.sm { width: 26px; height: 26px; font-size: 11px; }
.team-chip.off { opacity: .6; }

/* ---------- visa process ---------- */
.vtrack { display: inline-flex; gap: 3px; vertical-align: middle; direction: ltr; }
.vtrack i { width: 10px; height: 10px; border-radius: 3px; background: var(--border); }
.vtrack i.good { background: var(--good); }
.vtrack i.warn { background: var(--warn); }
.vtrack i.bad { background: var(--bad); }
.vtrack i.new { background: var(--s1); }
.vtrack i.opt { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.vtrack i.next { outline: 2px solid var(--coral); outline-offset: 1px; }
.vfunnel { display: grid; gap: 6px; }
.vfunnel > * { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 8px;
  font: inherit; color: var(--text); text-align: start; cursor: pointer; text-decoration: none; }
.vfunnel > *:hover { background: var(--surface-2); }
.vflow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.vflow > i { align-self: center; font-style: normal; color: var(--muted); font-size: 20px; }
.vflow a { flex: 1 1 200px; display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface-2); }
.vflow a:hover { border-color: var(--coral); }
.vflow a small { color: var(--muted); font-size: 11.5px; }
.vflow a .num { font-size: 22px; font-weight: 700; }
.vflow a.bad .num { color: var(--bad); }
.vflow-out { display: grid; gap: 8px; flex: 0 1 180px; }
.vflow-out a { flex: none; grid-template-columns: 1fr auto; align-items: center; }
.form-sep { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); font-weight: 700; color: var(--text); }

/* ---------- accounts: daily report ---------- */
.acc-grid { align-items: start; }
.acc-grid h2 .btn { margin-inline-start: auto; }
.acc-block { margin-bottom: 12px; }
.acc-block-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13px; }
.acc-table td { padding: 7px 10px; vertical-align: middle; white-space: normal; }
.acc-table tr.is-waiting td { opacity: .75; }
.acc-vat { text-align: end; padding: 4px 10px 0; }
.acc-total { display: flex; justify-content: space-between; padding: 10px; border-top: 2px solid var(--border); font-weight: 700; font-size: 15px; }
.bal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.bal-grid .full { grid-column: 1 / -1; }
.bal-sum { display: grid; gap: 6px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.bal-sum div { display: flex; justify-content: space-between; }
.bal-sum b { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .bal-grid { grid-template-columns: 1fr; } }
.acc-grid > * { min-width: 0; }
.acc-table .pill { white-space: nowrap; }

/* ---------- maids payroll: 30-day strip ---------- */
.mp-table td { vertical-align: middle; padding: 6px 8px; }
.mp-table tr.is-paid td:not(.mp-days) { opacity: .8; }
.mp-table tr.is-selected td { background: color-mix(in srgb, var(--coral) 9%, transparent); }
.mp-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; position: sticky; top: 70px; z-index: 4; }
.mp-bulk input { width: auto; min-height: 34px; }

/* modern checkbox (maids payroll selection) */
.mp-check { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border-radius: 6px; border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; display: inline-grid; place-content: center; vertical-align: middle; transition: background .15s, border-color .15s, box-shadow .15s; }
.mp-check::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .15s; }
.mp-check:hover { border-color: var(--coral); }
.mp-check:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 40%, transparent); }
.mp-check:checked { background: var(--coral); border-color: var(--coral); }
.mp-check:checked::after { transform: rotate(45deg) scale(1); }
.mp-check:indeterminate { background: var(--coral); border-color: var(--coral); }
.mp-check:indeterminate::after { width: 10px; height: 0; border-width: 0 0 2.5px 0; transform: none; margin-top: 0; }

/* in-app confirmation (replaces the browser's confirm()) */
.ask-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(8, 8, 25, .55); animation: ask-in .12s ease-out; }
.ask-box { width: min(440px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: grid; gap: 18px; }
.ask-box p { margin: 0; font-size: 15px; line-height: 1.6; max-height: 60vh; overflow-y: auto; }
.ask-foot { display: flex; gap: 8px; }
@keyframes ask-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- fixes: tile numbers fit their card, sidebar never scrolls sideways, checkbox size ---------- */
.sidebar { overflow-x: hidden; }
.tile { min-width: 0; container-type: inline-size; }
.tile .value { font-size: clamp(18px, 15.5cqi, 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
input.mp-check { width: 20px; height: 20px; min-height: 0; padding: 0; flex: none; }
.mp-table td:first-child, .mp-table th:first-child { width: 36px; text-align: center; }

/* ---------- Outside Supply ---------- */
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.stage-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.sup-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 90px; }
.sup-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--coral), var(--good)); }
.sup-bar.big { height: 10px; margin: 6px 0; }
.sup-prog { min-width: 120px; }
.sup-who { display: flex; align-items: center; gap: 10px; text-align: start; }
.sup-flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sup-flow a { display: grid; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; position: relative; overflow: hidden; }
.sup-flow a:hover { border-color: var(--c); }
.sup-flow a::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: 0; width: 4px; background: var(--c); }
.sup-flow .n { font-size: 11px; color: var(--muted); }
.sup-flow .v { font-size: 26px; font-weight: 700; }
.sup-flow-bar { height: 4px; border-radius: 99px; background: var(--border); } .sup-flow-bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.sup-proc details { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.sup-proc summary { cursor: pointer; }
.sup-proc-stage { margin-top: 10px; padding-inline-start: 10px; border-inline-start: 3px solid var(--c); }
.sup-proc-stage ol { margin: 4px 0 0; padding-inline-start: 22px; font-size: 13px; line-height: 1.7; }
@media (max-width: 1000px) { .sup-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sup-board { display: grid; grid-template-columns: repeat(7, minmax(200px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.sup-col { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: 12px; padding: 10px; display: grid; gap: 8px; min-width: 0; }
.sup-col-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; }
.sup-card { display: grid; gap: 6px; text-align: start; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; }
.sup-card:hover { border-color: var(--c); }
.sup-empty { text-align: center; padding: 10px; }
/* resPage "Stages" board (Visa Process): one column per step, as many as the flow has */
.sup-board.rs-board { display: flex; }
.rs-board .sup-col { flex: 1 1 200px; min-width: 175px; }
/* every step shows; an empty one is folded to a narrow strip with its name written down it, and opens while a card is dragged */
.rs-board .sup-col.is-empty { flex: 0 0 44px; min-width: 44px; min-height: 170px; padding: 12px 6px; align-content: start; justify-items: center; opacity: .75; }
.rs-board .sup-col.is-empty .sup-col-head { writing-mode: vertical-rl; justify-content: flex-start; gap: 10px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.rs-board .sup-col.is-empty .sup-col-head .num { color: var(--muted); }
.rs-board .sup-col.is-empty .sup-empty { display: none; }
.rs-board.dragging .sup-col.is-empty { flex: 0 0 130px; min-width: 130px; justify-items: stretch; opacity: 1; }
.rs-board.dragging .sup-col.is-empty .sup-col-head { writing-mode: horizontal-tb; justify-content: space-between; }
.rs-board.dragging .sup-col.is-empty .sup-empty { display: block; }
.sup-board .sup-card[draggable="true"] { cursor: grab; }
/* board: tick cards to move several together */
.sup-board .sup-who > .sup-pick { margin-inline-start: auto; }
.sup-board .sup-who > div { min-width: 0; overflow-wrap: anywhere; }
.sup-pick { display: inline-flex; align-items: center; cursor: pointer; padding: 2px; align-self: start; }
.sup-col-n { display: inline-flex; align-items: center; gap: 6px; }
.sup-board .sup-card.picked { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); }
.sup-selbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--brand); border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.sup-selbar label { display: inline-flex; align-items: center; gap: 8px; }
.sup-selbar select { min-width: 180px; }
.sup-board .sup-card.is-dragging { opacity: .45; }
.sup-board .sup-col.drop-over { outline: 2px dashed var(--c); outline-offset: 2px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.rs-board .sup-card:focus-visible { outline: 2px solid var(--c); outline-offset: 1px; }
.rs-card-acts { display: flex; flex-wrap: wrap; gap: 6px; }
#rs-board > p { margin: 0 0 8px; }
/* Visa Process profiles: name → profile link with the photo, the profile header photo, the paper-type picker */
a.ph-link { color: inherit; text-decoration: none; } a.ph-link:hover { text-decoration: underline; }
a.vname { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
a.vname:hover b { text-decoration: underline; }
img.vphoto { object-fit: cover; padding: 0; background: var(--surface-2); }
.vp-photo { display: grid; justify-items: center; gap: 8px; }
.vp-photo .avatar.xl { width: 96px; height: 96px; border-radius: 24px; font-size: 30px; }
.vp-doc-type { display: grid; gap: 4px; max-width: 320px; margin-bottom: 8px; font-size: 13px; }
.sup-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sup-head-info { flex: 1; min-width: 240px; } .sup-head-info h2 { margin: 0 0 4px; }
.sup-head-pills { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sup-head-prog { min-width: 220px; }
.sup-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .sup-layout { grid-template-columns: 1fr; } }
.sup-stagebar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.sup-stagebar a { display: grid; gap: 2px; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--text-2); background: var(--surface-2); border-bottom: 3px solid transparent; font-size: 12px; }
.sup-stagebar a.done { border-bottom-color: var(--good); } .sup-stagebar a.on { border-bottom-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); }
.sup-stage { margin-top: 12px; }
.sup-stage-title { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--c); margin: 0 0 6px; padding-inline-start: 22px; }
.sup-step { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; background: var(--surface); }
.sup-step.is-current { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
.sup-step-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.sup-step-title { flex: 1; min-width: 0; }
.sup-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.s-completed .sup-dot { background: var(--good); border-color: var(--good); }
.s-in_progress .sup-dot { background: var(--coral); border-color: var(--coral); }
.s-waiting .sup-dot { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 40%, transparent); }
.s-on_hold .sup-dot { background: var(--bad); border-color: var(--bad); }
.s-not_applicable { opacity: .55; }
.sup-step-body { display: none; padding: 0 12px 12px 34px; }
html[dir="rtl"] .sup-step-body { padding: 0 34px 12px 12px; }
.sup-step.open .sup-step-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.sup-step-body p { margin: 0; }
.sup-step-dates { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.sup-step-dates b { color: var(--text); }
.sup-docs, .sup-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
/* wraps instead of overflowing when the steps column is narrow */
.sup-step-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sup-step-edit > .dd-btn { flex: 0 1 150px; width: auto; }
.sup-step-edit > [data-resp] { flex: 1 1 150px; width: auto; }
.sup-step-edit > [data-notes] { flex: 2 1 180px; width: auto; }
.sup-step-edit > [data-replaces] { flex: 1 1 200px; width: auto; }
.sup-step-edit > .sup-cust { flex: 1 1 100%; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
@media (max-width: 700px) { .sup-step-edit > .sup-cust { grid-template-columns: 1fr; } }
.sup-step-edit > .sup-seldate { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.sup-step-edit > .sup-seldate input { width: auto; }
.sup-kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.sup-kv span { color: var(--muted); } .sup-kv b { text-align: end; font-weight: 600; }
.sup-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.sup-exp { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr auto; gap: 6px; margin-bottom: 6px; }
@media (max-width: 700px) { .sup-exp { grid-template-columns: 1fr 1fr; } }

/* ---------- contract attachments (Return Paper) ---------- */
.rec-files { margin-top: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; display: grid; gap: 10px; }
.rec-files-head { display: flex; align-items: center; gap: 8px; }
.rec-files-head .btn { margin-inline-start: auto; }
.rec-files-list { display: grid; gap: 8px; }
.rec-file { display: flex; align-items: center; gap: 10px; }
.rec-file-thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; font-size: 24px; text-decoration: none; }
.rec-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-file-info { flex: 1; min-width: 0; display: grid; }
.rec-file-info a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-files-pick { display: grid; gap: 8px; }
.thumb.is-pdf span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 26px; background: var(--surface-2); text-align: center; }
.thumb.is-pdf small { font-size: 9px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pill.clip { padding: 0 6px; font-size: 11px; }

/* ---------- styled dropdowns (ddEnhance): the native field stays for the form value, the button + menu are what you see ---------- */
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.dd-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; text-align: start; font-weight: 400; }
.dd-btn span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); flex: none; transition: transform .15s; }
.dd-btn:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.dd-btn:focus-visible, .dd-btn[aria-expanded="true"] { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: transparent; }
.dd-btn:disabled { opacity: .6; cursor: default; }
.dd-menu { position: fixed; z-index: 1000; overflow-y: auto; padding: 5px; display: grid; gap: 1px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.22); animation: dd-in .12s ease-out; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.dd-opt { border: 0; background: none; text-align: start; padding: 8px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; min-height: 34px; font-weight: 400; }
.dd-opt:hover, .dd-opt.active { background: var(--surface-2); }
.dd-opt.on { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.caps .dd-opt, .caps .dd-btn { text-transform: uppercase; }

/* ---------- Outside Supply: CAPITAL letters, name note, attachments ---------- */
.caps input:not([type="date"]):not([type="number"]):not([type="checkbox"]):not([type="email"]), .caps textarea, .caps .dd-btn { text-transform: uppercase; }
.field-note { color: var(--warn); font-size: 12px; font-weight: 500; }
.sup-docs { display: grid; gap: 6px; }
.sup-doc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sup-doc > .chk { min-width: 150px; }
.sup-file { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; max-width: 240px; }
.sup-file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.sup-file a:hover { color: var(--brand); }
.sup-file .icon-btn { width: 22px; height: 22px; min-height: 0; font-size: 11px; }
.sup-files-list { display: grid; gap: 8px; }
.sup-files-list .rec-file-info small { display: block; }

/* the dropdown button wherever the old <select> had its own look */
.dd-btn:focus-visible { outline-color: var(--coral); }
.filters .dd-btn { width: auto; min-width: 130px; }
.page-actions .dd-btn, .tier .dd-btn { width: auto; }
.tier .dd-btn { min-height: 34px; }
.page-actions select.on + .dd-btn { border-color: var(--brand-2); color: var(--brand); }
.att .dd-btn { min-height: 32px; padding: 4px 6px; width: 92px; gap: 4px; }
.att select:disabled + .dd-btn { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
.dd-btn:disabled::after { visibility: hidden; }
.theme-pick .dd-btn { min-height: 32px; padding: 4px 8px; font-size: 13px; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.15); }
.theme-pick .dd-btn::after { border-color: rgba(255,255,255,.6); }
.login .theme-pick .dd-btn { background: var(--surface); color: var(--text); border-color: var(--border); }
.login .theme-pick .dd-btn::after { border-color: var(--muted); }

/* CAPITAL letters in every text field (the value itself is converted in app.js); employee names / logins / e-mails are left as typed */
input:is(:not([type]), [type="text"], [type="search"]):not([data-nocaps]):not([name="username"]):not([name*="email"]):not([autocomplete="username"]), textarea:not([data-nocaps]) { text-transform: uppercase; }
[data-nocaps] :is(input, textarea) { text-transform: none; }
input::placeholder, textarea::placeholder { text-transform: none; }

/* ---------- Outside Supply › CV editor ---------- */
.cv-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cv-preview { position: sticky; top: 80px; padding: 10px; }
.cv-preview canvas { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
/* a saved CV: the CV only, centred ("✏️ Edit" brings the fields back) */
.cv-layout.cv-view { grid-template-columns: minmax(0, 1fr); }
.cv-layout.cv-view .cv-form { display: none; }
.cv-layout.cv-view .cv-preview { position: static; width: 100%; max-width: 860px; margin-inline: auto; }
.cv-photo-row { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.cv-photo-row input[type="range"] { padding: 0; min-height: 28px; accent-color: var(--brand); }
.cv-exp { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
img.avatar.sup-photo { object-fit: cover; object-position: center top; padding: 0; }
@media (max-width: 1100px) { .cv-layout { grid-template-columns: 1fr; } .cv-preview { position: static; max-width: 520px; } .cv-photo-row { grid-template-columns: 1fr 1fr; } }
/* the "Create CV" button stands out on the applicant page */
.btn.cv-btn { background: linear-gradient(135deg, var(--coral), #ff8fa3); border-color: transparent; color: #1d1b4f; font-weight: 700; font-size: 15px; min-height: 42px; padding-inline: 20px; box-shadow: 0 4px 14px color-mix(in srgb, var(--coral) 40%, transparent); text-decoration: none; }
.btn.cv-btn:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--coral), #ff8fa3); }

/* "Create CV" in the Attendance tables */
.btn.cv-mini { background: color-mix(in srgb, var(--coral) 22%, var(--surface)); border-color: color-mix(in srgb, var(--coral) 55%, var(--border)); font-weight: 600; text-decoration: none; }
.rs-table td a.btn { text-decoration: none; white-space: nowrap; }

/* ---------- Accounts › P3 contracts: form + the pages as they print ---------- */
.p3-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.p3-pages { display: grid; gap: 14px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding: 4px; }
.p3-page { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 6px 22px rgba(0,0,0,.18); background: #fff; }
.p3-stamp-chk { align-self: end; min-height: 38px; }
@media (max-width: 1100px) { .p3-layout { grid-template-columns: 1fr; } .p3-pages { position: static; max-height: none; } }
.rp-who { display: block; margin-top: 3px; white-space: nowrap; font-size: 11.5px; }
.rp-who b { color: var(--warn, #b7791f); font-weight: 600; }
/* a saved Return Paper opens as the paper only ("✏️ Edit" brings the fields back) */
.p3-layout.rp-view { grid-template-columns: minmax(0, 1fr); }
.p3-layout.rp-view #p3-form { display: none; }
.p3-layout.rp-view .p3-pages { position: static; max-height: none; width: 100%; max-width: 860px; margin-inline: auto; }
#print-root { display: none; }
/* printing a paper (p3Print puts its pages in #print-root): only those pages, edge to edge. Scoped to when #print-root is there,
   so printing any other page (the Ads report…) still prints the page itself. */
@media print {
  @page paper { size: A4; margin: 0; }
  @page land { size: A4 landscape; margin: 0; }
  html:has(#print-root), body:has(> #print-root) { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body:has(> #print-root) > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root img { page: paper; display: block; width: 210mm; height: 297mm; break-after: page; page-break-after: always; }
  #print-root img:last-child { break-after: auto; page-break-after: auto; }
  /* a landscape paper (the training certificate) prints on a landscape page */
  #print-root img.land { page: land; width: 297mm; height: 210mm; }
}
/* Paper Work › training certificate: the housemaid's photo and signature */
.cert-media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cert-box { display: grid; gap: 8px; align-content: start; padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius); }
.cert-box .cert-prev { width: 100%; height: 120px; object-fit: contain; background: var(--surface-2); border-radius: 8px; }
.cert-box .cert-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.cert-pad { width: 100%; height: 150px; background: #fff; border: 1px solid var(--border); border-radius: 8px; touch-action: none; cursor: crosshair; }
@media (max-width: 600px) { .cert-media { grid-template-columns: 1fr; } }

/* quick picks under the contract length */
.p3-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 99px; padding: 3px 12px; font-size: 12px; font-weight: 600; cursor: pointer; min-height: 0; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }

/* Users & permissions › Team */
.team-add { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; } .team-add input { flex: 1 1 200px; width: auto; } .team-add .dd-btn { width: auto; min-width: 150px; }
.team-sugg { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.team-s { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.team-s-btns { margin-inline-start: auto; display: flex; gap: 6px; }
.team-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .team-grid { grid-template-columns: 1fr; } }

/* ---------- Odoo ---------- */
.odoo-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.odoo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.odoo-help { line-height: 1.9; padding-inline-start: 20px; }
.empty-state { text-align: center; padding: 40px 20px; }
.odoo-map { display: grid; gap: 6px; }
.odoo-map-row { display: grid; grid-template-columns: minmax(110px, 1fr) auto auto minmax(140px, 1.2fr) auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); }
/* Odoo orders: one month at a time */
.od-months { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.od-month { flex: none; display: grid; gap: 2px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: center; min-width: 110px; }
.od-month span { color: var(--muted); font-size: 12px; }
.od-month.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.od-month.on span { color: var(--brand); }
.tile .small-value { font-size: 15px; line-height: 1.5; white-space: normal; overflow: visible; text-overflow: clip; }

/* Ads: Odoo's count under each contract box */
.od-hint { display: block; font-size: 11px; font-weight: 600; color: var(--warn); margin-top: 2px; }
.od-hint.same { color: var(--muted); font-weight: 400; }
.ad-odoo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
#ad-src-report h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } #ad-src-report h2 .seg { margin-inline-start: auto; }
#ad-src-report .tiles { margin-bottom: 12px; }
.code-box { background: var(--surface-2, rgba(127,127,127,.08)); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; line-height: 1.5; max-height: 320px; overflow: auto; white-space: pre; text-align: left; }
/* Google reviews pulled from the Business Profile */
.rv-text { margin-top: 8px; font-size: 14px; line-height: 1.6; white-space: pre-line; }
/* Google Reviews: compact cards, two in a row */
.rv-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.rv-grid .rv-card { padding: 12px 14px; box-shadow: none; display: flex; flex-direction: column; }
.rv-grid .rv-card:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.rv-card.gone { border-color: var(--bad); }
.rv-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rv-who b { font-size: 14px; }
.rv-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
.rv-grid .rv-text { font-size: 13px; line-height: 1.55; }
.rv-text.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-more { align-self: flex-start; border: 0; background: none; padding: 0; margin-top: 4px; color: var(--brand); font: inherit; font-size: 12px; cursor: pointer; }
.rv-grid .rv-icon { opacity: .3; }
.rv-grid .rv-card:hover .rv-icon { opacity: .8; }
.rv-grid .thumbs { margin-top: 8px; }
/* the head on one line: the name side gives way (… on a long name), the employee and the icons stay up top */
.rv-grid .rv-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "av name act" "av meta meta"; column-gap: 10px; row-gap: 2px; align-items: center; }
.rv-grid .rv-who, .rv-grid .rv-who > div { display: contents; }
.rv-grid .rv-av { grid-area: av; align-self: start; }
.rv-grid .rv-name { grid-area: name; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rv-grid .rv-meta { grid-area: meta; }
.rv-grid .rv-actions { grid-area: act; }
.rv-grid .rv-actions { flex: none; flex-wrap: nowrap; }
.rv-grid .rv-chip-btn { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-reply { margin-top: 8px; padding: 8px 12px; border-inline-start: 3px solid var(--border); background: var(--surface-2); border-radius: 6px; font-size: 13px; color: var(--text-2); white-space: pre-line; }
.rv-reply b { display: block; color: var(--text); font-size: 12px; margin-bottom: 2px; }
.gbp-pending summary { cursor: pointer; list-style: none; }
.gbp-pending .rv-list { margin-top: 10px; }
.gbp-row .rv-actions select { max-width: 200px; }
/* review card: who it counts for = a small chip, + = a small round button, images / delete = quiet icons */
.rv-card .rv-actions { align-items: center; gap: 4px; }
.rv-emp { display: flex; align-items: center; gap: 4px; margin-inline-end: 4px; }
.rv-emp .dd-btn, .rv-emp-ro { width: auto; max-width: 150px; min-height: 26px; padding: 2px 10px; gap: 6px; border-radius: 999px; border: 0; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 600; }
.rv-emp .dd-btn::after { width: 5px; height: 5px; border-color: currentColor; border-width: 0 1.5px 1.5px 0; }
.rv-emp .rv-add + .dd-btn { width: 26px; min-width: 26px; padding: 0; justify-content: center; background: transparent; color: var(--muted); border: 1px dashed var(--border); font-size: 15px; font-weight: 500; }
.rv-emp .rv-add + .dd-btn span { flex: none; }
.rv-emp .rv-add + .dd-btn::after { display: none; }
.rv-emp .rv-add + .dd-btn:hover { color: var(--brand); border-color: var(--brand); }
/* nobody has it yet: the chip says "Pick the employee", outlined instead of filled */
.rv-emp .rv-pick + .dd-btn { background: transparent; color: var(--text-2); border: 1px dashed var(--border); font-weight: 500; }
.rv-emp .rv-pick + .dd-btn:hover { color: var(--brand); border-color: var(--brand); }
.rv-chip-btn { min-height: 26px; padding: 2px 10px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rv-chip-btn:hover { background: var(--brand-soft); color: var(--brand); }
.gbp-row .rv-actions select { max-width: none; }
.rv-emp-ro { display: inline-flex; align-items: center; }
.rv-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: none; opacity: .7; }
.rv-icon:hover { background: var(--surface-2); opacity: 1; }
.rv-icon.danger:hover { background: var(--bad-soft); }
.copy-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.copy-line code { background: var(--surface-2); padding: 4px 8px; border-radius: 6px; word-break: break-all; }
/* Paper Work: picking a paper from a contract */
.ho-pick { display: grid; gap: 10px; }
.ho-pick-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; }
.ho-pick-item:hover { border-color: var(--brand); background: var(--surface-2); }
.ho-pick-item small { grid-column: 1; }
.ho-pick-item .pill { grid-column: 2; grid-row: 1 / span 2; }
/* staff schedules: quick 8 / 9 / 10 buttons next to the time */
.ss-times { display: inline-flex; margin-inline-end: 8px; vertical-align: middle; }
.ss-times + input[type="time"] { width: 120px; }
/* Paper Work › sponsor interview: the six agreed clauses */
.ho-clauses { display: grid; gap: 6px; }
.ho-clauses label { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 8px; }
/* Paper Work › security cheque receipt: three cheques (date · number · amount · bank) */
.ho-cheques { display: grid; grid-template-columns: 18px 1.1fr 1fr .8fr 1.1fr; gap: 6px 8px; align-items: center; }
.ho-cheques input { min-width: 0; }
/* Paper Work › quotation: one card per line (description + qty / price / amount / VAT) */
.quo-lines { display: grid; gap: 10px; }
.quo-row { display: grid; grid-template-columns: 22px 1fr; gap: 6px 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.quo-row > .num { padding-top: 8px; }
.quo-row textarea { min-height: 70px; }
.quo-nums { grid-column: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; gap: 8px; align-items: end; }
.quo-nums label { font-size: 12px; }
.quo-nums .chk { align-self: center; white-space: nowrap; }
.lpo-foot { display: flex; align-items: center; gap: 10px; }
@media (max-width: 600px) { .quo-nums { grid-template-columns: 1fr 1fr; } }
/* Paper Work › orientation: the questions with Yes / No */
.or-list { display: grid; gap: 6px; max-height: 520px; overflow: auto; padding-inline-end: 4px; }
.or-q { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.or-q .or-text { text-transform: none; line-height: 1.45; }
.or-q .seg button.on[data-a="N"] { background: var(--bad-soft); color: var(--bad); }
/* Paper Work › salary card: one row per month */
.sc-rows { display: grid; gap: 6px; max-height: 460px; overflow: auto; padding-inline-end: 4px; }
.sc-row { display: grid; grid-template-columns: 24px 1fr 1fr 110px; gap: 8px; align-items: center; }
.sc-row input { min-width: 0; }
/* Ads: a Leads box filled from Odoo (read-only) */
.spend-table input.from-odoo { background: var(--surface-2); border-style: dashed; cursor: default; }
/* Paper Work › family information: name · phone · Facebook per member */
.mf-family { display: grid; grid-template-columns: 18px 1.2fr 1fr 1.2fr; gap: 6px 8px; align-items: center; }
.mf-family input { min-width: 0; }
/* renewals: the search box in the summary card */
.ren-search { flex: 1 1 260px; max-width: 380px; min-width: 0; }
/* renewals: status pills are filters (click again for all); the expiry range sits in the same bar */
.ren-pill { border: 1px solid transparent; cursor: pointer; font: inherit; }
.ren-pill:hover { filter: brightness(1.12); }
.ren-pill.on { border-color: currentColor; box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 25%, transparent); }
.ren-range { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.ren-note p { margin: 0; }
/* the register: the center month by month */
.reg-months h3 { margin: 0 0 8px; }
.reg-table { width: 100%; font-variant-numeric: tabular-nums; }
.reg-table tfoot th { border-top: 2px solid var(--border); }
.ren-note .ren-hidden { margin-top: 8px; }
.ren-range label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.ren-range input[type="date"] { min-height: 34px; padding: 4px 8px; }
/* records pages: month by month (← month →) */
.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav select { min-width: 140px; }
.month-nav input[type="date"] { width: auto; min-width: 150px; } /* day by day (Daily report): ← date → on one line */
/* Deployment Traditional: Inside / Arrived (E-Visa) tabs */
.rec-tabs { margin-bottom: 12px; }
.rec-tabs button { padding: 8px 18px; font-size: 14px; }
.rec-tabs button.on { background: var(--brand); color: var(--on-brand); }
.rec-tabs b { margin-inline-start: 6px; opacity: .85; }
/* records pages: the top bar — Inside / Arrived tabs (Deployment Traditional) and the month on the other side */
.rec-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; }
.rec-top .rec-tabs { margin: 0; }
.rec-top .month-nav { margin-inline-start: auto; gap: 6px; }
.rec-top .month-nav > span { margin-inline-end: 4px; }

/* attendance: compact card + day-by-day popup */
.att-compact .att-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.att-dlg { width: min(1100px, calc(100vw - 32px)); }
.att-dlg .modal-head { gap: 12px; flex-wrap: wrap; }
.att-dlg-acts { display: flex; gap: 8px; align-items: center; }
.att-dlg .modal-content { padding-top: 8px; }

/* employee profile: monthly history folded */
.hist-card > summary { cursor: pointer; list-style: none; }
.hist-card > summary::-webkit-details-marker { display: none; }
.hist-card > summary h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.hist-card > summary h2::before { content: '▸'; color: var(--muted); transition: transform .15s; }
[dir="rtl"] .hist-card > summary h2::before { content: '◂'; }
.hist-card[open] > summary h2::before { transform: rotate(90deg); }
[dir="rtl"] .hist-card[open] > summary h2::before { transform: rotate(-90deg); }
.hist-card[open] > summary { margin-bottom: 12px; }

/* dashboard: % change vs last month on every card */
.kpi-delta { margin-inline-start: 10px; vertical-align: middle; font-size: 13px; letter-spacing: 0; display: inline-block; }
.hero-tile .kpi-delta { font-size: 15px; }
.kpi-delta .delta { font-size: inherit; }
.tile.muted-tile { border-top: 3px solid var(--muted); }
.tile.muted-tile .value { color: var(--text-2); }
.tile.muted-tile .delta { background: var(--surface-2); color: var(--text-2); }

/* floating horizontal scrollbar for wide tables (see app.js) */
.float-hscroll { position: fixed; bottom: 0; z-index: 60; height: 16px; overflow-x: auto; overflow-y: hidden; background: color-mix(in srgb, var(--surface) 85%, transparent); border-top: 1px solid var(--border); backdrop-filter: blur(4px); }
.float-hscroll[hidden] { display: none; }
.float-hscroll > div { height: 1px; }
@media print { .float-hscroll { display: none !important; } }

/* sales performance: compare view */
.cmp-grid { align-items: start; }
.cmp tr.strong td { font-weight: 700; border-top: 1px solid var(--border); }
.cmp th small { font-weight: 500; }
.cmp tr.info-row td { color: var(--muted); }

/* ---------- home: the apps menu ---------- */
.home { width: 100%; max-width: 1040px; margin: 8px auto 40px; } /* width: a grid item with auto margins would shrink to one column */
/* Home is full width: no sidebar (the tiles and the search are the menu) */
.shell.no-side { grid-template-columns: 1fr; }
.shell.no-side .sidebar, .shell.no-side .menu-btn { display: none; }
.home-logo { width: 190px; margin-bottom: 4px; }
.home-logo .logo-img { width: 100%; }
.home-hello { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 34px; }
.home-hello h2 { margin: 0; font-size: 22px; }
.home-hello input { width: min(520px, 100%); padding: 11px 16px; border-radius: 99px; font-size: 14px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 30px 14px; justify-items: center; }
.home-grid[hidden], .home-results[hidden] { display: none; }
.home-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 118px; text-decoration: none; color: var(--text); }
.home-icon { position: relative; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; }
.home-icon svg { width: 50px; height: 50px; }
.home-icon .badge { position: absolute; top: -7px; inset-inline-end: -7px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.home-tile:hover .home-icon { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.16); }
.home-tile:focus-visible { outline: none; }
.home-tile:focus-visible .home-icon { outline: 2px solid var(--brand); outline-offset: 3px; }
.home-label { font-size: 14px; text-align: center; line-height: 1.3; }
.home-results { display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin: 0 auto; }
.home-results a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.home-results a:hover, .home-results a:first-child { border-color: var(--brand); }
.home-results svg { width: 30px; height: 30px; flex: none; }
.home-results span { display: flex; flex-direction: column; }
.home-results small { color: var(--muted); }
@media (max-width: 520px) { .home-grid { grid-template-columns: repeat(3, 1fr); gap: 22px 6px; } .home-tile { width: 96px; } .home-icon { width: 68px; height: 68px; border-radius: 15px; } .home-icon svg { width: 40px; height: 40px; } .home-label { font-size: 12.5px; } }

/* Appearance / Language in the top bar (Home) */
.page-actions .side-prefs { display: flex; gap: 10px; margin: 0; }
.page-actions .side-prefs .theme-pick { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.page-actions .side-prefs .theme-pick :is(select, .dd-btn) { width: 170px; background: var(--surface); color: var(--text); border-color: var(--border); }
.page-actions .side-prefs .theme-pick .dd-btn::after { border-color: var(--muted); }
@media (max-width: 760px) { .page-actions .side-prefs .theme-pick > span { display: none; } .page-actions .side-prefs .theme-pick :is(select, .dd-btn) { width: 140px; } }

/* maids payroll: switch a hand-typed month to days from the contracts */
.mp-auto-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.mp-auto-note span { color: var(--text-2); font-size: 13px; flex: 1 1 320px; }
.mp-missing summary { cursor: pointer; }
.mp-missing summary h2 { color: var(--warn); }
.mp-missing .table-wrap { max-height: 360px; overflow-y: auto; margin-top: 8px; }

/* ---------- date fields: our own calendar instead of the browser's (which can't be styled) ---------- */
input[data-dd="date"] { cursor: pointer; padding-inline-end: 34px; background-repeat: no-repeat; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8db3' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-position: right 10px center; }
html[dir="rtl"] input[data-dd="date"] { background-position: left 10px center; }
input[data-dd="date"]::-webkit-calendar-picker-indicator { display: none; }
input[data-dd="date"]:disabled { cursor: default; background-image: none; }
.dd-cal { width: 286px; padding: 10px; display: block; overflow: visible; max-height: none; }
.dd-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dd-cal-head b { font-size: 14px; }
.dd-nav { border: 0; background: var(--surface-2); color: var(--text); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.dd-nav:hover { background: var(--brand-soft); color: var(--brand); }
.dd-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dd-cal-grid i { font-style: normal; text-align: center; font-size: 10.5px; color: var(--muted); padding: 2px 0 4px; white-space: nowrap; overflow: hidden; }
.dd-day { border: 0; background: none; color: var(--text); height: 34px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.dd-day:hover:not(:disabled) { background: var(--surface-2); }
.dd-day.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.dd-day.on { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.dd-day:disabled { opacity: .3; cursor: default; }
.dd-cal-foot { display: flex; gap: 6px; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
/* users: new password box (show / generate / copy) */
.pw-box { display: grid; gap: 6px; }
.pw-row { display: flex; gap: 6px; align-items: center; }
.pw-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }

/* Users › each user's own permissions */
.perm-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.perm-box[hidden] { display: none; }
.perm-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.perm-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 14px; max-height: 320px; overflow-y: auto; margin-top: 6px; }
/* Users › Outside Supply — the agencies a user sees */
.agency-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.agency-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 14px; margin-top: 6px; }
.perm-grp { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--text-2); margin-top: 10px; }
.perm-item { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.perm-item input, .perm-custom input { width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--brand); }
.perm-item:has(input:disabled) { opacity: .6; cursor: default; }

/* Maids' payroll: steps, quick filters, a plain table and a side panel per maid */
.mp-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mp-step { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; text-align: start; font: inherit; }
.mp-step b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 13px; flex: none; }
.mp-step span { display: flex; flex-direction: column; font-weight: 600; line-height: 1.25; }
.mp-step small { font-weight: 400; color: var(--muted); font-size: 12px; }
.mp-step:hover { border-color: var(--coral); }
.mp-step.on { border-color: var(--coral); box-shadow: 0 0 0 2px color-mix(in srgb, var(--coral) 35%, transparent); }
.mp-step.on b { background: var(--coral); color: var(--navy); }
.mp-step-sep { font-style: normal; color: var(--muted); }
.tile.warn .value { color: var(--warn); }
.tile.clickable { cursor: pointer; }
.mp-filterbar { display: flex; flex-direction: column; gap: 10px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; }
.mp-chip b { margin-inline-start: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.mp-chip.warn b { color: var(--warn); }
.mp-chip:hover { border-color: var(--coral); }
.mp-chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.mp-chip.on b { color: var(--on-brand); }
.mp-filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mp-filter-row input[type="search"] { flex: 1 1 240px; }
.mp-filter-row select { width: auto; flex: 0 1 180px; }
.mp-filter-row .count { margin-inline-start: auto; }
.mp-simple td { padding: 10px; }
.mp-simple tbody tr { cursor: pointer; }
.mp-simple tbody tr:hover td { background: color-mix(in srgb, var(--coral) 6%, transparent); }
.mp-simple tr.is-open td { background: color-mix(in srgb, var(--coral) 14%, transparent); }
.mp-days-short { color: var(--warn); font-size: 15px; }
.mp-adj-cell { max-width: 260px; }
.mp-paybar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.mp-paybar > label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.mp-paycards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; flex: 1 1 100%; }
.mp-paycard { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.mp-paycard .label { font-weight: 700; }
.mp-paycard .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mp-paycard .value small { font-size: 12px; color: var(--muted); font-weight: 500; }
.mp-paycard .sub { font-size: 12px; color: var(--muted); }
.mp-paycard-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mp-checklist { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; font-weight: 500; }
.mp-batches { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.mp-batches span { background: var(--surface-2); border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.mp-closed-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(460px, 100vw); z-index: 60; background: var(--surface); border-inline-start: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(0,0,0,.25); display: flex; flex-direction: column; animation: mp-in .18s ease-out; }
@keyframes mp-in { from { transform: translateX(calc(var(--dir, 1) * 30px)); opacity: 0; } }
.mp-dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.mp-dr-head b { font-size: 16px; }
.mp-dr-body { padding: 14px 18px 24px; overflow-y: auto; flex: 1; }
.mp-dr-body h3 { font-size: 14px; margin: 18px 0 8px; }
.mp-formula { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.mp-dr-note { font-size: 13px; color: var(--text-2); background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; }
.mp-cal { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 12px; direction: ltr; }
.mp-cal span { display: flex; flex-direction: column; align-items: center; border-radius: 6px; padding: 3px 0; font-size: 12px; line-height: 1.15; }
.mp-cal span small { font-size: 9px; opacity: .75; }
.mp-cal .on, .mp-legend .on { background: var(--good-soft); color: var(--good); }
.mp-cal .off.contract, .mp-legend .off.contract { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.mp-cal .off.typed, .mp-legend .off.typed { background: var(--bad); color: #fff; }
.mp-cal .on.forced, .mp-legend .on.forced { background: var(--good); color: #fff; }
.mp-cal .fri { outline: 1px dashed color-mix(in srgb, var(--coral) 70%, transparent); outline-offset: -1px; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 11px; }
.mp-legend span { border-radius: 6px; padding: 2px 8px; }
.mp-lines { display: grid; gap: 4px; }
.mp-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.mp-line > span:first-child { min-width: 64px; }
.mp-line > :nth-child(2) { flex: 1; }
.mp-add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.mp-add-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); }
.mp-add-row label.grow { flex: 1 1 140px; }
.mp-add-row select, .mp-add-row input { min-height: 34px; }
.mp-add-row select { width: auto; }
.mp-add-row input[type="number"] { width: 100px; }
.mp-dr-foot { margin-top: 20px; }
@media print { .mp-drawer, .mp-steps, .mp-filterbar, .mp-paybar { display: none !important; } }
.mp-filter-row .dd-btn { width: auto; flex: 0 1 200px; min-width: 150px; }
.mp-filter-row input[type="search"] { width: auto; }
.mp-add-row .dd-btn { min-width: 70px; }
.mp-cal span.pick { cursor: pointer; user-select: none; transition: transform .08s; }
.mp-cal span.pick:hover { transform: scale(1.08); box-shadow: 0 0 0 2px var(--coral); }
.mp-cal-hint { margin: 8px 0 0; }
.mp-save-state { margin-inline-start: auto; align-self: center; white-space: nowrap; }
.src-ico { width: 20px; height: 20px; vertical-align: -5px; margin-inline-end: 8px; flex: none; }
/* top bar: a search box sits beside the month arrows instead of taking a whole line */
.page-actions { align-items: center; }
.page-actions input[type="search"] { width: 240px; min-height: 38px; }
.topbar h1 .title-logo { height: 26px; width: auto; vertical-align: -6px; margin-inline-end: 10px; }
/* a small menu in the top bar (e.g. Ads › Connections) */
.act-menu { position: relative; }
.act-menu > summary { list-style: none; cursor: pointer; }
.act-menu > summary::-webkit-details-marker { display: none; }
.act-menu > summary::after { content: ""; display: inline-block; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-inline-start: 8px; vertical-align: 3px; opacity: .7; }
.act-menu[open] > summary { border-color: var(--coral); }
.act-menu-list { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 220px; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.3); display: grid; gap: 2px; }
.act-menu-list a { display: flex; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.act-menu-list a:hover { background: var(--surface-2); }
/* names in tables (sponsor, housemaid, employee…) a little heavier — the thin weight was hard to read */
tbody td.en { font-weight: 600; }
/* the demo copy: a small ribbon on every page */
body.is-demo .topbar h1::before { content: "DEMO"; display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px;
body.is-staging .topbar h1::before { content: "STAGING"; }
  background: var(--warn-soft); color: var(--warn); margin-inline-end: 10px; vertical-align: middle; }

/* Subscriptions: the service's logo next to its name */
.sub-name { display: inline-flex; align-items: center; gap: 10px; }
.sub-ico { width: 26px; height: 26px; border-radius: 7px; flex: none; display: inline-grid; place-items: center; }
img.sub-ico { background: #fff; padding: 3px; object-fit: contain; box-shadow: 0 0 0 1px var(--border); }
.sub-ico.letter { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); font-weight: 700; font-size: 13px; }
.sub-ico.kind { background: var(--surface-2); color: var(--text-2); }
.sub-ico.kind svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sub-ico.k-water { color: #3fa9f5; }
.sub-ico.k-mail { color: #e8a33d; }
.sub-ico.k-web { color: var(--brand-2); }
.sub-ico.k-social { color: var(--coral); }

/* ---------- "Fernly" (trial look): light bento in the logo's navy with light pink touches — floating rounded panels, pill buttons ---------- */
:root[data-theme="fern"] {
  color-scheme: light;
  --bg: #eef0f6; --surface: #ffffff; --surface-2: #f4f4fa; --border: #e4e4f0;
  --text: #1b1a3d; --text-2: #55537a; --muted: #8b89a8;
  --brand: #2e2b80; --brand-2: #5a56b8; --brand-soft: #ecebf8; --on-brand: #ffffff;
  --accent: #ffa19c; --accent-soft: #fff0ef;
  --coral: #ffa19c; --navy: #2e2b80; /* --coral is the pink accent everywhere, --navy the text on it */
  --fern-deep: #1f1c5e; --fern-pink: #ffa19c;
  --good: #1e7a3c; --good-soft: #e5f4ea; --warn: #9a6200; --warn-soft: #fcf1dc; --bad: #b3261e; --bad-soft: #fbe7e5;
  --s1: #2e2b80; --s2: #f0807a; --s3: #5a56b8; --s4: #e3a93a; --s5: #e87ba4; --s6: #1baf7a; --s7: #3fa9c9; --s8: #e66767;
  --shadow: 0 1px 2px rgba(30,28,90,.05), 0 6px 20px rgba(30,28,90,.06);
  --radius: 20px;
  --side-bg: #ffffff;
}
:root[data-theme="fern"] body { font-family: "Plus Jakarta Sans", "Thmanyah Sans", "IBM Plex Sans Arabic", system-ui, sans-serif; }
:root[data-theme="fern"] .logo-img.on-light { display: block; }
:root[data-theme="fern"] .logo-img.on-dark { display: none; }
:root[data-theme="fern"] .avatar { color: var(--brand); }

/* frame: sidebar and top bar float as rounded panels on the grey page */
:root[data-theme="fern"] .shell { grid-template-columns: 268px 1fr; }
:root[data-theme="fern"] .shell.no-side { grid-template-columns: 1fr; }
:root[data-theme="fern"] .sidebar { margin: 12px; margin-inline-end: 0; height: calc(100vh - 24px); top: 12px; border-radius: 24px; background: var(--surface);
  color: var(--text); box-shadow: var(--shadow); padding: 20px 14px; }
:root[data-theme="fern"] .side-logo img { content: url("/logo-navy.webp"); width: 150px; }
:root[data-theme="fern"] .side-user { background: var(--surface-2); }
:root[data-theme="fern"] .side-user b { color: var(--text); }
:root[data-theme="fern"] .side-user small { color: var(--muted); }
:root[data-theme="fern"] .shell .sidebar .side-user .avatar { background: var(--fern-pink); color: var(--navy); border-radius: 50%; }
:root[data-theme="fern"] .sidebar nav .group, :root[data-theme="fern"] .nav-sub { color: var(--muted); }
:root[data-theme="fern"] .sidebar nav a { color: var(--text-2); }
:root[data-theme="fern"] .sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
:root[data-theme="fern"] .sidebar nav a.active { background: none; color: var(--text); font-weight: 700; }
:root[data-theme="fern"] .sidebar nav a.active::before { background: var(--fern-pink); }
:root[data-theme="fern"] .sidebar nav a .badge, :root[data-theme="fern"] .nav-head .badge { background: var(--fern-pink); color: var(--navy); border-radius: 7px; padding: 1px 7px; }
:root[data-theme="fern"] .nav-head { color: var(--text-2); }
:root[data-theme="fern"] .nav-head:hover { background: var(--surface-2); color: var(--text); }
:root[data-theme="fern"] .nav-sec.open { background: none; }
:root[data-theme="fern"] .nav-sec.has-active > .nav-head { color: var(--brand); }
:root[data-theme="fern"] .nav-count { color: var(--muted); }
:root[data-theme="fern"] .sidebar nav .nav-items a { border-inline-start-color: var(--border); }
:root[data-theme="fern"] .sidebar-foot { border-top-color: var(--border); }
:root[data-theme="fern"] .sidebar-foot .link { color: var(--text-2); }
:root[data-theme="fern"] .sidebar-foot .link:hover { color: var(--brand); }
:root[data-theme="fern"] .sidebar::-webkit-scrollbar-thumb { background: var(--border); }
:root[data-theme="fern"] .sidebar .theme-pick { color: var(--muted); }
:root[data-theme="fern"] .sidebar .theme-pick :is(select, .dd-btn) { background: var(--surface-2); color: var(--text); border-color: var(--border); }
:root[data-theme="fern"] .sidebar .theme-pick .dd-btn::after { border-color: var(--muted); }

:root[data-theme="fern"] .topbar { margin: 12px 12px 0; top: 12px; border-radius: 20px; box-shadow: var(--shadow); padding: 14px 22px; }
:root[data-theme="fern"] .topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
:root[data-theme="fern"] .topbar h1::after { width: 7px; height: 7px; }
:root[data-theme="fern"] .view { padding: 18px 12px 40px; gap: 16px; }

/* panels, tiles and tables: white, very round, no hard borders */
:root[data-theme="fern"] :is(.card, .tile, .table-wrap, .award, .lead-card, .mini, .sup-col, .home-results a) { border-color: transparent; }
:root[data-theme="fern"] .card { padding: 18px 20px; }
:root[data-theme="fern"] .card h2 { font-size: 16px; font-weight: 700; }
:root[data-theme="fern"] .tile { padding: 16px 18px; }
:root[data-theme="fern"] .tile.accent { border-top: 0; background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
:root[data-theme="fern"] .card .tile { background: var(--surface-2); box-shadow: none; }
:root[data-theme="fern"] .card .tile.accent { background: linear-gradient(160deg, var(--accent-soft), var(--surface-2) 70%); }
:root[data-theme="fern"] .table-wrap { box-shadow: var(--shadow); border-radius: 18px; }
:root[data-theme="fern"] th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
:root[data-theme="fern"] tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
:root[data-theme="fern"] .kpi-card { border-color: transparent; border-inline-start: 5px solid var(--c); }
:root[data-theme="fern"] .modal, :root[data-theme="fern"] .ask-box { border-radius: 24px; }
:root[data-theme="fern"] .dd-menu { border-radius: 14px; }

/* buttons and inputs: pills, the main action deep navy */
:root[data-theme="fern"] .btn { border-radius: 99px; padding-inline: 16px; border-color: color-mix(in srgb, var(--text) 22%, transparent); font-weight: 600; }
:root[data-theme="fern"] .btn.primary { background: linear-gradient(135deg, var(--brand), var(--fern-deep)); border-color: transparent; color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent); }
:root[data-theme="fern"] .btn.danger { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
:root[data-theme="fern"] .icon-btn { border-radius: 50%; }
:root[data-theme="fern"] :is(input, select, textarea, .dd-btn) { border-radius: 12px; }
:root[data-theme="fern"] input[type="search"], :root[data-theme="fern"] .home-hello input { border-radius: 99px; background: var(--surface-2); border-color: transparent; }
:root[data-theme="fern"] .seg { border-radius: 99px; border-color: transparent; }
:root[data-theme="fern"] .seg button { border-radius: 99px; }
:root[data-theme="fern"] .seg button.on { background: var(--fern-deep); color: #fff; box-shadow: none; }
:root[data-theme="fern"] .rec-tabs button.on { background: var(--fern-deep); }
:root[data-theme="fern"] .chip-btn, :root[data-theme="fern"] .mp-chip { border-radius: 99px; }
:root[data-theme="fern"] .btn.cv-btn, :root[data-theme="fern"] .btn.cv-btn:hover { background: linear-gradient(135deg, var(--brand-2), var(--fern-deep)); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }

/* dashboard hero tiles: the first one solid navy with a pink glow, all with a round arrow button */
:root[data-theme="fern"] .hero-tile { border: 0; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); padding: 20px 22px; }
:root[data-theme="fern"] .hero-tile::after { content: "\2197"; inset: 16px 16px auto auto; width: 34px; height: 34px; border-radius: 50%; background: none; color: var(--text);
  border: 1.5px solid color-mix(in srgb, var(--text) 70%, transparent); display: grid; place-items: center; font-size: 15px; font-weight: 700; line-height: 1; box-sizing: border-box; }
:root[data-theme="fern"][dir="rtl"] .hero-tile::after { content: "\2196"; inset: 16px auto auto 16px; }
:root[data-theme="fern"] .hero-tile .label { font-size: 16px; padding-inline-end: 44px; }
:root[data-theme="fern"] .hero-tile.h1 { background: radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--fern-pink) 38%, transparent) 0%, transparent 55%), linear-gradient(145deg, #3a36a0, var(--fern-deep));
  color: #fff; box-shadow: 0 10px 26px color-mix(in srgb, var(--fern-deep) 35%, transparent); }
:root[data-theme="fern"] .hero-tile.h1 :is(.label, .value, .sub) { color: #fff; }
:root[data-theme="fern"] .hero-tile.h1 .sub { opacity: .85; }
:root[data-theme="fern"] .hero-tile.h1::after { background: var(--fern-pink); color: var(--navy); border-color: var(--fern-pink); }
:root[data-theme="fern"] .hero-tile.h1 .delta { background: rgba(255,255,255,.16); color: #fff; }
:root[data-theme="fern"] .hero-tile:hover { box-shadow: 0 10px 26px rgba(30,28,90,.14); }
:root[data-theme="fern"] .mp-check::after { border-color: var(--navy); }

/* home (apps menu): soft round icons */
:root[data-theme="fern"] .home-icon { border: 0; border-radius: 24px; box-shadow: var(--shadow); }
:root[data-theme="fern"] .home-tile:hover .home-icon { box-shadow: 0 10px 22px rgba(30,28,90,.16); }
:root[data-theme="fern"] .home-icon .badge { background: var(--fern-pink); color: var(--navy); }
:root[data-theme="fern"] .page-actions .side-prefs .theme-pick :is(select, .dd-btn) { border-radius: 99px; }

/* login */
:root[data-theme="fern"] .login { background: radial-gradient(900px 480px at 50% -10%, color-mix(in srgb, var(--fern-pink) 30%, transparent), transparent 70%), var(--bg); }
:root[data-theme="fern"] .login-card { border: 0; border-radius: 24px; padding: 32px; }
:root[data-theme="fern"] .login .theme-pick :is(select, .dd-btn) { border-radius: 99px; }

/* small screens: the sidebar slides in as a normal full-height drawer */
@media (max-width: 800px) {
  :root[data-theme="fern"] .shell { grid-template-columns: 1fr; }
  :root[data-theme="fern"] .sidebar { margin: 0; height: 100vh; top: 0; border-radius: 0; }
  :root[data-theme="fern"] .topbar { margin: 8px 8px 0; top: 8px; border-radius: 16px; padding: 10px 14px; }
  :root[data-theme="fern"] .topbar h1 { font-size: 19px; }
  :root[data-theme="fern"] .view { padding: 14px 8px 40px; }
}
@media print {
  :root[data-theme="fern"] .topbar { margin: 0; }
  :root[data-theme="fern"] .hero-tile.h1 { background: #fff !important; color: #000; }
}

/* ---------- sign-in: a one-line drawing of housemaids at work under a glass card; its colours follow the chosen theme ---------- */
/* light (and "auto" on a light device) */
:root {
  --lg-bg: linear-gradient(180deg, #f8f7fd 0%, #efeefa 55%, #e5e3f6 100%);
  --lg-glow-a: rgba(255,161,156,.30); --lg-glow-b: rgba(120,110,230,.14);
  --lg-line: #2e2b80; --lg-line-2: #3d39a0; --lg-ground: #f2837c; --lg-shine: rgba(255,120,112,.95);
  --lg-card: linear-gradient(160deg, rgba(255,255,255,.82), rgba(255,255,255,.62)); --lg-card-border: rgba(46,43,128,.10); --lg-card-top: rgba(255,255,255,.95);
  --lg-card-shadow: 0 30px 80px rgba(46,43,128,.16), inset 0 1px 0 rgba(255,255,255,.8); --lg-sheen: rgba(255,255,255,.55);
  --lg-text: #1b1a3d; --lg-text-2: rgba(27,26,61,.6); --lg-label: rgba(27,26,61,.72);
  --lg-input: rgba(46,43,128,.04); --lg-input-on: #fff; --lg-input-border: rgba(46,43,128,.18); --lg-autofill: #f3f2fc;
  --lg-focus: #ff8f88; --lg-focus-ring: rgba(255,161,156,.28); --lg-err: #b3261e; --lg-link: rgba(27,26,61,.6);
  --lg-btn: linear-gradient(120deg, #ffb2ad, #c9bfff); --lg-btn-ink: #1f1c5e; --lg-btn-glow: rgba(255,161,156,.30); --lg-check: #1f1c5e;
  --lg-pick-text: rgba(27,26,61,.65); --lg-pick-bg: rgba(255,255,255,.7); --lg-pick-fg: #1b1a3d; --lg-pick-border: rgba(46,43,128,.15);
}
/* dark — Miss Helpers (and "auto" on a dark device) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --lg-bg: linear-gradient(180deg, #151244 0%, #1f1c5e 48%, #2e2b80 100%);
  --lg-glow-a: rgba(255,161,156,.16); --lg-glow-b: rgba(150,140,255,.14);
  --lg-line: #f3f1ff; --lg-line-2: #ece9ff; --lg-ground: #ffa19c; --lg-shine: rgba(255,161,156,.95);
  --lg-card: linear-gradient(160deg, rgba(62,58,158,.36), rgba(14,13,48,.58)); --lg-card-border: rgba(255,255,255,.14); --lg-card-top: rgba(255,255,255,.24);
  --lg-card-shadow: 0 30px 80px rgba(3,3,18,.55), inset 0 1px 0 rgba(255,255,255,.08); --lg-sheen: rgba(255,255,255,.11);
  --lg-text: #fff; --lg-text-2: rgba(226,226,255,.65); --lg-label: rgba(232,232,255,.72);
  --lg-input: rgba(255,255,255,.06); --lg-input-on: rgba(255,255,255,.09); --lg-input-border: rgba(255,255,255,.14); --lg-autofill: #25236a;
  --lg-focus: #ffa19c; --lg-focus-ring: rgba(255,161,156,.18); --lg-err: #ffb8b3; --lg-link: rgba(232,232,255,.7);
  --lg-btn: linear-gradient(120deg, #ffb2ad, #c9bfff); --lg-btn-ink: #1f1c5e; --lg-btn-glow: rgba(255,161,156,.22); --lg-check: #1f1c5e;
  --lg-pick-text: rgba(232,232,255,.7); --lg-pick-bg: rgba(20,18,60,.45); --lg-pick-fg: #fff; --lg-pick-border: rgba(255,255,255,.16);
} }
:root[data-theme="dark"] {
  --lg-bg: linear-gradient(180deg, #151244 0%, #1f1c5e 48%, #2e2b80 100%);
  --lg-glow-a: rgba(255,161,156,.16); --lg-glow-b: rgba(150,140,255,.14);
  --lg-line: #f3f1ff; --lg-line-2: #ece9ff; --lg-ground: #ffa19c; --lg-shine: rgba(255,161,156,.95);
  --lg-card: linear-gradient(160deg, rgba(62,58,158,.36), rgba(14,13,48,.58)); --lg-card-border: rgba(255,255,255,.14); --lg-card-top: rgba(255,255,255,.24);
  --lg-card-shadow: 0 30px 80px rgba(3,3,18,.55), inset 0 1px 0 rgba(255,255,255,.08); --lg-sheen: rgba(255,255,255,.11);
  --lg-text: #fff; --lg-text-2: rgba(226,226,255,.65); --lg-label: rgba(232,232,255,.72);
  --lg-input: rgba(255,255,255,.06); --lg-input-on: rgba(255,255,255,.09); --lg-input-border: rgba(255,255,255,.14); --lg-autofill: #25236a;
  --lg-focus: #ffa19c; --lg-focus-ring: rgba(255,161,156,.18); --lg-err: #ffb8b3; --lg-link: rgba(232,232,255,.7);
  --lg-btn: linear-gradient(120deg, #ffb2ad, #c9bfff); --lg-btn-ink: #1f1c5e; --lg-btn-glow: rgba(255,161,156,.22); --lg-check: #1f1c5e;
  --lg-pick-text: rgba(232,232,255,.7); --lg-pick-bg: rgba(20,18,60,.45); --lg-pick-fg: #fff; --lg-pick-border: rgba(255,255,255,.16);
}
/* dark classic: grey with purple */
:root[data-theme="dark-classic"] {
  --lg-bg: linear-gradient(180deg, #0f0f12 0%, #17171b 50%, #22202c 100%);
  --lg-glow-a: rgba(165,143,240,.16); --lg-glow-b: rgba(165,143,240,.08);
  --lg-line: #ecebf2; --lg-line-2: #dcd8f0; --lg-ground: #a58ff0; --lg-shine: rgba(185,167,245,.95);
  --lg-card: linear-gradient(160deg, rgba(56,54,70,.45), rgba(18,18,22,.65)); --lg-card-border: rgba(255,255,255,.10); --lg-card-top: rgba(255,255,255,.18);
  --lg-card-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); --lg-sheen: rgba(255,255,255,.08);
  --lg-text: #f2f2f4; --lg-text-2: rgba(242,242,244,.6); --lg-label: rgba(242,242,244,.7);
  --lg-input: rgba(255,255,255,.05); --lg-input-on: rgba(255,255,255,.08); --lg-input-border: rgba(255,255,255,.12); --lg-autofill: #24232b;
  --lg-focus: #a58ff0; --lg-focus-ring: rgba(165,143,240,.22); --lg-err: #f07d74; --lg-link: rgba(242,242,244,.65);
  --lg-btn: linear-gradient(120deg, #b9a7f5, #8f78e8); --lg-btn-ink: #16161a; --lg-btn-glow: rgba(165,143,240,.25); --lg-check: #16161a;
  --lg-pick-text: rgba(242,242,244,.65); --lg-pick-bg: rgba(30,30,36,.6); --lg-pick-fg: #f2f2f4; --lg-pick-border: rgba(255,255,255,.12);
}
/* Fernly navy: the light look on its lavender-grey, with the navy pill button */
:root[data-theme="fern"] {
  --lg-bg: linear-gradient(180deg, #f4f5fa 0%, #eceef6 55%, #e3e4f2 100%);
  --lg-glow-a: rgba(255,161,156,.30); --lg-glow-b: rgba(120,110,230,.14);
  --lg-line: #2e2b80; --lg-line-2: #3d39a0; --lg-ground: #f2837c; --lg-shine: rgba(255,120,112,.95);
  --lg-card: linear-gradient(160deg, rgba(255,255,255,.86), rgba(255,255,255,.68)); --lg-card-border: rgba(46,43,128,.08); --lg-card-top: rgba(255,255,255,.95);
  --lg-card-shadow: 0 30px 80px rgba(30,28,90,.14), inset 0 1px 0 rgba(255,255,255,.8); --lg-sheen: rgba(255,255,255,.55);
  --lg-text: #1b1a3d; --lg-text-2: rgba(27,26,61,.6); --lg-label: rgba(27,26,61,.72);
  --lg-input: #f4f4fa; --lg-input-on: #fff; --lg-input-border: rgba(46,43,128,.14); --lg-autofill: #f4f4fa;
  --lg-focus: #ff8f88; --lg-focus-ring: rgba(255,161,156,.28); --lg-err: #b3261e; --lg-link: rgba(27,26,61,.6);
  --lg-btn: linear-gradient(135deg, #3a36a0, #1f1c5e); --lg-btn-ink: #fff; --lg-btn-glow: rgba(46,43,128,.30); --lg-check: #1f1c5e; --lg-check-on: #1f1c5e;
  --lg-pick-text: rgba(27,26,61,.65); --lg-pick-bg: rgba(255,255,255,.75); --lg-pick-fg: #1b1a3d; --lg-pick-border: rgba(46,43,128,.12);
}

.sky-scene { display: none; position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--lg-bg); }
body:has(#login:not(.hidden)) .sky-scene, body:has(#gate:not(.hidden)) .sky-scene { display: block; }
#login, #gate { position: relative; z-index: 1; background: none; }
/* on a tall enough screen the card sits above the drawing instead of over it */
@media (min-height: 700px) { #login, #gate { padding-bottom: calc(var(--mh-art-h) + 3vh - 10px); } }
/* phones: the two pickers side by side on top */
@media (max-width: 520px) {
  .login-prefs { flex-direction: row; gap: 8px; } .login .theme-pick { width: 150px; }
  #login, #gate { padding-top: 72px; }
}
.mh-glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.mh-glow.a { width: 46vw; height: 46vw; right: -12vw; top: -18vw; background: var(--lg-glow-a); }
.mh-glow.b { width: 40vw; height: 40vw; left: -14vw; bottom: 4vh; background: var(--lg-glow-b); }
/* the drawing is public/login-art.png used as a mask: theme-coloured lines, the ground line in the accent, drawn in from left to right,
   then a soft light keeps passing along it. Its height follows the picture's shape (2000 × 234), so the five scenes fit. */
body { --mh-art-h: clamp(150px, 11.7vw, 300px); }
.mh-art { position: absolute; left: 0; right: 0; bottom: 3vh; height: var(--mh-art-h); transition: transform .8s cubic-bezier(.2,.7,.3,1);
  -webkit-mask: url("/login-art.png") center bottom / auto 100% no-repeat; mask: url("/login-art.png") center bottom / auto 100% no-repeat;
  background: linear-gradient(100deg, transparent 42%, var(--lg-shine) 50%, transparent 58%) 130% 0 / 260% 100% no-repeat,
    linear-gradient(180deg, var(--lg-line) 0%, var(--lg-line-2) 74%, var(--lg-ground) 92%, var(--lg-ground) 100%);
  clip-path: inset(0 100% 0 0); animation: mh-reveal 3.2s cubic-bezier(.5,.1,.3,1) .2s forwards, mh-shine 7s ease-in-out 3.6s infinite; }
@keyframes mh-reveal { to { clip-path: inset(0 0 0 0); } }
/* Home, Pulse, Dashboard: the page comes in from a soft blur, its cards one after another (mhMotion in app.js) */
@keyframes mh-page { from { opacity: 0; } }
@keyframes mh-card { from { opacity: 0; filter: blur(8px); transform: translateY(14px) scale(.98); } }
@keyframes mh-content { from { opacity: 0; filter: blur(4px); } }
@keyframes mh-word { from { opacity: 0; filter: blur(8px); transform: translateY(4px); } }
@keyframes mh-pop { from { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } }
@keyframes mh-row { from { opacity: 0; transform: translateX(calc(var(--mh-dir, 1) * -10px)); } }
#view.mh-enter { animation: mh-page .3s ease-out; }
/* "backwards": hidden while it waits its turn, and nothing held after — so the hover lift still works */
.mh-in { animation: mh-card .5s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--mh-i, 0) * 45ms + 60ms); }
.mh-counting { font-variant-numeric: tabular-nums; }
/* what is in a card comes in just after the card itself; the lines of a Pulse card one after another */
.mh-in > :not(.pulse-row) { animation: mh-content .45s ease-out backwards; animation-delay: calc(var(--mh-i, 0) * 45ms + 220ms); }
.mh-in > .pulse-row { animation: mh-row .35s ease-out backwards; animation-delay: calc(var(--mh-i, 0) * 45ms + 260ms + var(--mh-r, 0) * 40ms); }
[dir="rtl"] .mh-in > .pulse-row { --mh-dir: -1; }
/* the ▲▼ against the period before pops in once the number has counted */
.mh-in .kpi-delta { display: inline-block; animation: mh-pop .35s ease-out backwards; animation-delay: calc(var(--mh-i, 0) * 45ms + 1000ms); }
/* the greeting word by word */
.mh-word { display: inline-block; animation: mh-word .5s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--mh-w, 0) * 90ms); }
/* the picked period / month slides to its button (a moving copy of its background) */
.pulse-period, #page-actions .seg { position: relative; }
.mh-slide { position: absolute; z-index: 0; pointer-events: none; }
.mh-sliding > button { position: relative; z-index: 1; }
.mh-sliding > button.on, .mh-sliding > button.primary { background: transparent !important; box-shadow: none !important; border-color: transparent !important; }
/* the cards lift under the mouse */
a.tile, .pulse-card { transition: transform .18s, box-shadow .18s, border-color .15s; }
a.tile:hover, .pulse-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .1); }
@media (prefers-reduced-motion: reduce) { #view.mh-enter, .mh-in, .mh-in > *, .mh-in .kpi-delta, .mh-word { animation: none; } a.tile:hover, .pulse-card:hover { transform: none; } }
@keyframes mh-shine { 0% { background-position: 130% 0, 0 0; } 60%, 100% { background-position: -30% 0, 0 0; } }

/* the glass card */
#login .login-card { position: relative; max-width: 392px; padding: 34px 32px 28px; gap: 15px; border-radius: 26px; color: var(--lg-text);
  border: 1px solid var(--lg-card-border); border-top-color: var(--lg-card-top); background: var(--lg-card);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); box-shadow: var(--lg-card-shadow);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .3s ease-out; }
#login .login-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(440px circle at var(--mx, 30%) var(--my, 0%), var(--lg-sheen), transparent 45%); }
#login .login-card > * { position: relative; }
#login .login-logo { justify-items: start; margin: 0; }
#login .login-logo .logo-img { width: 150px; }
#login .login-hello h1 { margin: 6px 0 2px; font-size: 30px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; color: var(--lg-text); }
#login .login-hello p { margin: 0; color: var(--lg-text-2); font-size: 13.5px; }
#login .login-card label { color: var(--lg-label); font-size: 12.5px; font-weight: 500; }
#login .login-card input { min-height: 46px; padding: 10px 14px; border-radius: 12px; color: var(--lg-text); background: var(--lg-input);
  border: 1px solid var(--lg-input-border); transition: border-color .15s, background .15s, box-shadow .15s; }
#login .login-card input:focus { outline: none; background: var(--lg-input-on); border-color: var(--lg-focus); box-shadow: 0 0 0 3px var(--lg-focus-ring); }
#login .login-card input:-webkit-autofill { -webkit-text-fill-color: var(--lg-text); box-shadow: inset 0 0 0 100px var(--lg-autofill); caret-color: var(--lg-text); }
#login .error { color: var(--lg-err); min-height: 0; }
#login .error:empty { display: none; }
#login .link { color: var(--lg-link); justify-self: center; } #login .link:hover { color: var(--lg-focus); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-inline-end: 46px !important; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: none; color: var(--lg-label); opacity: .8; cursor: pointer; }
.pw-eye:hover { opacity: 1; color: var(--lg-text); background: var(--lg-input); }
.pw-eye .eye-off, .pw-eye[aria-pressed="true"] .eye-on { display: none; } .pw-eye[aria-pressed="true"] .eye-off { display: block; }
/* remember me */
#login .remember { display: flex; align-items: center; gap: 10px; margin-top: -2px; font-size: 13px; cursor: pointer; user-select: none; }
#login .remember input { appearance: none; -webkit-appearance: none; flex: none; width: 19px; height: 19px; min-height: 0; padding: 0; margin: 0; border-radius: 6px;
  border: 1.5px solid var(--lg-input-border); background: var(--lg-input); display: inline-grid; place-content: center; cursor: pointer; }
#login .remember input::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid var(--lg-check); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .15s; }
#login .remember input:checked { background: var(--lg-focus); border-color: var(--lg-focus); }
#login .remember input:checked::after { transform: rotate(45deg) scale(1); }
#login .remember input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lg-focus-ring); }

/* the buttons; sign-in has a door with a little figure that walks in */
#login .login-card .btn.primary { min-height: 48px; border: 0; border-radius: 14px; font-size: 15px; font-weight: 700; color: var(--lg-btn-ink);
  background: var(--lg-btn); box-shadow: 0 10px 28px var(--lg-btn-glow), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .15s, filter .15s, box-shadow .2s; }
#login .login-card .btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 14px 34px var(--lg-btn-glow), inset 0 1px 0 rgba(255,255,255,.4); }
.login-go { position: relative; overflow: hidden; display: flex; align-items: center; padding-inline: 18px; }
.login-go.is-busy { pointer-events: none; }
.go-scene { position: absolute; inset-block: 0; inset-inline-end: 12px; width: 64px; }
html[dir="rtl"] .go-scene { transform: scaleX(-1); }
.go-door { position: absolute; right: 2px; top: 50%; width: 19px; height: 27px; margin-top: -13px; border-radius: 4px 4px 1px 1px;
  background: radial-gradient(circle at 50% 70%, #fff3d6, #ffc9a8 60%, #c08ad8); box-shadow: inset 0 0 0 1.5px var(--lg-btn-ink); perspective: 60px; transition: opacity .25s; }
.go-door i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(#efeaff, #cdc3ff); box-shadow: inset 0 0 0 1.5px var(--lg-btn-ink);
  transform-origin: right center; transition: transform .45s ease .15s; }
.go-door i::after { content: ""; position: absolute; left: 4px; top: 13px; width: 3px; height: 3px; border-radius: 50%; background: var(--lg-btn-ink); }
.go-walker { position: absolute; right: 30px; top: 50%; margin-top: -12px; width: 14px; height: 24px; color: var(--lg-btn-ink); transition: opacity .25s; }
.go-walker svg { display: block; overflow: visible; }
.go-walker :is(.leg-a, .leg-b, .arm-a, .arm-b) { transform-box: view-box; }
.go-walker :is(.leg-a, .leg-b) { transform-origin: 7px 14px; } .go-walker :is(.arm-a, .arm-b) { transform-origin: 7px 8px; }
.login-go.is-busy .go-door i { transform: rotateY(75deg); }
.login-go.is-busy .go-walker { animation: go-walk .9s ease-in forwards; }
.login-go.is-busy .go-walker :is(.leg-a, .arm-b) { animation: go-swing .3s ease-in-out infinite alternate; }
.login-go.is-busy .go-walker :is(.leg-b, .arm-a) { animation: go-swing .3s ease-in-out infinite alternate-reverse; }
@keyframes go-walk { 0% { transform: translateX(0); opacity: 1; } 78% { transform: translateX(22px); opacity: 1; } 100% { transform: translateX(27px) scale(.85); opacity: 0; } }
@keyframes go-swing { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
.go-check { position: absolute; right: 0; top: 50%; width: 28px; height: 28px; margin-top: -14px; display: grid; place-items: center; border-radius: 50%;
  background: var(--lg-btn-ink); color: var(--lg-check-on, #fff); font-size: 15px; font-weight: 700; transform: scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
html[dir="rtl"] .go-check { transform: scaleX(-1) scale(0); }
.login-go.is-done .go-door, .login-go.is-done .go-walker { opacity: 0; }
.login-go.is-done .go-check { transform: scale(1); } html[dir="rtl"] .login-go.is-done .go-check { transform: scaleX(-1) scale(1); }

/* appearance / language pickers over the scene */
#login .login-prefs .theme-pick { color: var(--lg-pick-text); }
#login .login-prefs .theme-pick :is(select, .dd-btn) { background: var(--lg-pick-bg); color: var(--lg-pick-fg); border-color: var(--lg-pick-border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#login .login-prefs .theme-pick .dd-btn::after { border-color: var(--lg-pick-text); }

@media (max-width: 520px) {
  #login .login-card { padding: 28px 22px 24px; border-radius: 22px; }
  #login .login-hello h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-art { animation: none; clip-path: none; }
  #login .login-card { transform: none; transition: none; }
  .login-go.is-busy .go-walker { animation: none; opacity: 0; }
}

/* ---------- the two-step code: six boxes that seal shut (login.js) ---------- */
#login .sigil { position: relative; height: 60px; margin: 6px 0 2px; }
#login .sigil .sigil-input { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0;
  background: none; color: transparent; caret-color: transparent; font-size: 16px; cursor: text; box-shadow: none; }
.sigil-cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; transition: gap .45s cubic-bezier(.6,0,.2,1); }
.sigil-cells i { position: relative; display: grid; place-items: center; font-style: normal; font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--lg-text); background: var(--lg-input); border: 1.5px solid var(--lg-input-border); border-radius: 13px;
  transition: border-color .2s, background .25s, border-radius .45s, box-shadow .2s, opacity .3s, color .3s; }
.sigil-cells i.filled { border-color: color-mix(in srgb, var(--lg-focus) 55%, var(--lg-input-border)); animation: sg-press .28s ease-out; }
.sigil.focus .sigil-cells i.on { border-color: var(--lg-focus); box-shadow: 0 0 0 3px var(--lg-focus-ring); }
.sigil.focus .sigil-cells i.on:empty::after { content: ""; width: 2px; height: 26px; border-radius: 2px; background: var(--lg-focus); animation: sg-caret 1s steps(1) infinite; }
@keyframes sg-press { 0% { transform: scale(.84); } 60% { transform: scale(1.07); } 100% { transform: none; } }
@keyframes sg-caret { 50% { opacity: 0; } }
/* full: the boxes close into one band and the seal stamps down on it */
.sigil.is-sealed .sigil-cells { gap: 0; }
.sigil.is-sealed .sigil-cells i { border-radius: 0; border-inline-start-width: 0; color: color-mix(in srgb, var(--lg-text) 55%, transparent); box-shadow: none;
  border-color: var(--lg-focus); background: color-mix(in srgb, var(--lg-focus) 12%, var(--lg-input)); }
.sigil.is-sealed .sigil-cells i:first-child { border-inline-start-width: 1.5px; border-radius: 16px 0 0 16px; }
.sigil.is-sealed .sigil-cells i:last-child { border-radius: 0 16px 16px 0; }
.sigil-seal { position: absolute; left: 50%; top: 50%; z-index: 3; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; pointer-events: none;
  display: grid; place-items: center; color: #2e2b80; opacity: 0; transform: scale(2.4) rotate(-30deg);
  background: radial-gradient(circle at 35% 30%, #ffd6d2, #ffa19c 46%, #e8746d 100%);
  box-shadow: 0 8px 20px rgba(232,116,109,.42), inset 0 -3px 7px rgba(120,30,30,.18), inset 0 2px 4px rgba(255,255,255,.55); }
.sigil-seal::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px dashed rgba(46,43,128,.42); }
.sigil-seal::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--lg-focus); opacity: 0; }
.sigil-seal .sg-check { display: none; font-size: 26px; font-weight: 800; line-height: 1; }
.sigil.is-sealed .sigil-seal { animation: sg-stamp .55s cubic-bezier(.3,1.4,.5,1) .3s forwards; }
.sigil.is-sealed .sigil-seal::after { animation: sg-ripple .7s ease-out .6s; }
@keyframes sg-stamp { 0% { opacity: 0; transform: scale(2.4) rotate(-30deg); } 55% { opacity: 1; transform: scale(.86, .8) rotate(4deg); } 100% { opacity: 1; transform: none; } }
@keyframes sg-ripple { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
/* checking: the seal's ring turns; right: it glows with a check; wrong: it shakes, falls, and the boxes open again */
.sigil.is-checking .sigil-seal::before { animation: sg-spin 2.4s linear infinite; }
@keyframes sg-spin { to { transform: rotate(360deg); } }
.sigil.is-ok .sigil-seal { box-shadow: 0 0 0 6px color-mix(in srgb, var(--lg-focus) 25%, transparent), 0 8px 26px rgba(232,116,109,.5), inset 0 2px 4px rgba(255,255,255,.55); }
.sigil.is-ok .sg-crown { display: none; } .sigil.is-ok .sg-check { display: block; }
.sigil.is-broken .sigil-seal { animation: sg-break .6s ease-in forwards; }
.sigil.is-broken .sigil-cells { animation: sg-shake .45s ease-in-out; }
.sigil.is-broken .sigil-cells i { border-color: var(--lg-err); background: color-mix(in srgb, var(--lg-err) 10%, var(--lg-input)); }
@keyframes sg-break { 0% { opacity: 1; transform: none; } 20% { transform: rotate(-14deg) translateX(-4px); } 40% { transform: rotate(10deg) translateX(4px); }
  60% { opacity: 1; transform: rotate(-6deg); } 100% { opacity: 0; transform: translateY(26px) scale(.6) rotate(24deg); } }
@keyframes sg-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@media (max-width: 400px) { .sigil-cells { gap: 6px; } .sigil-cells i { font-size: 22px; border-radius: 11px; } }
@media (prefers-reduced-motion: reduce) {
  .sigil-cells, .sigil-cells i { transition: none; animation: none !important; }
  .sigil.is-sealed .sigil-seal { animation: none; opacity: 1; transform: none; }
  .sigil-seal::after, .sigil.is-checking .sigil-seal::before, .sigil.is-broken .sigil-seal { animation: none; }
}

/* ---------- weekly / monthly reports ---------- */
.rep-intro { line-height: 1.7; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rep-card { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform .12s, border-color .12s; }
.rep-card:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.rep-card.month { background: linear-gradient(140deg, color-mix(in srgb, var(--coral) 16%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--coral) 45%, var(--border)); }
.rep-card b { font-size: 15px; }
.rep-card .pill { justify-self: start; margin-top: 4px; }
.rep-kind { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
html[lang="ar"] .rep-kind { letter-spacing: 0; font-size: 12px; }
.rep-card.month .rep-kind { color: var(--coral); }
.rep-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .rep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rep-table td, .rep-table th { white-space: nowrap; }
.rep-table td:first-child { font-weight: 500; }
@media print { .rep-table .delta { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.page-actions a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
.ren-hidden { flex-basis: 100%; margin-top: 4px; }
.ren-hidden > summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.ren-hidden .table-wrap { margin-top: 8px; }

/* Role permissions › Paper Work: which section each paper belongs to */
.paper-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 16px; }
.paper-g { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.paper-g select { width: 140px; flex: none; min-height: 34px; }
.paper-g .dd-btn { width: 140px; flex: none; min-height: 34px; }
.role-chip.r-office { background: color-mix(in srgb, #0f8b8d 16%, var(--surface)); color: #0f8b8d; }

/* a form where only some fields can be edited (e.g. the Office Admin on an Outside Visa): the locked ones look locked */
.form-grid.only-some :is(input, textarea):disabled { opacity: .55; cursor: default; }
/* the records pages' month picker in the top bar, before Export / Add */
.page-actions .month-nav { gap: 6px; margin-inline-end: 6px; }
.page-actions .month-nav > span { margin-inline-end: 4px; }

/* ---- النبض (Pulse): the owner's page ---- */
.pulse-period { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pulse-period input[type="date"] { width: auto; min-height: 30px; }
.pulse-hello { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pulse-hello h2 { margin: 0; font-size: 20px; }
.pulse-alerts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; font-size: 13px; }
.pulse-alerts a.pill { text-decoration: none; font-size: 13px; padding: 5px 12px; }
.pulse-alerts a.pill:hover { filter: brightness(1.08); }
.pulse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.pulse-card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; margin: 0; transition: border-color .15s, transform .15s; }
.pulse-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-1px); }
.pulse-card-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.pulse-card-head b { font-size: 22px; }
.pulse-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.pulse-row:last-of-type { border-bottom: 0; }
.pulse-row > span:first-child { color: var(--text-2); }
.pulse-row .delta { font-size: 11px; }
.pulse-pills { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0 6px; }
.pulse-pills .pill { font-size: 11.5px; }
.pulse-stages { display: grid; gap: 4px; padding: 4px 0 6px; }
.pulse-stages div { display: grid; grid-template-columns: 110px 1fr 28px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.pulse-stages i { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); position: relative; overflow: hidden; }
.pulse-stages i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: var(--brand); border-radius: 3px; }
.pulse-stages b { text-align: end; color: var(--text); }
.pulse-more { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--muted); }
.pulse-pick { display: grid; gap: 6px; }
.pulse-pick-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.pulse-pick-row .icon-btn { width: 28px; height: 28px; font-size: 11px; }
@media (max-width: 900px) { .pulse-grid { grid-template-columns: 1fr; } }

/* Outside Supply: the supply manager's one-chip-per-employee filter */
.sup-owners { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.sup-owners button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 500; }
.sup-owners button b { margin-inline-start: 4px; color: var(--text); }
.sup-owners button:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.sup-owners button.on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.sup-owners button.on b { color: var(--brand); }
.pulse-list { display: grid; gap: 2px; padding: 4px 0 6px; }
.pulse-list > div { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.pulse-list > div:last-child { border-bottom: 0; }
.pulse-list b { font-weight: 600; }

/* a CS login: the note that the page shows only their own contracts / renewals */
.cs-only-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; }
.ren-cs { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ren-cs select { width: auto; min-width: 120px; }

/* HR › team breaks & day off */
.sb-tile { font: inherit; color: inherit; cursor: pointer; text-align: start; }
.sb-tile.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.sb-tile.sb-sat .value { color: var(--s2); }
.sb-tile.sb-sun .value { color: var(--s1); }
.sb-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.sb-card { min-width: 0; }
.sb-card h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sb-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-top: 1px dashed var(--border); cursor: pointer; border-radius: 6px; }
.sb-row:first-of-type { border-top: 0; }
.sb-row:hover, .sb-row:focus-visible { background: var(--surface-2); outline: none; }
.sb-row.dim { display: none; }
/* the name on top, its break under it, the day off at the end: fits any card width */
.sb-who { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.sb-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.sb-off { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; min-width: 64px; white-space: nowrap; text-align: center; background: var(--surface-2); color: var(--text-2); }
.sb-off.sb-sat { background: var(--accent-soft); color: var(--s2); }
.sb-off.sb-sun { background: color-mix(in srgb, var(--s1) 16%, var(--surface)); color: var(--s1); }

/* the Paper Work tab of a user's permissions: a section's "All" next to its name; the tabs above the lists */
.perm-grp [data-psec] { margin-inline-start: 10px; font-weight: 600; font-size: 12px; }
.perm-box .perm-tabs { margin: 10px 0 6px; }

/* a list's filtered total next to its count (Refunds: the amount of what the filters show) */
.count .count-sum { margin-inline-start: 10px; padding-inline-start: 10px; border-inline-start: 1px solid var(--border); white-space: nowrap; }
.filters .count .count-sum b { font-size: 20px; }
/* Employee profile › Contracts: the items with their counts (a click goes to its table) */
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chips .pill { font-size: 13px; padding: 4px 12px; text-decoration: none; }
.pf-chips a.pill[href] { cursor: pointer; }
.pf-chips a.pill[href]:hover { filter: brightness(.96); }
/* the Contracts tab's check list */
.pf-cats { flex-wrap: wrap; }
.pf-cats .neg-tab b { color: var(--bad); }
.pf-note { margin: 8px 2px 0; }
.pf-chk { width: 34px; text-align: center; cursor: default; }
tr.pf-ok td { background: color-mix(in srgb, var(--good) 7%, transparent); }
.pf-search { padding: 10px 14px; }
.pf-search input { width: 100%; }
.pf-cats .pf-none { opacity: .45; }
/* the Overview / Contracts bar, with the Contracts search on its other side */
.pf-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pf-q { margin-inline-start: auto; width: min(320px, 100%); min-height: 36px; }
/* Salary & attendance: Attendance, Salary and Net due side by side, as many as fit */
.att-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.att-grid > .side-col { display: contents; }
.att-grid .att-actions .btn { white-space: normal; max-width: 100%; }
/* the profile's Overview / Contracts: the page's spacing between their sections */
#pf-overview, #pf-contracts { display: grid; gap: 18px; align-content: start; min-width: 0; }
#pf-overview > *, #pf-contracts > * { min-width: 0; }
#pf-overview[hidden], #pf-contracts[hidden] { display: none; }
/* the commission table's Total column, in from the edge */
.comm th:last-child, .comm td:last-child { padding-inline-end: 22px; }
.comm td.amt:last-child { text-align: center; }
/* the commission table: Last month and Total in the middle of their columns, the totals under Total */
.comm .prev-col, .comm th:last-child, .comm td:last-child, .comm td.amt:last-child { text-align: center; }
.comm tfoot td[colspan="2"] { white-space: nowrap; }
/* the profile's reviews target: how many were actually done (from Google Reviews) */
.tb-done { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 34px; padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2); color: var(--text); text-decoration: none; }
.tb-done b { font-size: 16px; }
.tb-done small { font-size: 11px; }
.tb-done.met b { color: var(--good); }
.tb-done:hover { outline: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); }
/* a contract whose Odoo order was cancelled */
tr.pf-cancel td { background: color-mix(in srgb, var(--bad) 8%, transparent); }
tr.pf-cancel td.ltr { text-decoration: line-through; color: var(--bad); }
/* CS performance: a card per CS, the one picked opens its lists */
.cs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.cs-card { text-align: start; font: inherit; color: inherit; cursor: pointer; display: grid; gap: 10px; border: 1px solid var(--border); }
.cs-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.cs-card.cs-none { opacity: .8; }
.cs-card-head { display: flex; align-items: center; gap: 10px; }
.cs-card-head b { font-size: 15px; }
.cs-score { margin-inline-start: auto; font-size: 22px; font-weight: 800; }
.cs-score.good { color: var(--good); } .cs-score.warn { color: var(--warn); } .cs-score.bad { color: var(--bad); }
.cs-lines { display: grid; gap: 4px; font-size: 13px; }
.cs-lines > div:not(.muted) { display: flex; align-items: center; gap: 8px; }
.cs-lines > div:not(.muted) span:first-child { flex: 1; color: var(--text-2); }
.cs-tabs { margin: 4px 0 12px; }
/* the Ads report: room for the spend with its decimals; no up / down arrows in the number boxes */
.spend-table input[data-k="amount"] { width: 118px; }
.spend-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.spend-table input[type="number"]::-webkit-inner-spin-button, .spend-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Google reviews — AI replies (needs a reply / published / preview) */
.rv-ai-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 10px; }
.rv-ai-list .rv-ai-all { grid-column: 1 / -1; margin: 0; }
.rv-ai { display: flex; flex-direction: column; gap: 8px; box-shadow: none; }
.rv-ai .rv-text { margin-top: 0; }
.rv-ai-why { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rv-ai-note { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); }
.rv-ai-box { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.rv-ai-box textarea { width: 100%; min-height: 170px; font: inherit; font-size: 14px; line-height: 1.6; color: var(--text); resize: vertical; }
.rv-ai-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.rv-reply { font-size: 13px; line-height: 1.6; white-space: pre-line; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, color-mix(in srgb, var(--brand) 6%, transparent)); border-inline-start: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.rv-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .rv-cmp { grid-template-columns: 1fr; } }
.rv-ai-sw { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ttl-filters label { display: flex; align-items: center; gap: 6px; }
.ttl-filters .mp-chips { flex-basis: 100%; }

/* ---------- Office TV (شاشة العرض): the office TV's content ---------- */
.dsp-state { align-self: center; font-size: 13px; color: var(--muted); }
.dsp-state.dirty { color: var(--warn); font-weight: 600; }
.dsp-state.saved { color: var(--good); }
#dsp-save:disabled { opacity: .45; cursor: default; filter: none; }
.dsp-tabs { flex-wrap: wrap; justify-self: start; }
.dsp { display: grid; gap: 14px; }
.dsp :is(input, textarea) { text-transform: none !important; } /* shown on the TV as typed (beats the app-wide capitals rule) */
.dsp-lead { margin: 0; max-width: 780px; }
.dsp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dsp-head p { margin: 0; max-width: 720px; }
.dsp-ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.dsp .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: var(--text-2); text-decoration: none; }
.dsp .icon-btn:disabled { opacity: .35; cursor: default; }
.dsp .icon-btn.danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.dsp-list { display: grid; gap: 10px; }
.dsp-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 14px; align-items: center; }
.dsp-row.off { border-style: dashed; background: var(--surface-2); }
.dsp-num { font-weight: 700; color: var(--muted); font-size: 13px; text-align: center; }
.dsp-order { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dsp-main { min-width: 0; display: grid; gap: 6px; }
.dsp-file { font-size: 12px; color: var(--muted); direction: ltr; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsp-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dsp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dsp-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dsp-btns { display: flex; gap: 6px; align-items: center; }
.dsp-btns.dsp-col { flex-direction: column; }
.dsp-vrow { grid-template-columns: auto 150px 1fr auto; }
.dsp-vrow.off .dsp-thumb, .dsp-vrow.off .dsp-main, .dsp-arow.off .dsp-main { opacity: .5; }
.dsp-thumb { width: 150px; height: 96px; border-radius: 9px; background: #12104a; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.dsp-thumb video { max-width: 100%; max-height: 100%; display: block; }
.dsp-arow { grid-template-columns: auto 1fr auto; }
.dsp-arow audio { width: 100%; height: 36px; }
.dsp-arow .dsp-file { max-width: 60%; }
/* switch */
.dsp-switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 12px; background: var(--border); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: 0 0 auto; }
.dsp-switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.dsp-switch:checked { background: var(--good); }
.dsp-switch:checked::after { inset-inline-start: 21px; }
.dsp-switch:disabled { opacity: .6; cursor: default; }
.dsp-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dsp-switch-row b { display: block; color: var(--text); font-size: 14px; }
.dsp-switch-row small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
/* upload */
.dsp-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 2px dashed var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dsp-drop:hover, .dsp-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.dsp-drop .dsp-ico { width: 32px; height: 32px; stroke: var(--brand-2); stroke-width: 1.8; }
.dsp-drop b { color: var(--text); font-size: 14px; }
.dsp-drop small { color: var(--muted); font-size: 12px; font-weight: 400; }
.dsp-up { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; margin-bottom: 8px; font-size: 13px; }
.dsp-up-name { flex: 0 1 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsp-up-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.dsp-up-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.dsp-up-pct { white-space: nowrap; color: var(--muted); }
.dsp-up.done .dsp-up-bar i { background: var(--good); }
.dsp-up.fail .dsp-up-bar i { background: var(--bad); }
.dsp-up.fail .dsp-up-pct { color: var(--bad); white-space: normal; max-width: 55%; }
/* show order */
.dsp-srow { grid-template-columns: 30px 44px 1fr auto auto; }
.dsp-sicon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.dsp-sicon.vid { background: var(--accent-soft); color: var(--bad); }
.dsp-sicon .dsp-ico { width: 21px; height: 21px; stroke-width: 1.8; }
.dsp-sname b { display: block; font-size: 14px; }
.dsp-sname small { display: block; color: var(--muted); font-size: 12px; }
.dsp-sname .dsp-hidden { display: none; color: var(--warn); font-weight: 600; }
.dsp-srow.off .dsp-sicon, .dsp-srow.off .dsp-sname b, .dsp-srow.off .dsp-dur, .dsp-srow.off .dsp-num { opacity: .45; }
.dsp-srow.off .dsp-hidden { display: block; }
.dsp-dur { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dsp-dur input { width: 74px; text-align: center; }
.dsp-loop { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; color: var(--muted); }
.dsp-loop b { color: var(--text); }
.dsp-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dsp-srow.open { border-color: var(--brand-2); }
.dsp .icon-btn.on { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand); }
.dsp-editor { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 12px; }
.dsp-ed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dsp-sub-h { font-weight: 700; color: var(--text); font-size: 13px; margin-top: 6px; }
.dsp-editor textarea { min-height: 60px; }
.dsp-add select { width: auto; min-width: 200px; }
/* audio */
.dsp-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dsp-choice-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; color: var(--text); }
.dsp-choice-item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.dsp-choice-item input { width: auto; min-height: 0; margin-top: 5px; accent-color: var(--brand); }
.dsp-choice-item b { display: block; }
.dsp-choice-item small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.dsp input[type=range] { padding: 0; border: 0; min-height: 0; accent-color: var(--brand); }
.dsp-dim > .form-grid, .dsp-dim .dsp-list { opacity: .55; }
.dsp-yt { display: flex; gap: 10px; }
.dsp-yt input { flex: 1; }
/* prices */
.dsp-cur { display: flex; gap: 10px; }
.dsp-cur label { width: 130px; }
.dsp-ptable-wrap { padding: 0; overflow-x: auto; }
.dsp-ptable { width: 100%; border-collapse: collapse; min-width: 900px; }
.dsp-ptable th { background: var(--brand); color: #fff; font-weight: 600; font-size: 12px; padding: 10px 8px; text-align: center; line-height: 1.35; }
.dsp-ptable th small { color: var(--accent); font-weight: 500; }
.dsp-ptable td { padding: 6px; border-top: 1px solid var(--border); }
.dsp-ptable td input { padding: 7px 8px; text-align: center; }
.dsp-ptable td.dsp-min input { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.dsp-ptable .dsp-td-sw { width: 1%; text-align: center; padding: 6px 12px; }
.dsp-ptable .dsp-nowrap { white-space: nowrap; width: 1%; }
.dsp-ptable tr.off td { background: var(--surface-2); }
.dsp-ptable tr.off td:not(.dsp-td-sw):not(.dsp-nowrap) { opacity: .45; }
/* reviews */
.dsp-rrow { grid-template-columns: 30px 1fr auto; align-items: start; }
.dsp-rrow .dsp-num { padding-top: 6px; }
.dsp-rrow.not-on-tv { background: var(--surface-2); }
.dsp-rfields { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }
.dsp-rnote { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -4px; }
.dsp-rrow.off .dsp-rfields label { opacity: .45; }
.dsp-rrow.off .dsp-rnote { color: var(--warn); font-weight: 600; }
.dsp-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.dsp-count.warn { color: var(--warn); }
.dsp-count.bad { color: var(--bad); font-weight: 600; }
/* settings */
.dsp-steps { margin: 0 0 10px; padding-inline-start: 22px; line-height: 2; }
.dsp-addr { font-size: 16px; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.dsp-tv-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; margin-bottom: 10px; }
.dsp-tv-status .muted { display: block; font-size: 12px; }
.dsp-log { white-space: pre-wrap; font: 12px/1.6 ui-monospace, Consolas, monospace; max-height: 320px; overflow: auto; background: var(--surface-2); border-radius: 8px; padding: 10px; margin-top: 8px; text-align: left; }
@media (max-width: 760px) {
  .dsp-vrow { grid-template-columns: auto 1fr; }
  .dsp-vrow .dsp-thumb { display: none; }
  .dsp-vrow .dsp-side { flex-direction: row; grid-column: 1 / -1; justify-content: flex-start; }
  .dsp-two, .dsp-rfields, .dsp-choice { grid-template-columns: 1fr; }
  .dsp-srow { grid-template-columns: 26px 1fr auto; }
  .dsp-srow .dsp-sicon { display: none; }
  .dsp-srow .dsp-dur { grid-column: 2; }
  .dsp-srow .dsp-btns { grid-column: 1 / -1; flex-wrap: wrap; }
}
.dsp-sub-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dsp-item-sw { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); font-size: 12px; }
.dsp-sub-h.dsp-item-off { color: var(--muted); text-decoration: line-through; }
.dsp-sub-h.dsp-item-off .dsp-item-sw { text-decoration: none; color: var(--warn); }
.dsp-img-ed { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dsp-img-prev { width: 384px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #12104a; }
.dsp-img-side { flex: 1; min-width: 260px; display: grid; gap: 10px; }
.dsp-vslot { width: auto; max-width: 100%; min-width: 260px; margin: 6px 0 4px; min-height: 32px; padding: 4px 8px; font-size: 13px; }
