/*
VOICE: calm, trustworthy service desk; a classy Elite Group product, never loud
IDEA: a well-run maintenance job card that follows the job from request to payment
PICTURE: the E-Serve monogram on charcoal, then service tiles and a clear job timeline
COLOUR and TYPE: charcoal, taupe and sand from the E-Serve logo on warm ivory; Playfair Display for the brand, Montserrat and Tajawal for reading
LAYOUT: phone first with bottom tabs; on laptops a charcoal side rail and wider lists
*/
:root {
  --charcoal: #2B2B2B; --charcoal-2: #1F1E1D; --taupe: #836E63; --taupe-ink: #6B574D; --sand: #DCC6A5; --ivory: #F6F1E9;
  --bg: #F4EFE7; --surface: #FFFFFF; --surface-2: #FAF7F2; --ink: #1F1D1B; --muted: #675F57; --line: #E5DCCF; --line-strong: #857769; --line-mid: #CFC3B3;
  --field: #FFFFFF; --soft: #EFE5D6; --soft-ink: #5C4A41; --focus: #6B574D; --halo: rgba(131, 110, 99, .38);
  --warm: #FBF6EE; --warm-line: #CDB89A; --warm-line-2: #E6D6BD;
  --bar: #2B2B2B; --bar-ink: #F6F1E9; --primary: #2B2B2B; --primary-ink: #F6F1E9; --danger: #9B3B2E;
  --st-submitted-bg: #F4E7CF; --st-submitted: #7A5A1E; --st-assigned-bg: #EAE2DC; --st-assigned: #5C4A41;
  --st-in_progress-bg: #DCE7EA; --st-in_progress: #2D5361; --st-completed-bg: #E0EADD; --st-completed: #3B5D39;
  --st-cancelled-bg: #ECEAE6; --st-cancelled: #6B665F;
  --shadow: 0 1px 2px rgba(43, 35, 28, .06), 0 6px 18px rgba(43, 35, 28, .06);
  --font: 'Montserrat', 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #161514; --surface: #221F1D; --surface-2: #1C1A18; --ink: #F2ECE3; --muted: #ABA196; --line: #35302C; --line-strong: #8C7E70; --line-mid: #4A433D;
    --field: #1C1A18; --soft: #2E2824; --soft-ink: #E3CFB2; --focus: #DCC6A5; --halo: rgba(220, 198, 165, .35);
    --warm: #2A2521; --warm-line: #5A4D42; --warm-line-2: #4A4038;
    --bar: #0F0E0D; --primary: #DCC6A5; --primary-ink: #1F1E1D; --danger: #E0897B; --taupe-ink: #C9B3A4;
    --st-submitted-bg: #3A2F1C; --st-submitted: #E7C98F; --st-assigned-bg: #352C27; --st-assigned: #DCC6B6;
    --st-in_progress-bg: #1E3239; --st-in_progress: #9CC8D6; --st-completed-bg: #213120; --st-completed: #A8CBA2;
    --st-cancelled-bg: #2A2826; --st-cancelled: #A9A39B; --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #161514; --surface: #221F1D; --surface-2: #1C1A18; --ink: #F2ECE3; --muted: #ABA196; --line: #35302C; --line-strong: #8C7E70; --line-mid: #4A433D;
  --field: #1C1A18; --soft: #2E2824; --soft-ink: #E3CFB2; --focus: #DCC6A5; --halo: rgba(220, 198, 165, .35);
  --warm: #2A2521; --warm-line: #5A4D42; --warm-line-2: #4A4038;
  --bar: #0F0E0D; --primary: #DCC6A5; --primary-ink: #1F1E1D; --danger: #E0897B; --taupe-ink: #C9B3A4;
  --st-submitted-bg: #3A2F1C; --st-submitted: #E7C98F; --st-assigned-bg: #352C27; --st-assigned: #DCC6B6;
  --st-in_progress-bg: #1E3239; --st-in_progress: #9CC8D6; --st-completed-bg: #213120; --st-completed: #A8CBA2;
  --st-cancelled-bg: #2A2826; --st-cancelled: #A9A39B; --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
html[dir=rtl] { --font: 'Tajawal', 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); overflow-x: clip; -webkit-tap-highlight-color: transparent; }
body.noscroll { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* headings and dialogs take focus only so screen readers start there; they are not controls */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, .modal[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[dir=rtl] .flip { transform: scaleX(-1); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13.5px; }

/* Boot screen */
.boot { min-height: 100dvh; display: grid; place-items: center; background: var(--charcoal); }
.boot img { width: min(56vw, 260px); opacity: .9; }

/* Brand lockup (stays left-to-right in Arabic) */
.lockup { display: inline-flex; align-items: flex-end; gap: 7px; direction: ltr; color: var(--ivory); }
.lockup .mark { display: inline-flex; align-items: flex-end; gap: 3px; }
.lockup img { height: 30px; width: auto; }
.lockup .serve { font: 800 24px/.8 var(--serif); color: var(--sand); letter-spacing: .01em; margin-bottom: -2px; }
.lockup .care { font: italic 600 21px/1 var(--serif); color: var(--ivory); margin-bottom: -2px; }
.lockup.sm img { height: 24px; }
.lockup.sm .serve { font-size: 19.2px; }
.lockup.sm .care { font-size: 17px; }
/* Large wordmark on the first page: the original E with SERVE, then Care */
.lockup.xl { --h: clamp(29px, 8.5vw, 39px); gap: 7px; align-items: baseline; }
.lockup.xl .mark { gap: 4px; align-items: baseline; }
.lockup.xl img { height: var(--h); display: block; }
.lockup.xl .serve { font-size: calc(var(--h) * .8); line-height: 1; margin: 0; }
.lockup.xl .care { font-size: calc(var(--h) * .68); line-height: 1; margin: 0; color: var(--taupe); }
.w-title .lockup.xl { margin: 4px 0 2px; }
.by { font-size: 12.5px; font-weight: 500; color: var(--sand); opacity: .9; letter-spacing: .02em; direction: ltr; }
html[dir=rtl] .by { direction: rtl; }

/* Demo strip */
.demo-bar { background: var(--soft); color: var(--soft-ink); font-size: 13px; text-align: center; padding: 6px 14px; }

/* Frame */
.frame { min-height: 100dvh; }
.side { display: none; }
.side-foot { display: none; }
.main { min-height: 100dvh; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; min-height: 60px;
  padding: calc(env(safe-area-inset-top) + 8px) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  background: var(--bar); color: var(--bar-ink); }
.bar-brand { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.bar-title { flex: 1; margin: 0; font: 600 17px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: inherit; position: relative; flex: none; text-decoration: none; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn.soft { background: var(--soft); color: var(--soft-ink); }
.lang-btn { border: 1px solid rgba(246,241,233,.35); background: transparent; color: var(--ivory); border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.view { width: 100%; max-width: 760px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right)) calc(110px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); flex: 1; }
.page-h { font: 700 30px/1.1 var(--serif); margin: 4px 0 18px; text-wrap: balance; }
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--muted);
  min-height: 52px; border-radius: 12px; font-size: 12.5px; font-weight: 600; padding: 4px 2px; }
.tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.on { color: var(--ink); }
.tab.on .ic { stroke: var(--taupe); stroke-width: 2.2; }
.dot { position: absolute; top: 2px; inset-inline-end: calc(50% - 22px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: #B4442F; color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; }

@media (min-width: 960px) {
  .frame { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; background: var(--bar); color: var(--bar-ink); padding: 26px 16px; }
  .side-brand { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 26px; }
  .side .tab { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 14px; color: rgba(246,241,233,.75); font-size: 15px; }
  .side .tab:hover { background: rgba(255,255,255,.06); }
  .side .tab.on { background: rgba(220,198,165,.14); color: var(--ivory); }
  .side .tab.on .ic { stroke: var(--sand); }
  .side .dot { position: static; margin-inline-start: auto; }
  .side-foot { display: block; margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
  .side-foot img { width: 132px; height: auto; opacity: .7; }
  .tabs { display: none; }
  .bar { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
  .bar .bar-brand { visibility: hidden; }
  .bar .lang-btn { border-color: var(--line-mid); color: var(--ink); }
  .bar .icon-btn:hover { background: var(--soft); }
  .view { max-width: 1080px; padding: 28px 40px 60px; }
  .hello { border-radius: 20px; margin-inline: 0 !important; }
}

/* Welcome */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; color: var(--ivory);
  background: radial-gradient(120% 70% at 50% 0%, #3A3633 0%, var(--charcoal) 55%, var(--charcoal-2) 100%);
  padding: calc(env(safe-area-inset-top) + 14px) max(22px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 22px) max(22px, env(safe-area-inset-left)); }
.w-top { display: flex; justify-content: flex-end; }
.w-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 18px 0; }
.w-mono { width: min(80vw, 380px); margin-bottom: 18px; filter: drop-shadow(0 10px 30px rgba(0,0,0,.35)); }
.w-title { margin: 0; font: 800 clamp(36px, 9vw, 48px)/1.05 var(--serif); color: var(--ivory); }
.w-slogan { margin: 2px 0 0; font: italic 600 21px/1.3 var(--serif); color: var(--sand); }
html[dir=rtl] .w-slogan { font-family: 'Tajawal', var(--font); font-style: normal; font-weight: 700; font-size: 22px; }
html[dir=rtl] .w-slogan.en { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 21px; }
.w-by { margin: 2px 0 0; font: 500 14px/1.4 var(--font); letter-spacing: .02em; color: rgba(220,198,165,.82); }
.w-lead { margin: 0 auto 2px; text-align: center; max-width: 32ch; color: rgba(246,241,233,.82); font-size: 16.5px; }
.w-actions { display: grid; gap: 12px; width: 100%; max-width: 420px; margin: 0 auto; }
.w-owned { margin: 10px 0 0; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 13px; color: rgba(220,198,165,.8); }
.w-owned p { margin: 0; }
.w-owned-by { font: italic 800 16px/1 var(--serif); color: var(--sand); letter-spacing: .03em; }
.eg-logo { width: 128px; height: auto; opacity: .85; }
.card.about-eg { background: var(--charcoal); color: var(--sand); border: 0; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 22px 18px; }
.about-eg img { width: min(56vw, 210px); height: auto; }
.about-eg p { margin: 0; font-size: 14px; }
.demo-pick { margin-top: 6px; padding: 14px; border: 1px dashed rgba(220,198,165,.4); border-radius: 16px; text-align: center; }
.demo-pick p { margin: 0 0 10px; font-size: 13.5px; color: var(--sand); }
.demo-pick .seg-3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* Auth pages */
.auth { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; background: var(--charcoal); color: var(--ivory);
  padding: calc(env(safe-area-inset-top) + 10px) max(12px, env(safe-area-inset-right)) 18px max(12px, env(safe-area-inset-left)); }
.auth-head .brandbox { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.auth-body { width: 100%; max-width: 480px; margin: 0 auto; padding: 26px 20px 20px; flex: 1; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 20px calc(env(safe-area-inset-bottom) + 18px); }
.alt { text-align: center; color: var(--muted); margin: 18px 0 0; }

/* Headings */
.h1 { font: 700 28px/1.15 var(--serif); margin: 0 0 18px; text-wrap: balance; }
.h2 { font: 700 19px/1.3 var(--font); margin: 0 0 12px; }
.h3 { font: 600 16px/1.35 var(--font); margin: 0 0 10px; }
.block { margin-top: 26px; }

/* Forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.field > label, .field > legend, .field > .label { font-weight: 600; font-size: 15px; padding: 0; }
.hint { color: var(--muted); font-size: 13.5px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font-size: 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--field); color: var(--ink); appearance: none; -webkit-appearance: none; }
textarea { resize: vertical; line-height: 1.5; }
select { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 38px; }
html[dir=rtl] select { background-position: 20px 22px, 15px 22px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); box-shadow: none; }
[aria-invalid=true] { border-color: var(--danger) !important; }
.field-err { color: var(--danger); font-size: 13.5px; font-weight: 600; }
.pw { position: relative; }
.pw input { padding-inline-end: 84px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--soft); color: var(--soft-ink); font-size: 14px; font-weight: 600; }
.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.amount-row { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.seg.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.seg-opt { position: relative; }
.seg-opt input, .choice input, .stars-input input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span, .choice span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--field); font-weight: 600; font-size: 15px; text-align: center; cursor: pointer; }
.seg-opt input:checked + span, .choice input:checked + span { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.seg-opt input:checked + span .ic, .choice input:checked + span .ic { stroke: currentColor; }
.seg-opt input:focus-visible + span, .choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row .choice { flex: 1 1 140px; }
.choice-row.wrap .choice { flex: 1 1 46%; }
.choice span .ic { stroke: var(--taupe); }
.seg.mini { grid-auto-columns: auto; gap: 4px; margin-inline-start: auto; }
.seg-btn { min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--field); font-size: 14px; font-weight: 600; }
.seg-btn.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch { flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; margin-top: 2px; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-row input:checked + .switch { background: var(--taupe); }
.switch-row input[name=urgent]:checked + .switch { background: #B4442F; }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
html[dir=rtl] .switch-row input:checked + .switch::after { transform: translateX(-18px); }
.switch-row input:focus-visible + .switch { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch-row small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.photo-pick { display: grid; gap: 10px; }
.photo-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border: 1.5px dashed var(--line-mid); border-radius: 14px; color: var(--muted); font-weight: 600; cursor: pointer; background: var(--surface-2); }
.photo-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.photo-preview { display: flex; align-items: center; gap: 14px; }
.photo-preview img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

/* Buttons: refined pill shapes in Elite Group's charcoal, taupe and sand, with a touch of gold */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line-mid); background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: .01em; text-decoration: none; text-align: center; line-height: 1.2;
  box-shadow: 0 1px 0 rgba(255,255,255,.65) inset, 0 1px 2px rgba(43,35,28,.06);
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease; -webkit-tap-highlight-color: transparent; }
.btn .ic { width: 19px; height: 19px; }
.btn:hover { border-color: var(--taupe); box-shadow: 0 1px 0 rgba(255,255,255,.65) inset, 0 6px 16px rgba(43,35,28,.10); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); box-shadow: 0 1px 2px rgba(43,35,28,.08); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, #3B3936 0%, #252423 100%); color: var(--ivory); border-color: #1C1B1A;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 8px 20px rgba(31,30,29,.22); }
.btn.primary .ic { stroke: var(--sand); }
.btn.primary:hover { border-color: #000; box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 12px 26px rgba(31,30,29,.28); }
.btn.sand { background: linear-gradient(135deg, #EEDDBF 0%, #DCC6A5 45%, #C9A877 100%); color: #2B2B2B; border-color: #C3A274;
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 8px 20px rgba(131,110,99,.25); }
.btn.sand .ic { stroke: #2B2B2B; }
.btn.qr { background: linear-gradient(180deg, #866F62 0%, #7A6458 100%); color: #fff; border-color: #6B574D;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 8px 18px rgba(107,87,77,.28); }
.btn.qr .ic { stroke: #F6F1E9; }
.btn.soft { background: var(--soft); color: var(--soft-ink); border-color: transparent; box-shadow: none; }
.btn.soft .ic { stroke: var(--taupe-ink); }
.btn.soft:hover { border-color: var(--sand); }
.btn.ghost-light { background: rgba(246,241,233,.04); color: var(--ivory); border-color: rgba(246,241,233,.45); box-shadow: none; }
.btn.ghost-light:hover { background: rgba(246,241,233,.10); border-color: var(--sand); }
.btn.danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 38%, transparent); background: transparent; box-shadow: none; }
.btn.danger-ghost:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: var(--danger); }
.btn.big { min-height: 56px; width: 100%; font-size: 16px; padding: 0 24px; }
.btn.small { min-height: 38px; padding: 0 15px; font-size: 13.5px; gap: 6px; }
.btn.small .ic { width: 16px; height: 16px; }
:root[data-theme=dark] .btn.primary { background: linear-gradient(180deg, #EAD8B9 0%, #CFB28A 100%); color: #1F1E1D; border-color: #C3A274; }
:root[data-theme=dark] .btn.primary .ic { stroke: #1F1E1D; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .btn.primary { background: linear-gradient(180deg, #EAD8B9 0%, #CFB28A 100%); color: #1F1E1D; border-color: #C3A274; }
  :root:not([data-theme=light]) .btn.primary .ic { stroke: #1F1E1D; }
  :root:not([data-theme=light]) .btn { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover, .btn:active { transition: none; transform: none; } }
.link { border: 0; background: none; padding: 0; color: var(--taupe-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-bottom: 12px; }
.row.between { justify-content: space-between; }
.stack-btns { display: grid; gap: 10px; }

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.list { display: grid; gap: 10px; }
.detail { display: grid; gap: 14px; }
@media (min-width: 960px) { .list.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; display: grid; justify-items: center; gap: 10px; }
.empty .ic { width: 38px; height: 38px; stroke: var(--taupe); stroke-width: 1.5; }
.empty p { margin: 0; max-width: 34ch; }
.empty-line { color: var(--muted); margin: 0; padding: 18px; border: 1px dashed var(--line-mid); border-radius: 16px; text-align: center; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* Greeting band */
.hello { background: var(--bar); color: var(--ivory); margin: -18px calc(-1 * max(16px, env(safe-area-inset-left))) 0; padding: 18px 20px 26px; border-radius: 0 0 26px 26px; }
.hello-greet { margin: 0; color: var(--sand); font-size: 15px; font-weight: 500; }
.hello-name { margin: 2px 0 0; font: 700 32px/1.1 var(--serif); }
.hello-addr { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 14px; color: rgba(246,241,233,.75); }
.hello-addr .ic { width: 18px; height: 18px; stroke: var(--sand); }

/* Service tiles */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.svc { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.svc:hover { border-color: var(--taupe); }
.svc-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.svc-ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--soft); color: var(--taupe-ink); flex: none; }
.svc-ic.lg { width: 54px; height: 54px; border-radius: 16px; }
.svc-ic.lg .ic { width: 27px; height: 27px; }

/* Request cards */
.req { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: start; color: inherit; }
.req:hover { border-color: var(--taupe); }
.req-main { flex: 1; display: grid; gap: 3px; }
.req-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.req-top b { font-size: 15.5px; }
.ref { color: var(--muted); font-size: 13px; font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.req-desc { color: var(--ink); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13px; }
.req-side { display: grid; justify-items: end; gap: 6px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.st-submitted { background: var(--st-submitted-bg); color: var(--st-submitted); }
.st-assigned { background: var(--st-assigned-bg); color: var(--st-assigned); }
.st-in_progress { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.st-completed { background: var(--st-completed-bg); color: var(--st-completed); }
.st-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--soft); color: var(--soft-ink); white-space: nowrap; }
.tag.urgent { background: #F6DED8; color: #8E3322; }
:root[data-theme=dark] .tag.urgent { background: #3D2420; color: #F0A898; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .tag.urgent { background: #3D2420; color: #F0A898; } }
.tag .ic { width: 14px; height: 14px; }
.tag.due { background: var(--st-submitted-bg); color: var(--st-submitted); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fchip { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-mid); background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.fchip:hover { border-color: var(--taupe); }
.fchip.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.fchip .n { opacity: .7; margin-inline-start: 4px; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }

/* Request detail */
.hc-top { display: flex; gap: 14px; align-items: center; }
.hc-title { margin: 0; font: 700 22px/1.2 var(--serif); }
.hc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.steps { list-style: none; margin: 16px 0 2px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps li { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.steps li::before { content: ''; position: absolute; top: 13px; inset-inline-start: calc(-50% + 16px); width: calc(100% - 32px); height: 2px; background: var(--line-mid); }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.now::before { background: var(--taupe); }
.step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-mid); background: var(--surface); display: grid; place-items: center; position: relative; z-index: 1; }
.step-dot .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.steps li.done .step-dot { background: var(--taupe); border-color: var(--taupe); color: #fff; }
.steps li.now { color: var(--ink); }
.steps li.now .step-dot { border-color: var(--taupe); box-shadow: 0 0 0 4px var(--halo); }
.steps li.now .step-dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--taupe); }
.steps li.now.final .step-dot { background: var(--st-completed); border-color: var(--st-completed); color: #fff; box-shadow: none; }
.steps li.now.final .step-dot::after { display: none; }
.cancelled-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--st-cancelled); font-weight: 600; }
.facts { margin: 0; display: grid; gap: 14px; }
.facts dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.facts dt .ic { width: 18px; height: 18px; stroke: var(--taupe); }
.facts dd { margin: 3px 0 0; font-size: 15.5px; }
.facts dd .link { margin-inline-start: 8px; font-size: 14px; }
.first-photo { margin-top: 14px; border: 0; padding: 0; background: none; border-radius: 14px; overflow: hidden; display: block; }
.first-photo img { width: 100%; max-height: 300px; object-fit: cover; }
.people { display: grid; gap: 14px; }
.person { display: flex; align-items: center; gap: 12px; }
.p-main { flex: 1; }
.p-main small { color: var(--muted); font-size: 13px; font-weight: 600; }
.p-name { margin: 0; font-weight: 600; }
.p-phone { margin: 0; color: var(--muted); font-size: 14px; text-align: start; }
html[dir=rtl] .p-phone { text-align: end; }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--charcoal); color: var(--sand); display: grid; place-items: center; font-weight: 700; font-size: 16px; direction: ltr; }
.avatar.none { background: var(--soft); color: var(--muted); }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.actions { display: grid; gap: 14px; }
.actions form { display: grid; gap: 8px; }
.actions label { font-weight: 600; font-size: 15px; }
.actions .row select { flex: 1 1 200px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ev { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.ev::before { content: ''; position: absolute; top: 32px; bottom: 0; inset-inline-start: 15px; width: 2px; background: var(--line); }
.ev:last-child::before { display: none; }
.ev-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--taupe-ink); display: grid; place-items: center; position: relative; z-index: 1; }
.ev-dot .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.ev.evs-completed .ev-dot, .ev-payment.paid .ev-dot { background: var(--st-completed-bg); color: var(--st-completed); }
.ev.evs-cancelled .ev-dot { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.ev.evs-in_progress .ev-dot { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.ev-body { flex: 1; padding-top: 4px; }
.ev-text { margin: 0; font-size: 15px; }
.ev-note { margin: 6px 0 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.ev-meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.thumb { display: block; margin-top: 8px; border: 0; padding: 0; background: none; border-radius: 12px; overflow: hidden; width: 120px; height: 120px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.composer { margin-top: 6px; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.composer .row { justify-content: space-between; }
.composer .photo-pick { grid-template-columns: auto; }
.composer .photo-btn { min-height: 44px; padding: 0 14px; border-style: solid; border-width: 1px; }
.stars { display: flex; gap: 4px; color: #B88A2E; margin-bottom: 6px; }
.stars .ic { width: 24px; height: 24px; }
.stars .on { fill: currentColor; }
.stars-input { display: flex; gap: 6px; margin-bottom: 12px; direction: ltr; }
html[dir=rtl] .stars-input { flex-direction: row-reverse; justify-content: flex-end; }
.stars-input label { cursor: pointer; color: var(--line-strong); }
.stars-input label .ic { width: 38px; height: 38px; stroke-width: 1.5; }
.stars-input label.lit { color: #B88A2E; }
.stars-input label.lit .ic { fill: currentColor; }
.stars-input input:focus-visible + span { outline: 3px solid var(--focus); border-radius: 8px; }

/* Payment */
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pay-head small { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.pay-amount { margin: 2px 0 6px; font: 700 32px/1.1 var(--serif); direction: ltr; unicode-bidi: isolate; text-align: start; }
.pay-choices { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
.pay-opt { display: grid; justify-items: start; gap: 4px; text-align: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line-mid); background: var(--surface); }
.pay-opt .ic { stroke: var(--taupe); }
.pay-opt b { font-size: 16px; }
.pay-opt small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.pay-opt.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--surface-2); }
.pay-actions { display: grid; gap: 10px; margin-top: 12px; }
.qr-sheet { display: grid; justify-items: center; text-align: center; gap: 8px; }
.qr-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--charcoal); border-radius: 14px; padding: 12px 18px; width: 100%; }
.qr-amount { margin: 8px 0 0; font: 800 40px/1.1 var(--serif); direction: ltr; }
.qr-to { margin: 0; color: var(--muted); font-weight: 600; }
.qr-box { background: #fff; border-radius: 18px; padding: 16px; border: 1px solid var(--line); width: min(78vw, 300px); }
.qr-box img { width: 100%; height: auto; image-rendering: pixelated; }
.qr-box.missing { display: grid; justify-items: center; gap: 10px; color: #5E5A55; padding: 26px 18px; }
.qr-box.missing .ic { width: 48px; height: 48px; stroke: var(--taupe); }
.qr-box.missing p { margin: 0; font-size: 14.5px; }
.qr-hint { margin: 0; font-weight: 600; }
.qr-setting { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-setting .qr-box { width: 160px; padding: 10px; }

/* Dashboard */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { display: grid; gap: 4px; align-content: start; }
.kpi .ic { stroke: var(--taupe); }
.kpi-v { font: 700 28px/1.1 var(--serif); direction: ltr; unicode-bidi: isolate; text-align: start; overflow-wrap: anywhere; }
html[dir=rtl] .kpi-v, html[dir=rtl] .pay-amount { text-align: right; }
.kpi-l { color: var(--muted); font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.kpi-s { color: var(--muted); font-size: 12.5px; }
.kpi.warn { border-color: #E3C48E; background: color-mix(in srgb, var(--st-submitted-bg) 45%, var(--surface)); }

/* Account and management */
.profile { display: flex; gap: 14px; align-items: center; }
.profile .h2 { margin: 0 0 2px; }
.menu { padding: 6px; display: grid; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 12px; border: 0; background: none; border-radius: 12px; text-align: start; font-weight: 600; font-size: 15.5px; color: var(--ink); text-decoration: none; width: 100%; }
.menu-item:hover { background: var(--surface-2); }
.menu-item > span:not(.switch) { flex: 1; }
.menu-item .switch { flex: none; width: 46px; margin-top: 0; }
.menu-item .ic:first-child { stroke: var(--taupe); }
.menu-item .end { color: var(--muted); }
.menu-item.static { cursor: default; }
.menu-item.static:hover { background: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ic:first-child { stroke: var(--danger); }
.menu-h { margin: 8px 12px 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.member { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.member.off { opacity: .65; }
.m-main { flex: 1 1 200px; display: grid; gap: 2px; }
.m-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.m-stats .ic { width: 15px; height: 15px; vertical-align: -2px; stroke: #B88A2E; fill: #B88A2E; }
.m-actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; justify-content: flex-end; }
.svc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.svc-row .m-main { flex: 1 1 160px; }
.svc-row > .m-actions { width: auto; flex: 0 1 auto; }
@media (max-width: 480px) {
  .svc-row .m-main { flex-basis: calc(100% - 54px); }
  .svc-row > .m-actions { flex-basis: 100%; }
}
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.icon-pick label { position: relative; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { display: grid; place-items: center; height: 56px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); color: var(--taupe-ink); cursor: pointer; }
.icon-pick input:checked + span { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.icon-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.about-card { background: var(--charcoal); color: var(--ivory); border: 0; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 18px; }
.about-card img { width: min(70vw, 280px); margin-bottom: 12px; }
.about-card h2 { margin: 0; font: 800 30px/1.1 var(--serif); }
.about-card .w-slogan { font-size: 19px; }
.credentials { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; direction: ltr; text-align: left; font-size: 15.5px; }
.credentials b { font-weight: 700; }

/* Done screen */
.done-box { text-align: center; display: grid; justify-items: center; gap: 6px; padding: 30px 6px; }
.done-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--st-completed-bg); color: var(--st-completed); margin-bottom: 10px; }
.done-ic .ic { width: 36px; height: 36px; stroke-width: 2.4; }
.done-box p { color: var(--muted); max-width: 36ch; margin: 0 0 18px; }
.done-box .stack-btns { width: 100%; max-width: 380px; }

/* Modal, toast */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-back { position: absolute; inset: 0; background: rgba(20, 18, 16, .55); }
.modal { position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: up .22s ease-out; }
@media (min-width: 640px) { .modal-wrap { align-items: center; } .modal { border-radius: 22px; } }
@keyframes up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } .switch, .switch::after { transition: none; } }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; width: 100%; }
.modal-actions .btn { flex: 1 1 auto; white-space: nowrap; }
.full-photo { width: 100%; border-radius: 14px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--charcoal); color: var(--ivory); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; max-width: min(92vw, 460px); text-align: center; transition: .2s; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #7E2E22; }
body.has-modal .toast { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; transform: translate(-50%, -20px); }
body.has-modal .toast.show { transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ===== 1.1: accounting, quotations, invoices, payments, alerts and locations ===== */
.info { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.info .ic { flex: none; stroke: var(--taupe); margin-top: 1px; }
.info.warn { background: #FBEDE9; border-color: #EBC7BD; color: #7D2E20; }
.info.warn .ic { stroke: #B4442F; }
.actions .info + .btn, .actions .btn + .btn { margin-top: 10px; }
.tag.ok { background: var(--st-completed-bg); color: var(--st-completed); }
.badge-ic { display: inline-grid; place-items: center; vertical-align: middle; }
.badge-ic .ic { width: 15px; height: 15px; stroke: var(--taupe); }
.link.center { display: block; margin: 4px auto 0; }

/* Quotation and bill cards */
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-head .h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.doc-head .chip { flex: none; }
.doc-no { white-space: nowrap; unicode-bidi: isolate; }
.doc-head .h3 .ic { stroke: var(--taupe); }
.chip.q-requested, .chip.b-requested { background: var(--st-submitted-bg); color: var(--st-submitted); }
.chip.q-sent { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.chip.q-approved, .chip.b-ready { background: var(--st-completed-bg); color: var(--st-completed); }
.chip.q-declined { background: #F6DED8; color: #8E3322; }
.chip.q-withdrawn { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.lines-wrap { overflow-x: auto; margin: 4px 0 10px; }
.lines { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.lines th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line-mid); }
.lines td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines .num { text-align: end; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.lines tfoot td { border-bottom: 0; padding-top: 12px; font-weight: 800; font-size: 16px; }
.lines tfoot td.num { font-family: var(--serif); font-size: 19px; }
.doc-note { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.doc-actions { margin-top: 12px; }
.work-line { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 14px; color: var(--soft-ink); }
.work-line .ic { width: 17px; height: 17px; stroke: var(--taupe); }
.due-box { padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, #2B2B2B, #3A3735); color: var(--ivory); }
.due-box small { color: var(--sand); font-weight: 600; letter-spacing: .02em; }
.due-box .pay-amount { color: var(--ivory); margin: 2px 0 0; }

/* Quotation and bill form */
.doc-intro .p-name { margin: 2px 0 0; }
.lines-edit { display: grid; gap: 10px; }
.line-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 96px; grid-template-areas: "kind kind del" "desc desc desc" "qty price total"; gap: 8px 10px; align-items: end;
  padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.line-row.k-labour { background: linear-gradient(180deg, var(--surface) 0%, var(--warm) 100%); border-color: var(--warm-line-2); }
.line-kind { grid-area: kind; display: inline-flex; align-items: center; gap: 6px; color: var(--taupe-ink); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.line-kind .ic { width: 16px; height: 16px; stroke: var(--taupe); }
.l-del { grid-area: del; justify-self: end; width: 36px; height: 36px; border-radius: 999px; }
.l-del .ic { width: 16px; height: 16px; }
.l-desc { grid-area: desc; }
.l-num { display: grid; gap: 4px; }
.l-num:first-of-type { grid-area: qty; }
.l-num:last-of-type { grid-area: price; }
.l-pricebox { position: relative; }
.l-fmt { position: absolute; top: 100%; left: 2px; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.doc-form.cur-lbp .line-row { padding-bottom: 30px; }
.l-num small { color: var(--muted); font-size: 12px; font-weight: 600; }
.line-row input { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); }
.line-row input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--taupe); }
.l-total { grid-area: total; text-align: end; font-size: 15px; line-height: 1.25; padding-bottom: 11px; }
@media (min-width: 640px) { .l-total { white-space: nowrap; } }
.add-lines { margin: 2px 0; }
.doc-total { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, #2B2B2B, #3A3735); color: var(--ivory); }
.doc-total > span { color: var(--sand); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.doc-total b { font: 700 26px/1 var(--serif); }
.doc-sum { display: grid; justify-items: end; gap: 6px; text-align: end; }
.doc-sum small { color: var(--sand); font-size: 13px; font-weight: 600; }
.doc-sum small:empty { display: none; }
@media (min-width: 640px) {
  .line-row { grid-template-columns: 96px minmax(0, 1fr) 96px 120px 110px 36px; grid-template-areas: "kind desc qty price total del"; align-items: end; }
  .line-kind, .l-del { align-self: center; margin-top: 18px; }
  .l-total { padding-bottom: 12px; }
}

/* Locations */
.loc-field { gap: 8px; }
.loc-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-mid); background: var(--surface-2); }
.loc-box.on { border-style: solid; border-color: var(--warm-line); background: var(--warm); }
.loc-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--soft); flex: none; }
.loc-ic .ic { stroke: var(--taupe-ink); }
.loc-box.on .loc-ic { background: #2B2B2B; }
.loc-box.on .loc-ic .ic { stroke: var(--sand); }
.loc-text { display: grid; flex: 1; min-width: 0; }
.loc-text small { color: var(--muted); font-size: 12.5px; }
.loc-paste { display: flex; gap: 8px; }
.loc-paste input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--field); font-size: 14px; }
.loc-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }

/* Phone alerts banner */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; margin: 0 0 16px; border-radius: 18px;
  background: linear-gradient(135deg, #2B2B2B 0%, #3D3936 100%); color: var(--ivory); box-shadow: 0 10px 24px rgba(31,30,29,.18); }
.banner > .ic { stroke: var(--sand); flex: none; }
.banner > span { flex: 1; display: grid; gap: 2px; min-width: 0; }
.banner small { color: rgba(246,241,233,.75); font-size: 13px; }
.banner .icon-btn { width: 36px; height: 36px; color: var(--ivory); }

/* Dashboards */
.kpis.three { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.quick { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; margin: 16px 0 4px; scrollbar-width: none; }
.quick-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid #D9C4A2;
  background: linear-gradient(180deg, #FFFDF9 0%, #F7EFE2 100%); color: var(--charcoal); font-weight: 600; font-size: 14px; box-shadow: 0 2px 8px rgba(131,110,99,.12); transition: transform .16s, box-shadow .2s; }
.quick-btn .ic { width: 18px; height: 18px; stroke: var(--taupe); }
.quick-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(131,110,99,.18); }

/* Welcome after sign-up */
.wn { text-align: center; max-width: 520px; margin: 0 auto; display: grid; gap: 8px; }
.wn-mono { width: 132px; margin: 4px auto 6px; }
.wn-title { margin: 0; font: 700 32px/1.15 var(--serif); }
.wn-by { margin: 0; color: var(--taupe-ink); font-weight: 600; font-size: 14px; }
.wn-lead { margin: 10px 0 4px; color: var(--muted); }
.wn-steps { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 10px; text-align: start; }
.wn-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.wn-steps li small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.wn-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #2B2B2B; flex: none; }
.wn-ic .ic { stroke: var(--sand); width: 19px; height: 19px; }

/* Payments page */
.held { margin-top: 14px; }
.held-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.held-row:first-of-type { border-top: 0; }
.held-name { flex: 1; display: grid; min-width: 0; }
.held-amt { font: 700 18px/1.1 var(--serif); white-space: nowrap; }
.pay-row { padding: 0; overflow: hidden; }
.pay-row-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: start; }
.pay-amt { font: 700 18px/1.1 var(--serif); white-space: nowrap; }
.pay-row-actions { padding: 0 16px 14px; }
.pay-row > p { padding: 0 16px 12px; }
.range { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; }
.range label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.range input, .range select { min-height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); }
.report { margin-top: 20px; }
.report .h3 { display: flex; align-items: center; gap: 8px; }
.report .h3 .ic { stroke: var(--taupe); }

/* Labour prices */
.calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 8px; }
.calc-grid > div { display: grid; gap: 4px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.calc-grid small { color: var(--muted); font-size: 12px; font-weight: 600; }
.calc-grid b { font: 700 20px/1.1 var(--serif); }
.calc-grid .hl { background: linear-gradient(135deg, #2B2B2B, #3A3735); border-color: #2B2B2B; color: var(--ivory); }
.calc-grid .hl small { color: var(--sand); }
.grid2 { display: grid; gap: 0 12px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Messages and alerts */
.chans { display: grid; gap: 12px; }
@media (min-width: 960px) { .chans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chan-head .h3 { margin: 0; flex: 1; }
.chan-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); }
.chan-ic .ic { stroke: var(--taupe-ink); width: 18px; height: 18px; }
.chan .btn { margin-top: 8px; }
.tpl-list { margin: 8px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.tpl-list code { background: var(--surface-2); padding: 2px 8px; border-radius: 8px; font-size: 13px; }
.deliv { list-style: none; margin: 0; padding: 0; display: grid; }
.deliv li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.deliv li:first-child { border-top: 0; }
.d-ch .ic { width: 18px; height: 18px; stroke: var(--taupe); }
.d-err { display: block; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.d-st { font-weight: 700; font-size: 12.5px; }
.d-sent .d-st { color: var(--st-completed); }
.d-failed .d-st { color: var(--danger); }
.menu-item .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.menu-item.switchy { cursor: pointer; }
.menu-item.switchy input { position: absolute; opacity: 0; pointer-events: none; }
.menu-item.switchy input:checked + .switch { background: var(--taupe); }
.menu-item.switchy input:checked + .switch::after { transform: translateX(18px); }
html[dir=rtl] .menu-item.switchy input:checked + .switch::after, html[dir=rtl] .switch-row input:checked + .switch::after { transform: translateX(-18px); }

/* Invoice */
.inv-page { max-width: 860px; margin: 0 auto; padding: 18px 14px 40px; }
.inv-page.in-app { padding: 0 0 24px; }
.inv-tools { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.lang-btn.dark { color: var(--ink); border-color: var(--line-mid); }
.invoice { position: relative; background: #fff; color: #1F1D1B; border-radius: 20px; border: 1px solid #E7DDCE; box-shadow: 0 18px 50px rgba(43,35,28,.10); padding: 34px 32px; overflow: hidden; }
.invoice::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, #2B2B2B, #836E63 45%, #DCC6A5); }
.inv-draft { position: absolute; top: 18px; inset-inline-end: -46px; transform: rotate(35deg); background: #B4442F; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 5px 52px; text-transform: uppercase; }
html[dir=rtl] .inv-draft { transform: rotate(-35deg); }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #EAE1D4; }
.inv-brand { display: flex; align-items: center; gap: 14px; }
.inv-brand img { width: 92px; }
.inv-app { margin: 0; font: 800 22px/1.1 var(--serif); }
.inv-by { margin: 2px 0 0; color: #836E63; font-weight: 600; font-size: 13px; }
.inv-title { text-align: end; }
.inv-title h1, .inv-title .inv-h { margin: 0; font: 800 30px/1 var(--serif); letter-spacing: .02em; color: #2B2B2B; }
.inv-title p { margin: 6px 0 0; color: #675F57; font-size: 14px; }
.inv-no { font-weight: 700; color: #2B2B2B !important; letter-spacing: .04em; }
.inv-parties { display: grid; gap: 18px; padding: 20px 0; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.inv-parties h2 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #836E63; }
.inv-parties p { margin: 0 0 3px; font-size: 14px; line-height: 1.45; }
.invoice .lines th { color: #836E63; border-bottom-color: #DCC6A5; }
.invoice .ref, .invoice .muted { color: #675F57; }
.invoice .lines td { border-bottom-color: #F0E8DC; }
.inv-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; font-size: 14.5px; }
.inv-pay.paid { background: #EEF4EC; color: #2F5130; }
.inv-pay.paid .ic { stroke: #3B5D39; }
.inv-pay.due { background: #FBF4E7; color: #6B4E17; }
.inv-pay span { color: inherit; opacity: .85; }
.inv-note { margin: 14px 0 0; font-size: 14px; color: #4A433D; }
.inv-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid #EAE1D4; text-align: center; display: grid; justify-items: center; gap: 6px; }
.inv-foot img { width: 150px; padding: 10px 14px; border-radius: 12px; background: #2B2B2B; }
.inv-foot p { margin: 0; font-size: 13.5px; color: #675F57; }
.inv-slogan { font-family: var(--serif); font-style: italic; color: #836E63 !important; }
@media (max-width: 560px) { .invoice { padding: 26px 18px; } .inv-head { flex-direction: column; } .inv-title { text-align: start; } }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  .noprint, .side, .tabs, .bar, .demo-bar, .toast, #toast { display: none !important; }
  .frame, .main, .view, .inv-page { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .invoice { box-shadow: none; border: 0; border-radius: 0; padding: 0; }
  .inv-foot img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .invoice::before, .inv-pay, .inv-draft { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- version 1.3: visits, BOQ, signature, teams ---------- */
.steps.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.steps.five li { font-size: 11.5px; }
.step-now { display: none; margin: 10px 0 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); }
@media (max-width: 380px) {
  .steps.five .step-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .step-now { display: block; }
}
.info.ok { background: var(--st-completed-bg); border-color: transparent; color: var(--st-completed); }
.info.ok .ic { stroke: var(--st-completed); }
.visit-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.visit-row:first-of-type { border-top: 0; }
.visit-row > .ic { flex: none; stroke: var(--taupe); }
.visit-row > span:not(.chip) { flex: 1; display: grid; gap: 2px; }
.visit-row small { color: var(--muted); font-size: 13px; }
.boq { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-mid); }
.boq-h { margin: 0 0 8px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.boq-h .ic { stroke: var(--taupe); }
.boq-more { margin-top: 10px; }
.boq-more summary { cursor: pointer; color: var(--taupe-ink); font-weight: 600; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.boq-edit { display: grid; gap: 10px; margin: 6px 0 10px; }
.boq-row { display: grid; grid-template-columns: 1fr 78px 86px 40px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.boq-row .b-desc { grid-column: 1 / -1; }
.boq-row input { width: 100%; }
@media (max-width: 420px) { .boq-row { grid-template-columns: 1fr 1fr 40px; } .boq-row .l-num:first-of-type { grid-column: auto; } }
.sig-pad { position: relative; border: 2px dashed #857769; border-radius: 14px; background: #fff; overflow: hidden; }
.sig-pad canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig-clear { position: absolute; top: 6px; inset-inline-end: 6px; min-height: 44px; min-width: 64px; padding: 0 16px; border-radius: 999px; border: 1px solid #D9CCBB;
  background: #fff; color: #6B574D; font-size: 14px; font-weight: 600; box-shadow: 0 1px 2px rgba(43,35,28,.08); }
.sig-clear:hover { border-color: #6B574D; }
.sig-clear:focus-visible { outline: 3px solid #6B574D; outline-offset: 2px; }
.sig-view { display: block; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 0; width: 100%; max-width: 360px; overflow: hidden; }
.sig-view img { display: block; width: 100%; height: auto; }
.thumb.sig { width: 180px; height: 96px; background: #fff; border: 1px solid var(--line); }
.thumb.sig img { object-fit: contain; }
.crew { display: grid; gap: 4px; }
.crew-h { margin: 6px 0 0; font-weight: 700; display: flex; gap: 8px; align-items: center; color: var(--taupe-ink); }
.team-line { margin: 0 0 10px; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.team-card .doc-head { margin-bottom: 8px; }
.team-card.off { opacity: .65; }
.mini-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 4px 0 12px; }
.mini-kpis span { display: grid; gap: 2px; align-content: start; text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--surface-2); font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.mini-kpis b { font-size: 17px; color: var(--ink); }
.crew-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crew-list li { display: flex; gap: 10px; align-items: center; }
.crew-list li.off { opacity: .55; }
.crew-list li > span:last-child { display: grid; }
.crew-list small { color: var(--muted); font-size: 12.5px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.check-list { display: grid; gap: 8px; margin-top: 8px; }
.check-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--taupe); flex: none; }
.check-row span { display: grid; }
.check-row small { color: var(--muted); font-size: 12.5px; }
.receipt-line { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; font-weight: 600; }
.receipt-line .ic { stroke: var(--taupe); }
.switch-row.tight { margin-top: 12px; }
.h2.sec { margin: 22px 0 10px; }
.inline-add { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.row.center { justify-content: center; }
.invoice.receipt .inv-pay { font-size: 17px; }
.boq-row .l-num, .boq-row .l-num:first-of-type, .boq-row .l-num:last-of-type { grid-area: auto; }
.boq-row input { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); font: inherit; }
.boq-row input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--taupe); }
.boq-row .icon-btn { width: 40px; height: 40px; }

/* ---------- 1.3.1: front-end review fixes ---------- */
/* Arabic words of the owner line on the welcome page */
html[dir=rtl] .w-owned-by { font-family: 'Tajawal', var(--font); font-style: normal; font-weight: 700; letter-spacing: 0; }
/* the client's Cancel request, at the end of the request page */
.end-actions { display: flex; justify-content: center; padding: 2px 0 6px; }
/* request cards on narrow phones: status chips go under the text instead of squeezing it */
@media (max-width: 480px) {
  .card.req:not(.notif) { flex-wrap: wrap; }
  .card.req:not(.notif) .req-main { flex: 1 1 calc(100% - 54px); }
  .card.req:not(.notif) .req-side { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; padding-inline-start: 54px; }
}
/* text links: a bigger tap area without moving the text around them */
.link { padding-block: 10px; margin-block: -10px; }
/* touch screens: 44 px tap targets */
@media (pointer: coarse) {
  .btn.small, .lang-btn, .fchip, .seg-btn { min-height: 44px; }
  .pw-toggle { top: 3px; height: 44px; }
  .icon-btn, .l-del, .banner .icon-btn, .boq-row .icon-btn { width: 44px; height: 44px; }
  .loc-paste input, .range input, .range select { min-height: 44px; }
}
/* switches: off is an outlined track with a taupe knob, on is a filled track with a white knob (state is clear by colour and position) */
.switch { background: var(--field); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.switch::after { background: var(--line-strong); box-shadow: none; }
.switch-row input:checked + .switch, .menu-item.switchy input:checked + .switch { background: var(--taupe); box-shadow: none; }
.switch-row input:checked + .switch::after, .menu-item.switchy input:checked + .switch::after { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-row input[name=urgent]:checked + .switch { background: #B4442F; }
/* team tiles: 3 + 2 on narrow phones, so the labels stay on one or two lines */
@media (max-width: 420px) { .mini-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ============ 1.4 preview ============ */
/* Urgent promise (point 1) */
.tag.sla { background: var(--st-submitted-bg); color: var(--st-submitted); margin-inline-start: 6px; vertical-align: middle; }
/* Photo serial numbers (point 13) */
.photo-no { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
small.photo-no { display: block; }
.photo-cap { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
/* BOQ: one photo per line (point 9) */
.boq-row { grid-template-columns: 1fr 78px 86px 44px 40px; }
.boq-row .b-photo { margin: 0; display: grid; justify-items: center; }
.boq-row .b-photo .photo-btn { min-height: 44px; width: 44px; padding: 0; border-radius: 12px; border-style: dashed; }
.boq-row .b-photo .photo-btn .ic { width: 18px; height: 18px; }
.boq-row .b-photo .photo-preview { gap: 4px; flex-direction: column; }
.boq-row .b-photo .photo-preview img { width: 44px; height: 44px; border-radius: 10px; }
.boq-row .b-photo .photo-preview .link { font-size: 0; min-height: 22px; }
.boq-row .b-photo .photo-preview .link .ic { width: 14px; height: 14px; }
@media (max-width: 420px) { .boq-row { grid-template-columns: 1fr 1fr 44px 40px; } }
.lines .ph-col { width: 56px; text-align: center; }
.lines .ph-col .ic { width: 15px; height: 15px; stroke: var(--muted); }
.line-thumb { display: inline-block; vertical-align: middle; width: 40px; height: 40px; padding: 0; margin-inline-end: 8px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line-kind .line-thumb { width: 34px; height: 34px; margin: 0; }
/* Cost next to the selling price, inside the company only (point 10) */
.line-row { grid-template-areas: "kind kind del" "desc desc desc" "qty price total" "cost cost cost"; }
.l-pricebox { grid-area: price; }
.l-num.l-costbox { grid-area: cost; }
.l-costbox small { display: inline-flex; align-items: center; gap: 4px; color: var(--taupe-ink); }
.l-costbox small .ic { width: 12px; height: 12px; }
.l-costbox input { border-style: dashed !important; background: var(--warm) !important; }
@media (min-width: 640px) {
  .line-row { grid-template-columns: 96px minmax(0, 1fr) 80px 108px 100px 104px 36px; grid-template-areas: "kind desc qty price cost total del"; }
}
.cost-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; background: var(--warm); border: 1px dashed var(--warm-line); color: var(--taupe-ink); font-size: 14px; font-weight: 600; }
.cost-line:empty { display: none; }
.doc-form > p.muted.small .ic, .card > p.muted.small > .ic { width: 15px; height: 15px; vertical-align: -2px; }
.cost-line .ic { width: 15px; height: 15px; stroke: var(--taupe); }
.lines .cost-col { color: var(--taupe-ink); background: color-mix(in srgb, var(--warm) 70%, transparent); }
.lines th.cost-col .ic { width: 12px; height: 12px; vertical-align: -1px; }
/* Extra cost fields on the labour price page (point 2) */
.extras { display: grid; gap: 10px; }
.x-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 44px; gap: 10px; align-items: end; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--warm-line); background: var(--warm); }
.x-row .field { margin: 0; }
/* Invoice log and the "entered in our system" tick (points 11, 12) */
.acct-log .log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.acct-log .log li { display: flex; gap: 10px; align-items: flex-start; }
.log-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--soft); }
.log-ic .ic { width: 16px; height: 16px; stroke: var(--taupe-ink); }
.log-main { display: grid; gap: 2px; }
.log-main small { font-size: 12.5px; }
.tag.auto { background: var(--st-completed-bg); color: var(--st-completed); justify-self: start; white-space: normal; }
.switch-row.erp { margin-top: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.switch-row.erp.on { border-color: color-mix(in srgb, var(--st-completed) 35%, var(--line)); background: color-mix(in srgb, var(--st-completed-bg) 55%, var(--surface)); }
/* Client signature on the invoice and the receipt (point 16) */
.inv-sig { margin: 18px 0 0; padding: 12px 14px; border: 1px solid #E5DCCF; border-radius: 12px; max-width: 320px; }
.inv-sig h2 { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #836E63; }
.inv-sig img { display: block; width: 100%; max-height: 110px; object-fit: contain; background: #fff; }
.inv-sig p { margin: 6px 0 0; font-size: 12.5px; color: #675F57; }
/* Timers (point 7) */
.tag.timer { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tag.timer.late { background: #F6DED8; color: #8E3322; border-color: #E7B9AE; }
.tm-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: tm; }
.tm-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "ic l v" "ic l s"; column-gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.stage-avg .tm-list li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "l s"; }
.tm-list li:last-child { border-bottom: 0; }
.tm-ic { grid-area: ic; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; background: var(--st-completed-bg); }
.tm-ic .ic { width: 14px; height: 14px; stroke: var(--st-completed); }
.tm-list li.run .tm-ic { background: var(--st-submitted-bg); }
.tm-list li.run .tm-ic .ic { stroke: var(--st-submitted); }
.tm-l { grid-area: l; font-size: 14px; }
.tm-v { grid-area: v; text-align: end; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.tm-s { grid-area: s; text-align: end; font-size: 12px; color: var(--muted); }
.tm-list li.run .tm-v { color: var(--st-submitted); }
.tm-total { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line-mid); font-weight: 600; }
.late-note { display: flex; gap: 8px; align-items: center; margin: 6px 0 0; padding: 8px 12px; border-radius: 12px; background: #F6DED8; color: #8E3322; font-weight: 600; font-size: 14px; }
.late-note .ic { width: 16px; height: 16px; stroke: #8E3322; flex: none; }
.timers.late { border-color: #E7B9AE; }
.stage-avg { margin-top: 12px; }
/* Period filter for the tiles (point 15) */
.period { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.period > .ic { width: 18px; height: 18px; stroke: var(--taupe); margin-inline-end: 2px; }
.chip-btn { min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line-mid); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; transition: background .2s, color .2s, border-color .2s; }
.chip-btn:hover { border-color: var(--taupe); }
.chip-btn.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.h2.sec { margin: 22px 0 10px; }
/* Wide tiles: money by method (point 8) and quotation status (point 6) */
.kpi.wide { grid-column: span 2; }
.mm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.mm-row:last-of-type { border-bottom: 0; }
.mm-row > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); }
.mm-row > span .ic { width: 16px; height: 16px; }
.mm-row b { font: 700 20px/1.1 var(--serif); }
.qs-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0; }
.qs-c { display: grid; gap: 2px; padding: 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.qs-c b { font: 700 24px/1.1 var(--serif); }
.qs-c small { font-size: 12px; color: var(--muted); font-weight: 600; }
.qs-c.warn { background: var(--st-submitted-bg); border-color: #E3C48E; }
.qs-c.ok { background: var(--st-completed-bg); }
.qs-c.bad { background: #F6DED8; }
/* Help desk (point 14) */
.route-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.route-card p { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.route-card .ic { stroke: var(--taupe); }
.route-row { display: grid; gap: 6px; }
.route-row > .btn { justify-self: end; margin-top: -4px; }
.load-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.load-grid.big { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.load { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); position: relative; padding-inline-start: 16px; }
.load::before { content: ''; position: absolute; inset-block: 10px; inset-inline-start: 6px; width: 4px; border-radius: 4px; background: var(--st-completed); }
.load.some::before { background: #C99A3E; }
.load.busy::before { background: #B4442F; }
.load .ic { width: 16px; height: 16px; stroke: var(--taupe); }
.load small { color: var(--muted); font-size: 12.5px; }
.card.notice { text-align: center; display: grid; justify-items: center; gap: 6px; }
.card.notice > .ic { width: 34px; height: 34px; stroke: var(--taupe); }

/* ---------- Office big screen (point 3) ---------- */
.board { position: relative; min-height: 100dvh; padding: 22px 28px 16px; color: var(--ivory); overflow: hidden; isolation: isolate;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(220,198,165,.16), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(131,110,99,.28), transparent 60%), linear-gradient(160deg, #232120 0%, #1A1918 100%); }
.board .dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.b-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid rgba(220,198,165,.18); position: relative; }
.b-head::after { content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--sand), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: shine 6s ease-in-out infinite; }
.b-brand { display: flex; align-items: center; gap: 14px; }
.b-brand .by { color: var(--sand); font-size: 14px; }
.b-clock { display: grid; justify-items: center; }
.b-clock b { font: 700 46px/1 var(--serif); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.b-clock small { color: var(--sand); font-size: 15px; margin-top: 4px; }
.b-tools { display: flex; gap: 8px; align-items: center; }
.b-tools .icon-btn { color: var(--ivory); }
.b-tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin: 18px 0 10px; }
.b-tile { display: grid; gap: 4px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(220,198,165,.16); backdrop-filter: blur(2px); }
.b-tile .ic { width: 22px; height: 22px; stroke: var(--sand); }
.b-v { font: 700 44px/1 var(--serif); color: #fff; font-variant-numeric: tabular-nums; }
.b-tile span { color: rgba(246,241,233,.72); font-size: 15px; font-weight: 600; }
.b-tile.warn { border-color: rgba(231,201,143,.55); box-shadow: 0 0 0 1px rgba(231,201,143,.2), 0 0 28px rgba(231,201,143,.12); }
.b-tile.hot { border-color: rgba(224,137,123,.6); box-shadow: 0 0 26px rgba(224,137,123,.18); }
.b-tile.hot .b-v { color: #F2B4A8; }
.b-tile.ok .b-v { color: #C9E2C4; }
.b-late { display: inline-flex; gap: 8px; align-items: center; margin: 0 0 8px; padding: 8px 14px; border-radius: 999px; background: rgba(180,68,47,.25); color: #F7CFC6; font-weight: 700; }
.b-late .ic { stroke: #F7CFC6; }
.b-cols { display: grid; grid-template-columns: 1fr 1fr 0.85fr; gap: 16px; align-items: start; }
.b-col { background: rgba(255,255,255,.03); border: 1px solid rgba(220,198,165,.14); border-radius: 20px; padding: 14px; max-height: calc(100dvh - 320px); overflow: hidden; }
.b-col h2 { display: flex; align-items: center; gap: 10px; margin: 2px 4px 10px; font: 700 20px/1.2 var(--serif); color: var(--sand); }
.b-col h2 + ul, .b-col h2 + div, .b-col h2 + ol { margin-bottom: 14px; }
.b-n { font: 700 14px/1 var(--font); color: var(--charcoal); background: var(--sand); border-radius: 999px; padding: 4px 10px; }
.b-col ul, .b-col ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.b-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06); }
.b-card .svc-ic { width: 42px; height: 42px; border-radius: 12px; background: rgba(220,198,165,.14); display: grid; place-items: center; }
.b-card .svc-ic .ic { stroke: var(--sand); }
.b-main { display: grid; gap: 2px; }
.b-main b { font-size: 16px; color: #fff; }
.b-main .ref { color: var(--sand); font-weight: 600; font-size: 13.5px; }
.b-main small { color: rgba(246,241,233,.7); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-main small .ic { width: 13px; height: 13px; vertical-align: -2px; stroke: rgba(246,241,233,.7); }
.b-state { color: var(--sand) !important; }
.b-card.urgent { border-color: rgba(224,137,123,.45); }
.b-card.late { background: rgba(180,68,47,.16); }
.b-timer { display: inline-flex; align-items: center; gap: 6px; font: 700 15px/1 var(--font); color: var(--ivory); background: rgba(0,0,0,.25); padding: 8px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; direction: ltr; }
.b-timer .ic { width: 15px; height: 15px; stroke: var(--sand); }
.b-card.late .b-timer { background: rgba(180,68,47,.4); }
.b-none { color: rgba(246,241,233,.5); padding: 10px 4px; }
.b-teams li { display: grid; grid-template-columns: 12px auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); }
.b-teams small { color: rgba(246,241,233,.72); text-align: end; }
.b-dot { width: 10px; height: 10px; border-radius: 999px; background: #8FBF88; box-shadow: 0 0 10px rgba(143,191,136,.7); }
.ts-assigned .b-dot, .ts-on_way .b-dot { background: #E7C98F; box-shadow: 0 0 10px rgba(231,201,143,.7); }
.ts-on_site .b-dot, .ts-working .b-dot { background: #9CC8D6; box-shadow: 0 0 10px rgba(156,200,214,.7); animation: pulse 2.4s ease-in-out infinite; }
.b-qs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.b-qs span { display: grid; gap: 2px; text-align: center; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,.04); }
.b-qs b { font: 700 26px/1 var(--serif); color: #fff; }
.b-qs small { font-size: 12px; color: rgba(246,241,233,.7); }
.b-qs .ok b { color: #C9E2C4; }
.b-times li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; color: rgba(246,241,233,.8); }
.b-times b { color: #fff; font-variant-numeric: tabular-nums; }
.b-foot { margin-top: 12px; text-align: center; color: rgba(246,241,233,.5); font-size: 13px; }
@media (max-width: 1200px) { .b-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .b-cols { grid-template-columns: 1fr 1fr; } .b-col.side { grid-column: 1 / -1; } .b-col { max-height: none; } }
@media (max-width: 720px) { .board { padding: 14px; } .b-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .b-cols { grid-template-columns: 1fr; } .b-head { flex-wrap: wrap; } .b-clock b { font-size: 34px; } }

/* ---------- Effects in E-Serve colours (point 19), light and calm ---------- */
@keyframes shine { 0% { background-position: -40% 0; } 60%, 100% { background-position: 140% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .7; } }
@keyframes drift { from { background-position: 0 0; } to { background-position: 120px 60px; } }
@keyframes glow { 0%, 100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 1px rgba(227,196,142,.55), 0 8px 24px rgba(201,154,62,.16); } }
/* a soft sand gleam runs along the top bar and the side menu */
.bar, .side { position: relative; }
.bar::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(220,198,165,.9), transparent); background-size: 35% 100%; background-repeat: no-repeat; animation: shine 7s ease-in-out infinite; }
.side::after { content: ''; position: absolute; inset-block: 0; inset-inline-end: 0; width: 1px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(220,198,165,.55), transparent); }
/* cards and tiles glide into view, one after another */
.view > *, .kpis > *, .list > *, .load-grid > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.kpis > *:nth-child(2), .list > *:nth-child(2) { animation-delay: .04s; }
.kpis > *:nth-child(3), .list > *:nth-child(3) { animation-delay: .08s; }
.kpis > *:nth-child(4), .list > *:nth-child(4) { animation-delay: .12s; }
.kpis > *:nth-child(5), .list > *:nth-child(5) { animation-delay: .16s; }
.kpis > *:nth-child(6), .list > *:nth-child(6) { animation-delay: .2s; }
.kpis > *:nth-child(n+7), .list > *:nth-child(n+7) { animation-delay: .24s; }
.no-rise .view > *, .no-rise .kpis > *, .no-rise .list > *, .no-rise .load-grid > * { animation: none; }
/* tiles and cards lift a little under the pointer, with a sand edge */
@media (hover: hover) {
  .kpi, .card.req, .load, .quick-btn { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
  .kpi:hover, .card.req:hover, .load:hover, .quick-btn:hover { transform: translateY(-2px); border-color: var(--warm-line); box-shadow: 0 2px 4px rgba(43,35,28,.06), 0 12px 26px rgba(131,110,99,.14); }
}
/* tiles that need someone glow softly */
.kpi.warn { animation: rise .5s cubic-bezier(.2,.7,.2,1) both, glow 3.2s ease-in-out .6s infinite; }
.kpi .ic { transition: transform .3s ease; }
.kpi:hover .ic { transform: scale(1.08) rotate(-4deg); }
/* the welcome page: a faint sand dot pattern drifts behind the brand */
.welcome { position: relative; isolation: isolate; }
.welcome::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
  background-image: radial-gradient(rgba(220,198,165,.35) 1px, transparent 1.2px); background-size: 22px 22px; animation: drift 40s linear infinite; }
.welcome .dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.page-h { background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 40%, var(--taupe) 50%, var(--ink) 60%, var(--ink) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 9s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .page-h { background-image: linear-gradient(100deg, var(--ink) 0%, var(--ink) 40%, var(--sand) 50%, var(--ink) 60%, var(--ink) 100%); } }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); background-size: 250% 100%; background-position: 130% 0; transition: background-position .8s ease; }
.btn.primary:hover::after { background-position: -30% 0; }
@media (prefers-reduced-motion: reduce) {
  .bar::after, .b-head::after, .page-h, .welcome::before, .kpi.warn, .ts-on_site .b-dot, .ts-working .b-dot { animation: none; }
  .view > *, .kpis > *, .list > *, .load-grid > * { animation: none; }
  .kpi, .card.req, .load, .quick-btn, .kpi .ic { transition: none; }
  .kpi:hover, .card.req:hover, .load:hover, .quick-btn:hover, .kpi:hover .ic { transform: none; }
  .page-h { color: var(--ink); background: none; }
}
@media print { .bar::after, .page-h { animation: none; } .page-h { color: #000; background: none; } }

/* ============ 1.4.1 preview: points 20–24 and more life ============ */
.check-row.keep { margin: 2px 0 14px; }
.check-row.keep small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.approval-note { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.approval-note .ic { width: 16px; height: 16px; stroke: var(--taupe); flex: none; }
.tc-block .h2 { display: flex; align-items: center; gap: 8px; }
.tc-block .h2 .ic { width: 20px; height: 20px; stroke: var(--taupe); }
.card.tc { border-inline-start: 4px solid #C99A3E; }
.card.tc.approved { border-inline-start-color: var(--st-completed); }
.card.tc.rejected, .card.tc.replaced { border-inline-start-color: var(--line-mid); opacity: .85; }
.chip.tc-pending { background: var(--st-submitted-bg); color: var(--st-submitted); }
.chip.tc-approved { background: var(--st-completed-bg); color: var(--st-completed); }
.chip.tc-rejected, .chip.tc-replaced { background: var(--surface-2); color: var(--muted); }
.tc-diff { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tc-diff li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 10px; font-size: 14px; }
.tc-diff li span { color: var(--muted); }
.tc-diff li s { color: var(--muted); grid-column: 2; }
.tc-diff li b { grid-column: 2; }

/* --- motion: pages slide in, in the direction you go --- */
@keyframes viewIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes viewBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.view { animation: viewIn .38s cubic-bezier(.2,.8,.2,1) both; }
[dir=rtl] .view { animation-name: viewBack; }
[data-nav=back] .view { animation-name: viewBack; }
[dir=rtl][data-nav=back] .view { animation-name: viewIn; }
.no-rise .view { animation: none; }
/* cards further down glide in when they scroll into view */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
/* a sand ripple where a button is pressed */
.rippling { overflow: hidden; isolation: isolate; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(201,168,119,.38) 0%, rgba(201,168,119,.16) 45%, transparent 70%); transform: scale(0); animation: ripple .62s ease-out forwards; z-index: 0; }
.btn.primary .ripple, .side .ripple, .b-tools .ripple { background: radial-gradient(circle, rgba(238,221,191,.42) 0%, rgba(238,221,191,.14) 45%, transparent 70%); }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
/* celebrations */
canvas.burst { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }
/* a soft light sweeps across tiles and cards under the pointer */
@media (hover: hover) {
  .kpi, .card.req { overflow: hidden; }
  .kpi::after, .card.req::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(238,221,191,.28) 50%, transparent 65%); transform: translateX(-120%); transition: transform .9s ease; }
  .kpi:hover::after, .card.req:hover::after { transform: translateX(120%); }
  .kpi, .card.req { position: relative; }
  .thumb img, .line-thumb img, .first-photo img { transition: transform .4s ease; }
  .thumb:hover img, .line-thumb:hover img, .first-photo:hover img { transform: scale(1.08); }
}
/* the progress steps fill in, and the current step breathes */
@keyframes fillLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 4px var(--halo); } 50% { box-shadow: 0 0 0 9px transparent; } }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.steps li.done::before, .steps li.now::before { transform-origin: left center; animation: fillLine .6s ease-out both; }
[dir=rtl] .steps li.done::before, [dir=rtl] .steps li.now::before { transform-origin: right center; }
.steps li:nth-child(2)::before { animation-delay: .1s; } .steps li:nth-child(3)::before { animation-delay: .25s; } .steps li:nth-child(4)::before { animation-delay: .4s; } .steps li:nth-child(5)::before { animation-delay: .55s; }
.steps li.done .step-dot { animation: popIn .45s cubic-bezier(.2,.8,.2,1) both; }
.steps li:nth-child(2) .step-dot { animation-delay: .12s; } .steps li:nth-child(3) .step-dot { animation-delay: .27s; } .steps li:nth-child(4) .step-dot { animation-delay: .42s; } .steps li:nth-child(5) .step-dot { animation-delay: .57s; }
.steps li.now:not(.final) .step-dot { animation: breathe 2.4s ease-in-out infinite; }
.steps li.now.final .step-dot { animation: popIn .5s cubic-bezier(.2,.8,.2,1) .6s both; }
.no-rise .steps li::before, .no-rise .steps li .step-dot { animation-delay: 0s !important; animation-duration: 0s !important; }
.no-rise .steps li.now:not(.final) .step-dot { animation: breathe 2.4s ease-in-out infinite !important; }
/* live statuses have a beating dot */
@keyframes beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .45; } }
.chip.st-in_progress::before, .chip.st-assigned::before, .chip.st-submitted::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: beat 1.8s ease-in-out infinite; }
.tag.urgent { animation: urgentGlow 2.2s ease-in-out infinite; }
@keyframes urgentGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(180,68,47,0); } 50% { box-shadow: 0 0 0 4px rgba(180,68,47,.16); } }
.tag.timer .ic { animation: tick 2s steps(2, end) infinite; transform-origin: 50% 55%; }
@keyframes tick { 0% { transform: rotate(-8deg); } 100% { transform: rotate(8deg); } }
/* tabs: a sand mark slides under the one you are on */
@keyframes markIn { from { transform: translateX(-50%) scaleX(0); } to { transform: translateX(-50%) scaleX(1); } }
.tabs .tab.on::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 22px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #C9A877, #EEDDBF); transform: translateX(-50%); animation: markIn .35s ease-out both; }
@media (min-width: 900px) { .side .tab.on::after { content: ''; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #EEDDBF, #C9A877); left: auto; bottom: auto; transform: none; animation: none; } }
.tab.on .ic { animation: hop .45s cubic-bezier(.2,.8,.2,1); }
.no-rise .tab.on .ic, .no-rise .tabs .tab.on::after { animation: none; }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-4px); } 100% { transform: translateY(0); } }
/* the side menu: a faint drifting sand pattern */
.side::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(rgba(220,198,165,.18) 1px, transparent 1.3px); background-size: 20px 20px; animation: drift 60s linear infinite; }
.side > * { position: relative; }
/* toasts spring in; the alerts bell rings now and then */
.toast { transition: opacity .3s ease, transform .45s cubic-bezier(.2,1.4,.4,1); }
.toast.show:not(.err)::before { content: '✓'; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline-end: 8px; border-radius: 50%; background: var(--sand); color: var(--charcoal); font-weight: 800; font-size: 12px; animation: popIn .4s ease-out .1s both; }
@keyframes ring { 0%, 86%, 100% { transform: rotate(0); } 88% { transform: rotate(14deg); } 91% { transform: rotate(-12deg); } 94% { transform: rotate(8deg); } 97% { transform: rotate(-4deg); } }
.banner > .ic:first-child, .tab[data-v=alerts] .ic { transform-origin: 50% 10%; animation: ring 6s ease-in-out 1.5s infinite; }
.tab .dot { animation: popIn .4s ease-out both; }
/* windows slide up with a soft blur behind */
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-back { animation: fadeIn .25s ease both; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal { animation: sheetUp .42s cubic-bezier(.2,.9,.25,1.05) both; }
/* loading: soft shimmering cards instead of a word */
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.loading.skel { display: grid; gap: 12px; padding: 22px 0; }
.loading.skel i { display: block; height: 92px; border-radius: 18px; background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--sand) 30%, var(--surface)) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.loading.skel i:nth-child(3) { height: 62px; width: 70%; }
/* empty pages: the picture floats */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.empty .ic, .done-ic .ic, .card.notice > .ic { animation: bob 3.6s ease-in-out infinite; }
.done-ic { animation: popIn .6s cubic-bezier(.2,.8,.2,1) both; }
/* the timeline of updates draws in, one after another */
.timeline > li { animation: rise .45s ease-out both; }
.timeline > li:nth-child(2) { animation-delay: .05s; } .timeline > li:nth-child(3) { animation-delay: .1s; } .timeline > li:nth-child(4) { animation-delay: .15s; } .timeline > li:nth-child(n+5) { animation-delay: .2s; }
.no-rise .timeline > li { animation: none; }
/* the sign-in pages: dust in the dark header */
.auth-head { position: relative; overflow: hidden; isolation: isolate; }
.auth-head .dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
/* service icons breathe softly on the request page */
.view > .card:first-child .svc-ic { animation: bob 5s ease-in-out infinite; }
/* the office board: changed numbers flash, new cards slide in */
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.18); color: var(--sand); } 100% { transform: scale(1); } }
.b-tile.bump { animation: tileGlow 1.6s ease-out; }
.b-tile.bump .b-v { display: inline-block; animation: bump .9s ease-out; }
@keyframes tileGlow { 0% { box-shadow: 0 0 0 0 rgba(220,198,165,.0); } 25% { box-shadow: 0 0 0 3px rgba(220,198,165,.45), 0 0 40px rgba(220,198,165,.25); } 100% { box-shadow: 0 0 0 0 rgba(220,198,165,0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.b-card.fresh { animation: slideIn .7s cubic-bezier(.2,.8,.2,1) both, freshGlow 2.6s ease-out .2s; }
@keyframes freshGlow { 0% { background: rgba(220,198,165,.28); } 100% { background: rgba(255,255,255,.05); } }
.b-card.urgent .svc-ic { animation: urgentGlow 2.2s ease-in-out infinite; }
.b-clock b { background: linear-gradient(100deg, #fff 30%, var(--sand) 50%, #fff 70%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .view, .reveal, .ripple, .steps li::before, .steps li .step-dot, .chip::before, .tag.urgent, .tag.timer .ic, .tabs .tab.on::after, .tab.on .ic, .side::before, .toast.show::before,
  .banner > .ic, .tab .ic, .tab .dot, .modal, .modal-back, .loading.skel i, .empty .ic, .done-ic, .done-ic .ic, .card.notice > .ic, .timeline > li, .svc-ic, .b-tile.bump, .b-tile.bump .b-v, .b-card.fresh, .b-clock b { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .b-clock b { color: #fff; background: none; }
  .kpi::after, .card.req::after { display: none; }
  .toast { transition: opacity .2s; }
}
/* the Whish QR on accounting's home page (point 25) */
.whish-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.whish-card .h3 { margin: 0 0 2px; }
.whish-card p { margin: 0; }
.qr-box.sm { width: 72px; height: 72px; padding: 6px; border-radius: 14px; margin: 0; }
.qr-box.sm img { width: 100%; height: 100%; object-fit: contain; }
.qr-box.sm.missing { display: grid; place-items: center; }
.qr-box.sm.missing .ic { width: 30px; height: 30px; }
.whish-card.missing { border-color: #E3C48E; background: color-mix(in srgb, var(--st-submitted-bg) 55%, var(--surface)); }
@media (max-width: 520px) { .whish-card { grid-template-columns: 60px minmax(0, 1fr); } .whish-card .btn { grid-column: 1 / -1; } }

/* ============ 1.4.1: the finishing touches (quieter, more refined, alive) ============ */
/* Greeting band on every department's home: charcoal, a sand hairline, the time in Beirut */
.hello { position: relative; overflow: hidden; isolation: isolate; }
.hello::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 140% at 100% 0%, rgba(220,198,165,.16), transparent 55%), radial-gradient(90% 120% at 0% 100%, rgba(131,110,99,.22), transparent 60%); }
.hello::after { content: ''; position: absolute; inset-inline: 20px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(220,198,165,.55), transparent); }
.hello.staff { margin-bottom: 16px; padding-bottom: 22px; }
.hello-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hello-role { margin: 6px 0 0; font-size: 13.5px; color: rgba(246,241,233,.72); letter-spacing: .01em; }
.hello-clock { display: grid; justify-items: end; gap: 2px; text-align: end; flex: none; }
.hello-clock b { font: 600 30px/1 var(--serif); color: var(--ivory); font-variant-numeric: tabular-nums lining-nums; letter-spacing: .02em; }
.hello-clock span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--sand); }
html[dir=rtl] .hello-clock span { letter-spacing: 0; }
.hello-clock b.tick { animation: clockTick .6s ease; }
@keyframes clockTick { from { opacity: .35; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.hello-pulse { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pulse-i { display: inline-flex; align-items: baseline; gap: 7px; padding: 7px 12px 7px 11px; border-radius: 999px; background: rgba(246,241,233,.07); border: 1px solid rgba(220,198,165,.18); color: rgba(246,241,233,.82); font-size: 13px; }
.pulse-i b { font: 700 17px/1 var(--serif); color: var(--ivory); font-variant-numeric: tabular-nums; }
.pulse-i.warn { border-color: rgba(220,198,165,.55); background: rgba(220,198,165,.13); }
.pulse-i.warn b { color: var(--sand); }
.pulse-i.warn::before { content: ''; align-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--sand); box-shadow: 0 0 0 0 rgba(220,198,165,.6); animation: pulseDot 2.4s ease-out infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(220,198,165,.55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(220,198,165,0); } }
@media (min-width: 960px) {
  .hello.staff { margin-top: 0; padding: 24px 28px 24px; border-radius: 22px; }
  .hello.staff .hello-name { font-size: 36px; }
  .hello-clock b { font-size: 38px; }
}

/* Section titles: small capitals with a sand hairline */
.h2.sec { display: flex; align-items: center; gap: 14px; margin: 30px 0 12px; font: 700 12px/1.2 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--taupe-ink); }
.h2.sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--warm-line), transparent); }
html[dir=rtl] .h2.sec { letter-spacing: 0; font-size: 14px; text-transform: none; }
html[dir=rtl] .h2.sec::after { background: linear-gradient(270deg, var(--warm-line), transparent); }
.block > .h2:not(.sec), .h2.with-rule { position: relative; }

/* Cards and tiles: finer edges, softer depth, a sand line that lights up on hover */
.card { border-color: color-mix(in srgb, var(--line) 85%, transparent); box-shadow: 0 1px 1px rgba(43,35,28,.035), 0 10px 26px -16px rgba(43,35,28,.22); }
.kpi { position: relative; overflow: hidden; gap: 5px; padding: 16px 16px 14px; background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .25s ease; }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--sand), transparent); opacity: 0; transition: opacity .3s ease; }
.kpi .ic { width: 20px; height: 20px; stroke-width: 1.6; padding: 7px; box-sizing: content-box; border-radius: 10px; background: color-mix(in srgb, var(--soft) 70%, transparent); }
.kpi-v { font-size: 30px; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.005em; margin-top: 4px; }
.kpi-l { font-size: 13px; letter-spacing: .005em; }
.kpi-s { font-size: 12px; opacity: .9; }
.kpi.warn { border-color: color-mix(in srgb, #E3C48E 70%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--st-submitted-bg) 38%, var(--surface)), var(--surface)); }
.kpi.warn::after { content: ''; position: absolute; top: 14px; inset-inline-end: 14px; width: 7px; height: 7px; border-radius: 50%; background: #C9A45E; animation: pulseDot 2.4s ease-out infinite; }
@media (hover: hover) {
  .kpi:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(43,35,28,.05), 0 18px 34px -18px rgba(43,35,28,.32); }
  .kpi:hover::before { opacity: 1; }
  .card.req:hover { border-color: var(--warm-line); }
}
@media (min-width: 720px) { .kpis { gap: 12px; } }

/* Period switch: one quiet row, like a segmented control */
.period { flex-wrap: nowrap; gap: 0; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--soft) 65%, var(--surface)); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.period > .ic { margin-inline: 8px 4px; }
.period .chip-btn { border: 0; background: transparent; min-height: 34px; padding: 0 14px; font-size: 13.5px; white-space: nowrap; border-radius: 999px; transition: background .25s ease, color .25s ease, box-shadow .25s ease; }
.period .chip-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(43,35,28,.12), 0 4px 10px -4px rgba(43,35,28,.18); }
@media (max-width: 420px) { .period { width: 100%; } .period .chip-btn { flex: 1; padding: 0 6px; font-size: 13px; } }

/* What needs fixing: two by two on a phone */
@media (max-width: 559px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .svc { min-height: 112px; } }
@media (min-width: 560px) { .svc-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); } }
.svc { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .25s ease; }
@media (hover: hover) { .svc:hover { transform: translateY(-2px); border-color: var(--warm-line); } }

/* The side rail: a sand marker on the page you are on */
@media (min-width: 960px) {
  .side { background: radial-gradient(140% 50% at 0% 0%, rgba(220,198,165,.08), transparent 60%), var(--bar); box-shadow: inset -1px 0 0 rgba(220,198,165,.10); }
  .side .tab { position: relative; border-radius: 12px; transition: background .2s ease, color .2s ease; }
  .side .tab.on::before { content: ''; position: absolute; inset-inline-start: -16px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sand); }
  html[dir=rtl] .side .tab.on::before { border-radius: 3px 0 0 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-i.warn::before, .kpi.warn::after, .hello-clock b.tick { animation: none; }
  .kpi, .svc { transition: none; }
}
/* The phone alerts offer: a light card with a sand edge, so it never competes with the greeting band */
.banner { background: linear-gradient(90deg, color-mix(in srgb, var(--sand) 22%, var(--surface)), var(--surface) 55%); color: var(--ink); border: 1px solid var(--warm-line-2); box-shadow: 0 10px 26px -18px rgba(43,35,28,.35); padding: 12px 10px 12px 14px; }
.banner > .ic { stroke: var(--taupe-ink); width: 20px; height: 20px; padding: 9px; box-sizing: content-box; border-radius: 50%; background: color-mix(in srgb, var(--sand) 45%, var(--surface)); }
.banner b { font-size: 14.5px; }
.banner small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.banner .btn.sand { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.banner .icon-btn { color: var(--muted); }
html[dir=rtl] .banner { background: linear-gradient(270deg, color-mix(in srgb, var(--sand) 22%, var(--surface)), var(--surface) 55%); }
/* Help desk: the Route button sits beside its request on a laptop, under it on a phone */
.route-row { gap: 8px; }
.route-row > .btn { margin-top: 0; }
@media (min-width: 960px) { .route-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; } .route-row > .btn { justify-self: stretch; } }
/* The request's own card: a sand line along the top, the service name in the brand's serif */
.head-card { position: relative; overflow: hidden; }
.head-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--taupe), var(--sand), var(--taupe)); opacity: .85; }
.head-card .hc-title { font-family: var(--serif); font-size: 24px; letter-spacing: .005em; }
.head-card .ref { font-weight: 700; letter-spacing: .04em; color: var(--taupe-ink); }
.steps li.now span:first-child, .steps li.now .st-dot { box-shadow: 0 0 0 5px color-mix(in srgb, var(--sand) 35%, transparent); }

/* ---------- 1.4.2: logo line and Elite Group background ---------- */
/* The E and SERVE sit on one line, like the original logo: the letters' baseline rests on the bottom of the E,
   whichever font the phone loads */
.lockup, .lockup .mark { align-items: baseline; }
.lockup img { display: block; }
.lockup .serve, .lockup .care { line-height: 1; margin: 0; }
/* The wordmark letters come with the app (tiny files holding only S, E, R, V, C, a, r, e), so "SERVE Care"
   is drawn in the brand's Playfair Display on every phone and PC, even when Google Fonts can't load */
@font-face { font-family: 'ES Wordmark'; src: url('/fonts/es-wordmark-800.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: block; }
@font-face { font-family: 'ES Wordmark'; src: url('/fonts/es-wordmark-600i.woff2') format('woff2'); font-weight: 600; font-style: italic; font-display: block; }
.lockup .serve { font-family: 'ES Wordmark', var(--serif); font-weight: 800; }
.lockup .care { font-family: 'ES Wordmark', var(--serif); font-weight: 600; font-style: italic; color: var(--taupe); }
.lockup.xl .care { color: var(--taupe); }

/* Elite Group logo, faded, behind every page; it never takes taps */
.eg-watermark { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none; }
.eg-watermark img { width: min(80vw, 640px); height: auto; opacity: 0; animation: egFade 1.8s ease .4s forwards; }
@keyframes egFade { to { opacity: .07; } }
@media (prefers-reduced-motion: reduce) { .eg-watermark img { animation: none; opacity: .07; } }
@media print { .eg-watermark { display: none; } }

/* The top bar (phones) and the side menu (PC) stay in place while the page scrolls.
   An earlier "position: relative" for their gleam lines had switched this off; sticky keeps the gleam too. */
.bar { position: sticky; }
@media (min-width: 960px) { nav.side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; } }

/* Privacy Policy, Terms of Use, Delete your account */
.legal { line-height: 1.65; }
.legal h2.h3 { font: 700 17px/1.3 var(--serif); margin: 22px 0 6px; color: var(--ink); }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 12px; padding-inline-start: 20px; }
.legal li { margin: 0 0 6px; }
.legal li::marker { color: var(--taupe); }
.agree { font-size: 13px; color: var(--muted); margin: 2px 0 4px; line-height: 1.5; }
.agree .link, .w-legal .link { font-size: inherit; }
.w-legal { display: flex; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: 12.5px; color: rgba(246,241,233,.6); }
.w-legal .link { color: rgba(246,241,233,.78); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.06); }
