/* Sysofina staff portal. Same brand as sysofina.com: pale grey canvas, near-black panels,
   Inter / IBM Plex Sans Arabic, Sysofina teal as the one accent. No inline styles anywhere (the
   Content-Security-Policy allows none); widths of progress bars are set through the CSSOM. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/manrope-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url("/fonts/manrope-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/inter-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/inter-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plex Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/plex-arabic-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Plex Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/plex-arabic-arabic-500.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Plex Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/plex-arabic-arabic-600.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Plex Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/plex-arabic-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}



/* ---------- Tokens ---------- */
:root {
  --canvas: #E4E4E4;
  --card: #F6F6F4;
  --card-2: #EDEDEA;
  --line: #CFCFCB;
  --ink: #1C1C1C;
  --ink-2: #3C3C3C;
  --ink-3: #5A5A5A;
  --dark: #191919;
  --dark-2: #2F2E30;
  --on-dark: #ECEEE4;
  --on-dark-2: #B5B5B5;
  --teal: #2dd4bf;
  --teal-deep: #0d7f74;
  --teal-soft: #c9eee8;
  --amber: #f4c95d;
  --amber-soft: #fbeac0;
  --red: #b42318;
  --red-soft: #fbd9d5;
  --green-soft: #d3f1e2;
  --blue-soft: #dbe7f7;
  --radius: 8px;
  --radius-sm: 4px;
  --font: "Inter", "Plex Arabic", ui-sans-serif, system-ui, sans-serif;
  --font-ar: "Plex Arabic", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mark: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 15px/1.5 var(--font); }
