/* 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 { 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.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.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: 260px; z-index: 20; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow); }
  .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); }

/* ---------- 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); }
.row-actions { white-space: nowrap; display: flex; gap: 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-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 ---------- */
.ad-table td { padding: 6px 8px; vertical-align: middle; }
.ad-table input { width: 92px; min-height: 32px; padding: 4px 8px; text-align: center; font-variant-numeric: tabular-nums; }
.ad-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; }
  .ad-table input { border: 0 !important; background: transparent !important; }
  .chart-box { height: 220px !important; }
}

/* ---------- Ads table: centered, readable, strong total ---------- */
.ad-table th, .ad-table td { text-align: center !important; }
.ad-table th:first-child, .ad-table td:first-child { text-align: start !important; }
.ad-table th { font-size: 13px; color: var(--text); white-space: nowrap; padding: 10px 8px; }
.ad-table td { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ad-table td:first-child { font-size: 14px; }
.ad-table input { width: 100px; margin: 0 auto; display: block; font-size: 15px; font-weight: 600; color: var(--text); text-align: center; }
.ad-table input:disabled { color: var(--text); }
.ad-table td[data-o="cpl"], .ad-table td[data-o="cpc"] { color: var(--text); }
.ad-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); }
.ad-table tfoot td { background: var(--brand) !important; color: var(--on-brand) !important; font-size: 16px; font-weight: 700; padding: 12px 8px; border: 0; }
.ad-table tfoot td:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.ad-table tfoot td:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.ad-table tfoot .contracts-badge.total { background: var(--coral); color: var(--navy); border-color: transparent; font-size: 17px; }
@media print { .ad-table tfoot td { background: #2e2b80 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.ad-table tfoot .contracts-badge.total { background: var(--on-brand); color: var(--brand); }
.ad-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; } }