html[lang="ar"] body { font-family: var(--font-ar); font-size: 15.5px; line-height: 1.7; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.noscript { padding: 32px; }
:focus-visible { outline: 2px solid var(--teal-deep); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
bdi { unicode-bidi: isolate; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand .brand-mark { width: 26px; height: 29px; flex: none; }
.brand-name { display: block; line-height: 0; }
.brand-wordmark { display: block; height: 14px; width: auto; }
.brand-tag { font-size: 10.5px; letter-spacing: 0.14em; color: var(--on-dark-2); display: block; margin-top: 4px; font-weight: 500; }

/* ---------- Buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--dark); background: var(--dark); color: var(--on-dark); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #000; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--card-2); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: var(--dark); }
.btn-teal:hover { background: #22c3ae; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--teal-deep); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-big { min-height: 52px; padding: 12px 24px; font-size: 17px; }
label.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, input.input, select.input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #b9b9b4; border-radius: var(--radius-sm); background: #fff; font-weight: 400; font-size: 15px; color: var(--ink); }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal-deep); }
.field .err { color: var(--red); font-weight: 500; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 24px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--dark); color: var(--on-dark); padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--on-dark-2); text-decoration: none; font-weight: 500; border-inline-start: 3px solid transparent; }
.side nav a:hover { background: var(--dark-2); color: var(--on-dark); }
.side nav a[aria-current="page"] { background: var(--dark-2); color: var(--on-dark); border-inline-start-color: var(--teal); }
.side nav .count { margin-inline-start: auto; background: var(--teal); color: var(--dark); border-radius: 9999px; font-size: 12px; font-weight: 700; padding: 0 8px; }
.side .navlabel { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #8c8c8c; padding: 12px 12px 4px; }
html[lang="ar"] .side .navlabel { letter-spacing: 0; }
.side .me { margin-top: auto; border-top: 1px solid #333; padding-top: 16px; display: grid; gap: 8px; font-size: 13px; }
.side .me .who { font-weight: 600; color: var(--on-dark); }
.side .me .role { color: var(--on-dark-2); }
.side .me button, .side .me a { color: var(--on-dark-2); background: none; border: 1px solid #444; border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer; text-align: start; text-decoration: none; }
.side .me button:hover, .side .me a:hover { color: var(--on-dark); border-color: #777; }
.main { padding: 28px 32px 64px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--ink-3); margin-top: 6px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; border: 1px solid #d8d8d3; }
.card.dark { background: var(--dark-2); color: var(--on-dark); border-color: var(--dark-2); }
.card h2 + *, .card h3 + * { margin-top: 12px; }
.topbar { display: none; }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-art { background: var(--dark); color: var(--on-dark); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-art .big { font-size: clamp(36px, 4.4vw, 64px); font-weight: 700; line-height: 0.98; letter-spacing: -0.03em; }
html[lang="ar"] .auth-art .big { letter-spacing: 0; line-height: 1.2; }
.auth-art .big em { font-style: normal; color: var(--teal); }
.auth-art ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--on-dark-2); }
.auth-art li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); margin-inline-end: 10px; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-form form, .auth-form .panel { width: min(420px, 100%); display: grid; gap: 16px; }
.auth-form .hint { font-size: 13px; color: var(--ink-3); }
.qr { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.12em; word-break: break-all; background: #fff; border: 1px dashed var(--line); padding: 8px 10px; border-radius: var(--radius-sm); }
.langswitch { position: fixed; top: 14px; inset-inline-end: 16px; }

/* ---------- Alerts, chips, toasts ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid #e9c25a; }
.alert.error { background: var(--red-soft); border-color: #eaa59e; }
.alert.ok { background: var(--green-soft); border-color: #8fd3b2; }
.alert.info { background: var(--blue-soft); border-color: #a9c3e8; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 9999px; font-size: 12.5px; font-weight: 600; background: var(--card-2); color: var(--ink-2); white-space: nowrap; }
/* Status colours: one hue per status so a list can be read at a glance. Each status sets three
   tokens (soft background, dark text, strong dot) that the chip, the row edge, the dashboard bar
   and the status strip all share. The dot keeps the label readable for colour-blind staff too. */
.s-new { --st-bg: #e9ecf0; --st-ink: #3b4450; --st-dot: #8a94a3; }
.s-in_progress { --st-bg: #dbe7fb; --st-ink: #163d7d; --st-dot: #2f6fdb; }
.s-follow_up { --st-bg: #fdebc6; --st-ink: #6f4300; --st-dot: #e09400; }
.s-complete { --st-bg: #d2f0df; --st-ink: #0e5833; --st-dot: #1f9d58; }
.s-do_not_call { --st-bg: #fbd9d4; --st-ink: #861b11; --st-dot: #d63a2b; }
.s-closed { --st-bg: #e8e0f5; --st-ink: #4a2c78; --st-dot: #7e57c2; }
.chip.st { background: var(--st-bg); color: var(--st-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-dot) 35%, transparent); }
.chip.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-dot); flex: none; }
.chip.overdue { background: var(--red); color: #fff; }
.chip.warn { background: var(--amber-soft); color: #6f4300; }
tbody tr.st-row > td { background: color-mix(in srgb, var(--st-bg) 60%, #fff); }
tbody tr.st-row:hover > td { background: var(--st-bg); }
tbody tr.st-row > td:first-child { border-inline-start: 5px solid var(--st-dot); }
tbody tr.st-row .chip.st { box-shadow: inset 0 0 0 1px var(--st-dot); }
.prop-head[class*=" s-"] { background: color-mix(in srgb, var(--st-bg) 60%, #fff); border-inline-start: 6px solid var(--st-dot); border-radius: var(--radius); padding: 16px 18px; }
.statusrow .bar > span { background: var(--st-dot); }
.barcell .bar > span { background: #1f9d58; }
.barcell .bar.two > span + span { background: #2f6fdb; }
.statusrow > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.statusrow > span:first-child::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--st-dot); flex: none; }
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.status-strip .chip { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; padding: 4px 12px; }
.status-strip .chip .n { font-weight: 500; opacity: .8; }
.status-strip .chip:hover { box-shadow: inset 0 0 0 2px var(--st-dot); }
.status-strip .chip[aria-pressed="true"] { background: var(--st-dot); color: #fff; box-shadow: none; }
.status-strip .chip[aria-pressed="true"]::before { background: #fff; }
.status-strip .chip.all { background: var(--card-2); color: var(--ink-2); }
.status-strip .chip.all[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
.status-strip .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.chip.dark { background: var(--dark); color: var(--on-dark); }
.chip.teal { background: var(--teal); color: var(--dark); }
.lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.lock svg { width: 12px; height: 12px; }
#toast { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--dark); color: var(--on-dark); padding: 12px 18px; border-radius: var(--radius-sm); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
html[dir="rtl"] #toast { transform: translateX(50%); }
#toast.show { opacity: 1; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid #d8d8d3; border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--ink-3); }
.stat .n { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stat .l { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.stat.dark { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.stat.dark .l { color: var(--on-dark-2); }
.stat.warn .n { color: var(--red); }
.bar { height: 8px; background: #d6d6d1; border-radius: 9999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal-deep); border-radius: 9999px; width: 0; }
.bar.two > span + span { background: var(--teal); }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid #d8d8d3; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid #e1e1dc; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; background: var(--card-2); position: sticky; top: 0; }
html[lang="ar"] th { letter-spacing: 0; }
tbody tr:hover { background: #fbfbf9; }
tbody tr.clickable { cursor: pointer; }
td .name { font-weight: 600; }
td .sub { font-size: 12.5px; color: var(--ink-3); }
.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; }
.bulkbar { position: sticky; bottom: 12px; margin-top: 12px; background: var(--dark); color: var(--on-dark); border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bulkbar select { min-height: 36px; border-radius: var(--radius-sm); border: 0; padding: 4px 8px; color: var(--ink); }

/* ---------- Queue ---------- */
.next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--dark); color: var(--on-dark); border-radius: var(--radius); padding: 24px; }
.next .label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
html[lang="ar"] .next .label { letter-spacing: 0; }
.next .title { font-size: 26px; font-weight: 700; margin-top: 6px; }
.next .meta { color: var(--on-dark-2); margin-top: 6px; }

/* ---------- Property profile ---------- */
.prop-head { display: grid; gap: 10px; margin-bottom: 20px; }
.prop-head .titles { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.prop-head .ar { font-family: var(--font-ar); font-size: 20px; color: var(--ink-2); }
.prop-head .facts { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
.prop-head .facts a { font-weight: 600; }
.prop-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.person { background: #fff; border: 1px solid #d8d8d3; border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; align-content: start; }
.person.empty { background: transparent; border-style: dashed; color: var(--ink-3); }
.person .role { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-deep); }
html[lang="ar"] .person .role { letter-spacing: 0; }
.person .pname { font-size: 17px; font-weight: 700; }
.person .ways { display: grid; gap: 2px; font-size: 14px; }
.person .ways a { text-decoration: none; }
.person .ways a:hover { text-decoration: underline; }
.person .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.person.left { opacity: 0.6; }
.agentlist { display: grid; gap: 8px; }
.agentrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; background: #fff; border: 1px solid #e1e1dc; border-radius: var(--radius-sm); font-size: 14px; }
.agentrow > .btn { align-self: start; }
.agentrow .why { font-size: 12.5px; color: var(--ink-3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--teal-deep); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline > li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid #e1e1dc; }
.timeline .ico { width: 36px; height: 36px; border-radius: 9999px; background: var(--card-2); display: grid; place-items: center; font-size: 15px; }
.timeline .ico.call { background: var(--blue-soft); }
.timeline .ico.contact { background: var(--teal-soft); }
.timeline .ico.email { background: #ece3f7; }
.timeline .ico.follow { background: var(--amber-soft); }
.timeline .ico.admin { background: var(--red-soft); }
.timeline .ico.doc { background: #e3eef0; }
.timeline .head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.timeline .what { font-weight: 600; }
.timeline .when { font-size: 12.5px; color: var(--ink-3); }
.timeline .body { margin-top: 4px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; font-size: 14px; margin-top: 4px; }
.timeline .kv dt { color: var(--ink-3); }
.timeline .kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline .voided .what, .timeline .voided .body, .timeline .voided .kv { text-decoration: line-through; color: var(--ink-3); }
.timeline .note { margin-top: 6px; font-size: 13px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--card-2); }
.timeline .note.void { background: var(--red-soft); }
.timeline .note.amend { background: var(--amber-soft); }
.timeline .actions { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.callbox { position: sticky; top: 16px; display: grid; gap: 14px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.callbox .section { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid #dcdcd7; }
.callbox .section:first-of-type { border-top: 0; padding-top: 0; }
.callbox .seclabel { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
html[lang="ar"] .callbox .seclabel { letter-spacing: 0; }
.newcontact { background: #fff; border: 1px solid #d8d8d3; border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 8px; }
.outcomes { display: flex; gap: 6px; flex-wrap: wrap; }
.outcomes label { cursor: pointer; }
.outcomes input { position: absolute; opacity: 0; pointer-events: none; }
.outcomes span { display: inline-block; padding: 6px 12px; border-radius: 9999px; border: 1px solid #b9b9b4; background: #fff; font-size: 13.5px; font-weight: 500; }
.outcomes input:checked + span { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.outcomes input:focus-visible + span { outline: 2px solid var(--teal-deep); outline-offset: 2px; }
.locknote { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-3); }
.locknote svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.followups { display: grid; gap: 8px; }
.fu { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: #fff; border: 1px solid #e1e1dc; }
.fu.overdue { border-color: #eaa59e; background: #fff6f5; }
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(25,25,25,.55); }
dialog form, dialog .dlg { padding: 24px; display: grid; gap: 14px; }
.once { background: #fff; border: 2px solid var(--teal-deep); border-radius: var(--radius-sm); padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; word-break: break-all; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.kvlist { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.kvlist dt { color: var(--ink-3); }
.kvlist dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- Screen details ---------- */
.main > * + * { margin-top: 20px; }
.main > .page-head + * { margin-top: 0; }
.main > .count-line { margin-top: 8px; }
.main > .filters + .count-line { margin-top: 0; }
.main > .count-line + .tablewrap { margin-top: 8px; }
.brand-wrap .brand-tag { color: var(--on-dark-2); }
.side .brand, .topbar .brand { color: var(--on-dark); }
.btn.on-dark { color: var(--on-dark); border-color: #555; }
.btn.on-dark:hover { background: var(--dark-2); }
.next .row { margin-top: 10px; }
.next > .row { margin-top: 0; justify-content: flex-end; }
.grouprow th { background: var(--card-2); color: var(--ink); font-size: 12px; position: static; }
.chip-btn { border: 1px solid transparent; cursor: pointer; }
.chip-btn.chip-on { background: var(--dark); color: var(--on-dark); }
.input-small { min-height: 32px !important; padding: 4px 8px !important; width: auto !important; font-size: 13px !important; }
select.input, input.input { width: auto; max-width: 100%; }
.filters .input { width: 100%; }
.corr-panel { display: grid; gap: 12px; margin-bottom: 20px; }
.corr-panel .card { background: #fff; }
.corr { display: grid; gap: 8px; }
details > summary { cursor: pointer; }
.agentbox { background: var(--card); border: 1px solid #d8d8d3; border-radius: var(--radius); padding: 12px 14px; }
.agentbox[open] > summary { margin-bottom: 8px; }
.agentbox .agentlist { margin-top: 10px; }
.statusbars { display: grid; gap: 10px; }
.statusrow { display: grid; grid-template-columns: 160px minmax(0, 1fr) 70px; gap: 12px; align-items: center; text-decoration: none; color: inherit; font-size: 14px; }
.statusrow:hover span:first-child { text-decoration: underline; }
.barcell { min-width: 160px; vertical-align: middle; }
.warn-text { color: var(--red); font-weight: 700; }
.warn-row td { background: #fff6f5; }
.muted-row td { color: var(--ink-3); }
.codeblock { white-space: pre-wrap; word-break: break-all; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin: 0; }
fieldset.newcontact { margin: 0; min-width: 0; }
fieldset.newcontact legend { padding: 0 4px; width: 100%; }
.tl-filters { gap: 6px; }
progress { width: 100%; height: 8px; accent-color: var(--teal-deep); }
.prop-grid > *, .stack-lg > *, .stack > * { min-width: 0; }
.fu .chip { vertical-align: middle; }
.staff-table td { vertical-align: middle; }
.dash-status .bar { height: 10px; }
.auth-art a { color: var(--on-dark-2); }
.auth-art a:hover { color: var(--on-dark); }
[hidden] { display: none !important; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 1100px) {
  .prop-grid { grid-template-columns: minmax(0, 1fr); }
  .callbox { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  html[dir="rtl"] .side { transform: translateX(100%); }
  .shell.open .side { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--dark); color: var(--on-dark); padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .topbar button { background: none; border: 1px solid #555; color: var(--on-dark); border-radius: var(--radius-sm); padding: 6px 10px; }
  .main { padding: 20px 16px 48px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 28px 16px; }
  .auth-art ul { display: none; }
  .people, .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .next { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters > :first-child { grid-column: 1 / -1; }
  .statusrow { grid-template-columns: 110px minmax(0, 1fr) 50px; }
  .next > .row { justify-content: stretch; }
  .next > .row .btn { flex: 1; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .side, .topbar, .callbox, .tabs, .actions { display: none !important; } .shell { display: block; } }
.staff-settings select.input { max-width: 360px; }