/* ---------- 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-days, .mp-days-h { direction: ltr; white-space: nowrap; }
.mp-blk { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--surface-2); vertical-align: middle; }
.mp-blk + .mp-blk { margin-inline-start: 8px; }
.mp-days-h .mp-blk { background: none; padding: 0 3px; }
.mp-days i, .mp-days-h i { display: inline-grid; place-items: center; width: 20px; font-style: normal; font-size: 10px; font-variant-numeric: tabular-nums; }
.mp-days-h i { line-height: 1.1; color: var(--muted); font-weight: 400; }
.mp-days-h i b { font-size: 10px; color: var(--text-2); }
.mp-days-h i small { font-size: 9px; }
.mp-days-h i.fri b, .mp-days-h i.fri small { color: var(--coral); }
.mp-days i { height: 22px; border-radius: 5px; cursor: pointer; font-weight: 600; transition: transform .08s, background .12s; user-select: none; }
.mp-days i.on { background: color-mix(in srgb, var(--good) 22%, transparent); color: color-mix(in srgb, var(--good) 85%, var(--text)); }
.mp-days i.on.fri { background: color-mix(in srgb, var(--good) 34%, transparent); }
.mp-days i.off { background: var(--bad); color: #fff; }
.mp-days i:hover { transform: scale(1.12); box-shadow: 0 0 0 2px var(--coral); }
.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; }
.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-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); }
.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; } }
#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; }
.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; }
.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) */
.ad-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-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; }
/* 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; } }

/* ---------- "Liquid Glass": see-through frosted surfaces over a glowing violet / blue / orange backdrop ---------- */
:root[data-theme="glass"] {
  color-scheme: dark;
  --bg: #0a0920;
  --surface: rgba(255,255,255,.06); --surface-2: rgba(255,255,255,.10); --border: rgba(255,255,255,.14);
  --text: #f5f4ff; --text-2: #cfcbef; --muted: #9a96c4;
  --brand: #b8a2ff; --brand-2: #d4c6ff; --brand-soft: rgba(184,162,255,.18); --on-brand: #15123a;
  --accent: #ff9f8f; --accent-soft: rgba(255,159,143,.16); --coral: #ffa19c; --navy: #15123a;
  --good: #5fdc95; --good-soft: rgba(95,220,149,.15); --warn: #ffc163; --warn-soft: rgba(255,193,99,.15); --bad: #ff8079; --bad-soft: rgba(255,128,121,.16);
  --s1: #4f9dff; --s2: #ff8a4c; --s3: #2fd3a6; --s4: #ffbf3f; --s5: #ff6fae; --s6: #3fcf5f; --s7: #a78bfa; --s8: #ff7a7a;
  --glass-blur: blur(18px) saturate(160%);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.03);
  --shadow: 0 10px 30px rgba(4,3,20,.35), var(--glass-edge);
  --radius: 16px;
  --side-bg: rgba(255,255,255,.045);
  --glass-solid: rgba(26,23,64,.88); /* for things that sit on top of content: menus, dialogs, sticky headers */
}
:root[data-theme="glass"] body {
  background:
    radial-gradient(900px 600px at 8% -5%, rgba(139,92,246,.42), transparent 60%),
    radial-gradient(800px 600px at 105% 25%, rgba(37,99,235,.38), transparent 60%),
    radial-gradient(900px 650px at -5% 105%, rgba(249,115,22,.30), transparent 60%),
    radial-gradient(700px 500px at 75% 110%, rgba(217,70,239,.22), transparent 60%),
    linear-gradient(160deg, #0b0a26, #0a0920 55%, #120a24);
  background-attachment: fixed;
}
:root[data-theme="glass"] .logo-img.on-light { display: none; }
:root[data-theme="glass"] .logo-img.on-dark { display: block; }
:root[data-theme="glass"] .avatar { color: var(--navy); }

/* frosted panels */
:root[data-theme="glass"] :is(.card, .tile, .kpi-card, .hero-tile, .alert-tile, .table-wrap, .sidebar, .topbar, .seg, .login-card, .home-icon, .home-results a, .side-user) {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
:root[data-theme="glass"] :is(.card, .tile, .kpi-card, .hero-tile, .alert-tile, .table-wrap, .login-card) {
  border-color: rgba(255,255,255,.14); box-shadow: var(--shadow);
}
:root[data-theme="glass"] .topbar { background: rgba(14,12,40,.45); box-shadow: inset 0 -1px 0 rgba(255,255,255,.08); }
:root[data-theme="glass"] .sidebar { border-inline-end: 1px solid rgba(255,255,255,.08); }
:root[data-theme="glass"] .side-user { background: rgba(255,255,255,.08); box-shadow: var(--glass-edge); }

/* light: a soft glow on the coloured cards, lift on hover (motion) */
:root[data-theme="glass"] :is(.hero-tile, .kpi-card, .alert-tile, .tile, .home-icon) { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s; }
:root[data-theme="glass"] .hero-tile { background: linear-gradient(145deg, color-mix(in srgb, var(--c) 34%, transparent), rgba(255,255,255,.04) 70%); border-color: color-mix(in srgb, var(--c) 55%, rgba(255,255,255,.12)); }
:root[data-theme="glass"] .hero-tile:hover, :root[data-theme="glass"] .kpi-card:hover:not(.static) { transform: translateY(-3px); box-shadow: 0 14px 36px color-mix(in srgb, var(--c) 35%, transparent), var(--glass-edge); }
:root[data-theme="glass"] .kpi-card { background: linear-gradient(145deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(255,255,255,.04) 75%); }
:root[data-theme="glass"] .home-icon { background: linear-gradient(150deg, rgba(255,255,255,.16), rgba(255,255,255,.04)); border-color: rgba(255,255,255,.18); box-shadow: 0 8px 24px rgba(4,3,20,.35), var(--glass-edge); }
:root[data-theme="glass"] .home-tile:hover .home-icon { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 34px rgba(139,92,246,.35), var(--glass-edge); }

/* controls */
:root[data-theme="glass"] .btn { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); box-shadow: var(--glass-edge); }
:root[data-theme="glass"] .btn:hover { background: rgba(255,255,255,.13); }
:root[data-theme="glass"] .btn.primary { background: linear-gradient(135deg, #c4b0ff, #8b6cf6); border-color: transparent; color: #140f38; box-shadow: 0 6px 18px rgba(139,92,246,.4), inset 0 1px 0 rgba(255,255,255,.4); }
:root[data-theme="glass"] .btn.primary:hover { filter: brightness(1.08); }
:root[data-theme="glass"] :is(input, select, textarea, .dd-btn) { background-color: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); }
:root[data-theme="glass"] .seg button.on { color: var(--text); background: rgba(255,255,255,.16); box-shadow: inset 0 -2px 0 var(--brand), var(--glass-edge); }
:root[data-theme="glass"] .rec-tabs button.on { background: linear-gradient(135deg, #c4b0ff, #8b6cf6); color: #140f38; box-shadow: 0 4px 14px rgba(139,92,246,.35), inset 0 1px 0 rgba(255,255,255,.4); }
:root[data-theme="glass"] select option { background: #1a1740; color: var(--text); }

/* things that float over content stay readable */
:root[data-theme="glass"] th { background: var(--glass-solid); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
:root[data-theme="glass"] tbody tr:hover { background: rgba(255,255,255,.05); }
:root[data-theme="glass"] .modal { background: var(--glass-solid); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 30px 80px rgba(0,0,0,.5), var(--glass-edge); }
:root[data-theme="glass"] .modal::backdrop { background: rgba(6,5,22,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
:root[data-theme="glass"] :is(.modal-head, .modal-foot) { background: rgba(26,23,64,.92); }
:root[data-theme="glass"] .dd-menu { background: var(--glass-solid); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-color: rgba(255,255,255,.14); }
:root[data-theme="glass"] .login { background: transparent; }
:root[data-theme="glass"] .login-card { border-top: 1px solid rgba(255,255,255,.22); }
@media (prefers-reduced-motion: reduce) { :root[data-theme="glass"] :is(.hero-tile, .kpi-card, .home-icon) { transition: none; } }
/* 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); }
:root[data-theme="glass"] .dd-day.on { background: linear-gradient(135deg, #c4b0ff, #8b6cf6); color: #140f38; }

/* Glass: buttons with their own colour keep it (the frosted .btn look was covering them) */
:root[data-theme="glass"] .btn.cv-btn { background: linear-gradient(135deg, var(--coral), #ff8fa3); border-color: transparent; color: #1d1b4f; box-shadow: 0 4px 14px color-mix(in srgb, var(--coral) 40%, transparent); }
:root[data-theme="glass"] .btn.cv-mini { background: color-mix(in srgb, var(--coral) 22%, transparent); border-color: color-mix(in srgb, var(--coral) 55%, transparent); }
:root[data-theme="glass"] .btn.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
:root[data-theme="glass"] .btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
/* Glass: no blur on the dialog itself — a blurred box holds position:fixed popups inside it and cuts them off */
:root[data-theme="glass"] .modal { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(24,21,60,.97); }
/* 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; }
