/* String Workforce — identity aligned with stringsystems.net (Figtree + IBM Plex Sans Arabic, #FF2D20 accent).
   Dark theme is the default; [data-theme="light"] switches to the light palette. Layout uses logical properties so RTL/LTR both work. */
:root {
  --accent: rgba(220, 58, 46, 0.5);
  --accent-solid: #dc3a2e;
  --accent-soft: rgba(220, 58, 46, 0.12);
  --accent-dark: rgba(220, 58, 46, 0.85);
  --btn: #e5e7eb;
  --btn-text: #111827;
  --btn-hover: #ffffff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #93c5fd;
  --bg: #0b0d12;
  --bg-2: #12151c;
  --card: #171b24;
  --border: #262c3a;
  --border-strong: #343c4e;
  --text: #e5e7eb;
  --text-strong: #ffffff;
  --muted: rgba(229, 231, 235, 0.6);
  --input-bg: #0f1218;
  --radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.45), 0 2px 4px -2px rgba(0,0,0,.4);
  --sidebar-w: 240px;
  --badge-ok-bg: rgba(74, 222, 128, .15);
  --badge-warn-bg: rgba(251, 191, 36, .15);
  --badge-danger-bg: rgba(248, 113, 113, .18);
  --badge-info-bg: rgba(147, 197, 253, .15);
  color-scheme: dark;
}
[data-theme="light"] {
  --accent-dark: rgba(220, 58, 46, 0.85);
  --btn: #1f2937;
  --btn-text: #ffffff;
  --btn-hover: #374151;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --info: #1d4ed8;
  --bg: #f9fafb;
  --bg-2: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-strong: #000000;
  --muted: rgba(0, 0, 0, 0.55);
  --input-bg: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --badge-ok-bg: #dcfce7;
  --badge-warn-bg: #ffedd5;
  --badge-danger-bg: #fee2e2;
  --badge-info-bg: #dbeafe;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Figtree, "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: "IBM Plex Sans Arabic", Figtree, "Segoe UI", Tahoma, system-ui, sans-serif; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
code { background: var(--bg-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; direction: ltr; unicode-bidi: embed; }
h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 1rem; color: var(--text-strong); }
h2 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: var(--text-strong); }
h3 { font-size: 1.05rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.inline { display: inline; }
.ltr { direction: ltr; unicode-bidi: embed; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.grow { flex: 1 1 auto; }
.right { text-align: end; }
hr { border: 0; border-top: 1px solid var(--border); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.1rem; color: var(--text-strong); line-height: 1.15; }
.brand:hover { color: var(--text-strong); }
.brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.brand small { display: block; font-size: 0.68rem; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.brand-lg { flex-direction: column; text-align: center; gap: 0.5rem; margin: 0 auto 1.25rem; font-size: 1.35rem; }
.brand-lg svg { width: 56px; height: 56px; }

/* ---------- top bar / shell ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--bg-2); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.lang-switch a { padding: 0.3rem 0.6rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.lang-switch a.active { background: var(--accent); color: #fff; }
.lang-switch a:hover:not(.active) { background: var(--bg-2); color: var(--text); }
.impersonation-banner {
  background: var(--accent); color: #fff; padding: 0.5rem 1.25rem; text-align: center; font-size: 0.95rem;
  display: flex; gap: 0.75rem; align-items: center; justify-content: center;
}
.shell { display: flex; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-inline-end: 1px solid var(--border);
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar a { padding: 0.5rem 1.25rem; color: var(--text); display: block; border-inline-start: 3px solid transparent; }
.sidebar a:hover { background: var(--bg-2); color: var(--text-strong); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 400; border-inline-start-color: var(--accent); }
.sidebar a.highlight { color: var(--accent); font-weight: 400; }
.sidebar .nav-group { padding: 0.9rem 1.25rem 0.25rem; font-size: 0.72rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.08em; }
.company-box { padding: 0 1.25rem 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.company-name { font-weight: 600; color: var(--text-strong); }
.content { flex: 1; padding: 1.5rem; max-width: 1400px; width: 100%; margin: 0 auto; min-width: 0; }
.footer { text-align: center; padding: 1rem; }

/* ---------- cards / tables ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-title { font-weight: 600; margin-bottom: 0.75rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; color: var(--text-strong); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.stat .value { font-size: 1.8rem; font-weight: 600; color: var(--text-strong); }
.stat .label { color: var(--muted); font-size: 0.9rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: middle; }
th { background: var(--bg-2); font-weight: 600; font-size: 0.8rem; white-space: nowrap; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: var(--bg-2); }
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* ---------- forms ---------- */
form.stack > * + * { margin-top: 0.9rem; }
label { display: block; font-weight: 500; margin-bottom: 0.3rem; font-size: 0.9rem; color: var(--text); }
label.check { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; color: var(--text);
  background: var(--input-bg); box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
input:disabled { opacity: .6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; }
.field-hint { color: var(--muted); font-size: 0.82rem; margin-top: 0.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; }
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters label { margin-bottom: 0.2rem; }
.filters > div { min-width: 160px; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.2rem; }
.validation-summary-errors { color: var(--danger); background: var(--badge-danger-bg); border: 1px solid var(--danger); border-radius: 6px; padding: 0.6rem 0.9rem; }
.validation-summary-valid { display: none; }
.field-validation-error { color: var(--danger); font-size: 0.85rem; }

/* ---------- buttons / badges / alerts ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.55rem 1.1rem; border-radius: 6px; border: 1px solid transparent; font: inherit;
  font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer;
  background: var(--btn); color: var(--btn-text); text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.btn:hover { background: var(--btn-hover); color: var(--btn-text); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-2); color: var(--text-strong); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-ok { background: #15803d; color: #fff; }
.btn-ok:hover { background: #166534; color: #fff; }
.btn-warn { background: #b45309; color: #fff; }
.btn-warn:hover { background: #92400e; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text-strong); }
.btn-light { background: #fff; color: var(--accent); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.72rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 0.9rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); }
.badge-ok { background: var(--badge-ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--badge-warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--badge-danger-bg); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--badge-info-bg); color: var(--info); border-color: transparent; }
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--badge-ok-bg); border-color: var(--ok); color: var(--ok); }
.alert-error { background: var(--badge-danger-bg); border-color: var(--danger); color: var(--danger); }
.alert-warn { background: var(--badge-warn-bg); border-color: var(--warn); color: var(--warn); }
.alert-info { background: var(--badge-info-bg); border-color: var(--info); color: var(--info); }
.alert a { color: inherit; text-decoration: underline; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.auth-card { max-width: 440px; margin: 1rem auto 2rem; padding: 1.5rem; }
.auth-card h1 { text-align: center; font-size: 1.25rem; }
.auth-page { min-height: calc(100vh - 60px); display: flex; flex-direction: column; justify-content: center; padding-top: 2rem; }
details summary { cursor: pointer; font-weight: 600; }
.pager { display: flex; gap: 0.5rem; align-items: center; margin-top: 1rem; }
.photo-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.temp-pass { font-family: Consolas, monospace; font-size: 1.2rem; background: var(--badge-warn-bg); border: 1px dashed var(--accent); padding: 0.5rem 1rem; border-radius: 6px; direction: ltr; display: inline-block; color: var(--text-strong); }

/* ---------- landing (stringsystems.net welcome layout) ---------- */
.landing { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.landing-hero { text-align: center; margin-bottom: 2.5rem; }
.landing-hero h1 { font-size: 2rem; font-weight: 600; margin-bottom: 0.5rem; }
.landing-hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.tile {
  display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border); color: var(--text);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.tile:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.tile .icon { width: 48px; height: 48px; border-radius: 999px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.tile .icon svg { width: 26px; height: 26px; fill: var(--accent); }
.tile h2 { margin: 0; font-size: 1.15rem; }
.tile p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.tile .go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* ---------- employee (mobile-first) ---------- */
.employee-body { background: var(--bg); }
.content-employee { max-width: 560px; margin: 0 auto; padding: 1rem; padding-bottom: 1.5rem; }
.tabbar {
  position: fixed; bottom: 0; inset-inline: 0; background: var(--card); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; z-index: 20; min-height: 60px; padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* the fixed tab bar must not cover the end of the page: the footer keeps clear of it (plus the phone's home-indicator area) */
.with-tabbar .footer { padding-bottom: calc(1.25rem + 60px + env(safe-area-inset-bottom, 0px)); }
.tabbar a { flex: 1; text-align: center; padding: 0.7rem 0.2rem; color: var(--muted); font-size: 0.8rem; border-top: 3px solid transparent; }
.tabbar a.active { color: var(--accent); font-weight: 600; border-top-color: var(--accent); }
.clock-state { text-align: center; padding: 1rem 0; }
.clock-state .time { font-size: 2.6rem; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; direction: ltr; }
.clock-state .status { font-size: 1.05rem; margin-top: 0.25rem; }
.clock-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; }
.clock-buttons .btn { padding: 1.1rem 0.5rem; font-size: 0.95rem; }
.clock-buttons .full { grid-column: 1 / -1; }
.camera-box { margin-top: 1rem; }
.camera-box img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.geo-line { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; text-align: center; }
.watermark {
  position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0.07; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3rem; padding: 2rem; font-size: 1.1rem; transform: rotate(-20deg);
}
.privacy-blur { filter: blur(14px); }
.day-list { list-style: none; margin: 0; padding: 0; }
.day-list li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.6rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.day-list .meta { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; border-inline-end: 0; border-bottom: 1px solid var(--border); padding: 0.5rem; gap: 0.25rem; }
  .sidebar a { padding: 0.4rem 0.7rem; border-radius: 6px; border-inline-start: 0; }
  .sidebar .nav-group, .company-box { display: none; }
  .content { padding: 1rem; }
  th, td { padding: 0.45rem 0.5rem; font-size: 0.9rem; }
  .topbar .muted { display: none; }
}
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --border: #ccc; }
  .topbar, .sidebar, .footer, .tabbar, .filters, .actions, .btn { display: none !important; }
  .content { padding: 0; }
}

/* ---------- shared footer / landing hero / theme icon ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 0.6rem; padding: 1.25rem 1rem; border-top: 1px solid var(--border); margin-top: auto; }
.footer a { color: var(--accent); }
.top-nav { display: flex; gap: 0.25rem; }
.top-nav a { padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.9rem; }
.top-nav a:hover { background: var(--bg-2); }
.landing { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; width: 100%; text-align: center; }
.landing-hero { margin-bottom: 2.5rem; }
.hero-logo svg { width: 96px; height: 96px; display: block; margin: 0 auto 0.75rem; }
.hero-sub { color: var(--muted); font-weight: 500; letter-spacing: 0.04em; margin-bottom: 1rem; }
.tiles { justify-items: stretch; text-align: start; }
.tile h2 { text-align: start; }
.theme-btn svg { width: 20px; height: 20px; }
.icon-moon { fill: #fbbf24; }
.icon-sun { fill: #f59e0b; color: #f59e0b; }
.icon-auto { fill: currentColor; }
[data-theme="light"] .icon-moon { fill: #4b5563; }
.cert-box { text-align: center; }
@media (max-width: 600px) {
  .topbar { padding: 0 0.75rem; }
  .top-nav { display: none; }
  .brand span { font-size: 0.95rem; }
  .hero-logo svg { width: 72px; height: 72px; }
  .landing-hero h1 { font-size: 1.6rem; }
  .content { padding: 0.75rem; }
  .card { padding: 1rem; }
}
@media (min-width: 601px) and (max-width: 1024px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

/* theme button shows exactly one icon depending on the chosen mode */
.theme-btn svg { display: none; width: 20px; height: 20px; }
.theme-btn[data-mode="dark"] .icon-moon, .theme-btn[data-mode="light"] .icon-sun, .theme-btn[data-mode="auto"] .icon-auto { display: block; }
.theme-btn { background: var(--bg-2); }
.theme-btn[data-mode="light"] { background: #fff7e6; border-color: #f59e0b; }
.theme-btn[data-mode="dark"] { background: #1e2433; border-color: #fbbf24; }
[data-theme="light"] .theme-btn[data-mode="dark"] { background: #e5e7eb; border-color: #4b5563; }
.user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* fixed LTR layout for every language; Arabic text itself still renders right-to-left inside its boxes */
html[lang="ar"] .content, html[lang="ar"] .landing, html[lang="ar"] .card, html[lang="ar"] .sidebar a, html[lang="ar"] .tile, html[lang="ar"] .day-list li, html[lang="ar"] .alert, html[lang="ar"] td, html[lang="ar"] th, html[lang="ar"] label, html[lang="ar"] p, html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { unicode-bidi: plaintext; }

/* brand bar under the header (logo lives here, not in the header) */
.brand-bar { display: flex; justify-content: center; padding: 1.25rem 1rem 0.75rem; }
.brand-bar .brand-lg { margin-bottom: 0; }
.topbar-left { flex: 1; display: flex; align-items: center; min-width: 0; }
.topbar-left .brand { font-size: 1rem; }
.topbar-left .brand svg { width: 28px; height: 28px; }
.topbar { max-width: 100%; }
.topbar-inner { width: 100%; max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
details > summary { list-style: none; cursor: pointer; display: inline-flex; }
details > summary::-webkit-details-marker { display: none; }
@media (max-width: 600px) { .topbar-left .brand small { display: none; } }
.auth-page { padding-top: 0.5rem; min-height: auto; }
.footer { flex-direction: column; gap: 0.15rem; line-height: 1.5; }
@media (max-width: 600px) { .brand-bar .brand-lg svg { width: 44px; height: 44px; } .brand-bar .brand-lg { font-size: 1.1rem; } }

/* no horizontal page scroll on phones: flex children may shrink, tables scroll inside their wrapper */
.row > *, .grow, .stats > *, .grid-3 > * { min-width: 0; }
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.card { max-width: 100%; box-sizing: border-box; }
@media (max-width: 600px) { .row { flex-direction: column; } .row > .card { width: 100%; } }

/* install-app buttons (shown only when the browser offers installation) */
.install-btn { white-space: nowrap; }
@media (max-width: 600px) { .topbar .install-btn { display: none; } }

/* password eye */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-inline-end: 2.6rem; width: 100%; box-sizing: border-box; }
.pw-eye { position: absolute; top: 50%; inset-inline-end: 0.35rem; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0; }
.pw-eye:hover { color: var(--text-strong); background: var(--bg-2); }
.pw-eye svg { width: 20px; height: 20px; fill: currentColor; }
.pw-eye .eye-closed, .pw-visible .pw-eye .eye-open { display: none; }
.pw-visible .pw-eye .eye-closed { display: block; }

/* Arabic reads bolder on desktop screens */
@media (min-width: 861px) {
  html[lang="ar"] body { font-weight: 500; }
  html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] strong, html[lang="ar"] .card-title, html[lang="ar"] th { font-weight: 700; }
  html[lang="ar"] .btn, html[lang="ar"] label, html[lang="ar"] .top-nav a { font-weight: 600; }
  html[lang="ar"] .sidebar a { font-weight: 400; }
}

/* sidebar meets the header; on phones the menu becomes an orderly grid of buttons */
.sidebar { padding-top: 0.75rem; }
.content > .brand-bar { padding-top: 0.5rem; }
@media (max-width: 860px) {
  .sidebar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; padding: 0.6rem; }
  .sidebar a { text-align: center; padding: 0.55rem 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); font-size: 0.9rem; border-inline-start: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar a.active { border-color: var(--accent); }
  .sidebar .nav-group, .sidebar .company-box, .sidebar form { display: none; }
}
@media (max-width: 600px) {
  .sidebar { grid-template-columns: repeat(2, 1fr); }
}

/* menu flush with the left edge on desktop; header spans the full width to match; content stays centered */
.shell { max-width: none; margin: 0; }
.topbar-inner { max-width: none; }
.content { max-width: 1400px; margin: 0 auto; }
@media (max-width: 860px) {
}

/* footer link: calmer red at 50% opacity */
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { color: var(--accent-dark); }

/* ================= icons ================= */
.ic { width: 1.15em; height: 1.15em; fill: currentColor; flex-shrink: 0; vertical-align: -0.2em; margin-inline-end: 0.45em; opacity: 0.9; }
.sidebar a { display: flex; align-items: center; }
.card-title .ic { color: var(--accent-solid, #dc3a2e); }
.tabbar a .ic { display: block; margin: 0 auto 2px; width: 1.4em; height: 1.4em; }
@media (max-width: 860px) { .sidebar a { justify-content: center; } }

/* ================= live dashboard ================= */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.tile-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 0.9rem 1rem; border-radius: 16px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer; text-align: start; font: inherit; position: relative; overflow: hidden; transition: transform .12s ease, border-color .12s ease; }
.tile-stat:hover { transform: translateY(-2px); }
.tile-stat.selected { border-color: var(--tone, var(--accent-solid, #dc3a2e)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone, #dc3a2e) 35%, transparent); }
.tile-stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--tone, var(--border)); }
.tile-stat .ic { position: absolute; inset-inline-end: 0.8rem; top: 0.8rem; width: 1.6rem; height: 1.6rem; margin: 0; color: var(--tone, var(--muted)); opacity: 0.85; }
.tile-stat .num { font-size: 1.9rem; font-weight: 600; color: var(--text-strong); line-height: 1.1; }
.tile-stat .num small { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-inline-start: 0.25rem; }
.tile-stat .lbl { font-size: 0.85rem; color: var(--muted); }
.t-in { --tone: #22c55e; } .t-break { --tone: #f59e0b; } .t-left { --tone: #3b82f6; } .t-late { --tone: #f97316; } .t-early { --tone: #eab308; }
.t-absent { --tone: #ef4444; } .t-notyet { --tone: #94a3b8; } .t-leave { --tone: #8b5cf6; } .t-off { --tone: #64748b; }
.dash-pending { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 0.88rem; }
.pill b { color: var(--text-strong); }
a.pill:hover { border-color: var(--accent-solid, #dc3a2e); color: var(--text-strong); }
.dash-groups tr.clickable { cursor: pointer; } .dash-groups tr.clickable:hover td { background: var(--bg-2); }
.dash-groups tr.selected td { background: var(--accent-soft); }
td.ok { color: #22c55e; font-weight: 600; } td.warn { color: #f59e0b; } td.bad { color: #ef4444; font-weight: 600; }
.bar { display: inline-block; width: 70px; height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; vertical-align: middle; margin-inline-end: 0.4rem; }
.bar i { display: block; height: 100%; background: #22c55e; border-radius: 999px; }
.chips { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; margin-inline-start: 0.5rem; }
.chip { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--accent-soft); color: var(--text-strong); }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; margin-inline-start: 0.5rem; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: livepulse 2s infinite; }
.live-dot.stale { background: #f59e0b; animation: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

/* ================= reports / profile ================= */
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }
.tab { padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-size: 0.9rem; }
.tab.active { background: var(--accent-soft); border-color: var(--accent-solid, #dc3a2e); color: var(--text-strong); font-weight: 600; }
table.kv { width: 100%; } table.kv th { width: 40%; text-align: start; color: var(--muted); font-weight: 500; padding: 0.3rem 0.5rem 0.3rem 0; vertical-align: top; border: 0; }
table.kv td { padding: 0.3rem 0; border: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; }
.gallery figure { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.gallery figcaption { padding: 0.3rem 0.4rem; font-size: 0.75rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.map { height: 300px; border-radius: 14px; border: 1px solid var(--border); margin-top: 0.6rem; overflow: hidden; z-index: 0; }
.map.map-sm { height: 220px; }
.temp-pass { font-family: ui-monospace, Consolas, monospace; font-weight: 600; }

/* ================= liquid glass (translucent, blurred surfaces; palette unchanged) ================= */
body {
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(220, 58, 46, 0.13), transparent 60%),
    radial-gradient(800px 480px at 105% 8%, rgba(80, 120, 255, 0.10), transparent 60%),
    radial-gradient(700px 500px at 50% 115%, rgba(220, 58, 46, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.card, .stat, .tile, .tile-stat, .pill, .auth-card, .gallery figure {
  background: color-mix(in srgb, var(--card) 58%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid color-mix(in srgb, var(--text-strong) 13%, transparent);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.16), inset 0 1px 0 color-mix(in srgb, #ffffff 16%, transparent);
  border-radius: 20px;
}
.card .card { box-shadow: none; }
.topbar, .sidebar, .tabbar {
  background: color-mix(in srgb, var(--card) 52%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border-color: color-mix(in srgb, var(--text-strong) 10%, transparent);
}
.btn { border-radius: 13px; box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 22%, transparent), 0 2px 10px rgba(0, 0, 0, 0.10); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn-secondary, .btn-ghost, .icon-btn { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
input, select, textarea { border-radius: 12px; background: color-mix(in srgb, var(--bg-2) 62%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.badge, .tab, .chip { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.alert { border-radius: 16px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sidebar a { border-radius: 12px; margin: 1px 8px; border-inline-start-width: 0; }
.sidebar a.active { box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 14%, transparent); }
[data-theme="light"] .card, [data-theme="light"] .stat, [data-theme="light"] .tile, [data-theme="light"] .tile-stat, [data-theme="light"] .pill, [data-theme="light"] .auth-card {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.08);
}
@media (prefers-reduced-transparency: reduce) {
  .card, .stat, .tile, .tile-stat, .pill, .auth-card, .topbar, .sidebar, .tabbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--card); }
}

/* ================= co-brand: platform logo and the company's own logo in one glass capsule ================= */
.cobrand {
  display: inline-flex; align-items: center; gap: 1rem; max-width: 100%; box-sizing: border-box;
  padding: 0.6rem 1.15rem; border-radius: 24px; position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--card) 48%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(185%); backdrop-filter: blur(24px) saturate(185%);
  border: 1px solid color-mix(in srgb, var(--text-strong) 14%, transparent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), inset 0 1px 0 color-mix(in srgb, #ffffff 22%, transparent), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
/* soft light sweep across the top of the glass */
.cobrand::before { content: ""; position: absolute; inset: 0 0 55% 0; pointer-events: none; background: linear-gradient(to bottom, color-mix(in srgb, #ffffff 10%, transparent), transparent); }
.cobrand > * { position: relative; }
.cobrand .brand { margin: 0; min-width: 0; flex-shrink: 0; }
.cobrand-sep { width: 1px; align-self: stretch; margin: 0.1rem 0; flex-shrink: 0; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--text-strong) 32%, transparent), transparent); }
.cobrand-company { display: inline-flex; align-items: center; gap: 0.65rem; min-width: 0; color: var(--text-strong); font-weight: 600; text-decoration: none; }
a.cobrand-company:hover { color: var(--text-strong); }
.cobrand-logo {
  height: 44px; min-width: 44px; max-width: 136px; object-fit: contain; flex-shrink: 0; box-sizing: border-box;
  padding: 4px; border-radius: 13px; background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.cobrand-mono { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0; font-size: 1.2rem; font-weight: 700; color: var(--accent-solid); background: color-mix(in srgb, var(--bg-2) 72%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-strong) 12%, transparent); }
.cobrand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; unicode-bidi: plaintext; }
[data-theme="light"] .cobrand { box-shadow: 0 10px 30px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.8); border-color: rgba(15, 23, 42, 0.08); }
@media (max-width: 600px) {
  .cobrand { gap: 0.6rem; padding: 0.5rem 0.75rem; border-radius: 20px; }
  .cobrand .brand { gap: 0.45rem; }
  .cobrand .brand svg { width: 28px; height: 28px; }
  .cobrand .brand span { font-size: 0.88rem; }
  .cobrand .brand small { display: none; }
  .cobrand-logo { height: 36px; min-width: 36px; max-width: 92px; border-radius: 11px; }
  .cobrand-mono { width: 36px; font-size: 1rem; }
  .cobrand-name { max-width: 104px; font-size: 0.88rem; }
}
@media (max-width: 360px) { .cobrand-name { display: none; } }
@media (prefers-reduced-transparency: reduce) { .cobrand { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--card); } }
/* company logo in the admin sidebar */
/* phones: the header keeps only the glyph (the name sits in the bar below); tab labels stay on one line */
@media (max-width: 600px) {
  .topbar-left .brand > span { display: none; }
  .tabbar a { min-width: 0; padding: 0.55rem 0.1rem; font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* admin users: inline edit form of the account holder */
td form.inline, td details.inline { margin: 2px; }

/* notifications: unread / read / handled */
.notif-head { margin-bottom: 0.75rem; }
.notif-list li { padding: 0; }
.notif-item { display: block; padding: 0.7rem 0.9rem; color: inherit; text-decoration: none; border-radius: 12px; }
.notif-item:hover { background: color-mix(in srgb, var(--text-strong) 6%, transparent); color: inherit; }
.notif-unread strong { font-weight: 700; color: var(--text-strong); }
.notif-read strong { font-weight: 500; }
.notif-read .meta { opacity: 0.8; }
.notif-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-solid); margin-inline-end: 0.45rem; vertical-align: middle; }
.notif-state { margin-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.notif-detail { border-color: color-mix(in srgb, var(--accent-solid) 45%, transparent); }
.count-badge { display: inline-block; min-width: 1.25rem; padding: 0 0.35rem; margin-inline-start: 0.3rem; border-radius: 999px; background: var(--accent-solid); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1.25rem; text-align: center; }
.chip { display: inline-block; padding: 0.1rem 0.5rem; margin: 0.1rem; border-radius: 999px; border: 1px solid var(--border); }

/* setup wizard: one slide per step */
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.6rem; padding: 0; }
.wizard-steps li { flex: 1 1 110px; }
.wizard-steps button { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; font: inherit; text-align: start; }
.wizard-steps .num { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); font-weight: 600; font-size: 0.85rem; }
.wizard-steps .lbl { font-size: 0.85rem; line-height: 1.2; }
.wizard-steps li.done .num { background: var(--badge-ok-bg); color: var(--ok); border-color: transparent; }
.wizard-steps li.current button { border-color: var(--accent-solid); color: var(--text-strong); }
.wizard-steps li.current .num { background: var(--accent-solid); color: #fff; border-color: transparent; }
.wizard-progress { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; margin-bottom: 1rem; }
.wizard-progress .bar { height: 100%; width: 0; background: var(--accent-solid); transition: width 0.3s ease; }
.wizard-slide { overflow: hidden; }
.wizard-slide.from-next { animation: wizard-in-next 0.3s ease; }
.wizard-slide.from-back { animation: wizard-in-back 0.3s ease; }
@keyframes wizard-in-next { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes wizard-in-back { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wizard-slide.from-next, .wizard-slide.from-back { animation: none; } }
.wizard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.wizard-head h2 { margin: 0 0 0.25rem; }
.wizard-frame { width: 100%; height: calc(100vh - 360px); min-height: 440px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; }
.wizard [hidden] { display: none !important; }
@media (max-width: 700px) { .wizard-steps .lbl { display: none; } .wizard-steps li { flex: 1 1 0; } .wizard-steps button { justify-content: center; padding: 0.4rem; } .wizard-frame { height: calc(100vh - 300px); } }
/* a page shown inside the wizard: only its content */
html.embedded .topbar, html.embedded .sidebar, html.embedded .footer, html.embedded .brand-bar, html.embedded .impersonation-banner { display: none !important; }
html.embedded body { min-height: 0; }
html.embedded .content { padding: 0.75rem; }
.notif-item { flex: 1; }

/* policies: the platform's terms page, and a company's own policy text as typed */
.policy-page h2 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
.policy-page p { line-height: 1.9; }
.policy-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; padding: 0.9rem 1rem; margin: 0.5rem 0 0.75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--input-bg); max-height: 60vh; overflow-y: auto; unicode-bidi: plaintext; }

/* kept from the 1.3.0 interface: the dashboard and the onboarding-style setup wizard */
:root { --topbar-h: 60px; }
/* ================= onboarding (setup wizard): checklist panel + step content ================= */
.onboarding { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ob-panel { padding: 1rem 0 0.5rem; position: sticky; top: calc(var(--topbar-h) + 1rem); }
.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0 1rem 0.9rem; border-bottom: 1px solid var(--border); }
.ob-title { font-weight: 800; color: var(--text-strong); font-size: 0.95rem; line-height: 1.25; }
.ob-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: 0.95rem; color: var(--text-strong);
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-2) 0); }
.ob-ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.ob-steps { display: block; margin: 0; padding: 0; }
.ob-steps li { flex: none; border-bottom: 1px solid var(--border); }
.ob-steps li:last-child { border-bottom: 0; }
.ob-steps button { width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border: 0; border-inline-start: 3px solid transparent; border-radius: 0; background: transparent; color: var(--text); cursor: pointer; font: inherit; text-align: start; }
.ob-steps button:hover { background: var(--bg-2); }
.ob-steps li.current button { border-inline-start-color: var(--accent); background: var(--bg-2); }
.ob-steps .ob-mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; display: grid; place-items: center; font-size: 0.85rem; color: var(--muted); }
.ob-steps li.done .ob-mark { border-color: #22c55e; color: #22c55e; background: #f0fdf4; }
.ob-steps li.done .ob-mark::before { content: "\2713"; font-weight: 800; }
.ob-steps li.current:not(.done) .ob-mark { border-color: var(--accent); color: var(--accent); }
.ob-steps li.current:not(.done) .ob-mark::before { content: "\25CF"; font-size: 0.7rem; }
.ob-steps .ob-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ob-steps .lbl { font-weight: 700; color: var(--text-strong); font-size: 0.9rem; }
.ob-steps .ob-min { font-size: 0.75rem; color: var(--muted); }
.ob-steps .ob-chev { color: var(--muted); font-size: 1.2rem; }
.ob-steps li.done .ob-chev { visibility: hidden; }
.ob-help { display: block; padding: 0.8rem 1rem 0.4rem; color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.ob-main .wizard-slide { padding: 1.25rem; }
.ob-main .wizard-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 1.3rem; margin: 0 0 0.35rem; }
.ob-takes { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.1rem 0.55rem; }
.ob-main .wizard-nav { justify-content: space-between; }
.wizard-progress { margin-bottom: 1rem; }
@media (max-width: 900px) {
  .onboarding { grid-template-columns: 1fr; }
  .ob-panel { position: static; }
  .ob-steps { display: block; }
  .ob-steps .lbl { display: inline; }
}

/* ================= dashboard: main column + "who's in" panel ================= */
.dash-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.dash-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem; }
.dash-hello h2 { margin: 0 0 0.3rem; font-size: 1.35rem; }
.dash-hello p { margin: 0 0 0.9rem; }
.dash-pending { margin-bottom: 0; }
.dash-tiles { margin-bottom: 0; }
.whos { position: sticky; top: calc(var(--topbar-h) + 1rem); padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; max-height: calc(100vh - var(--topbar-h) - 2rem); }
.whos-head { text-align: center; }
.whos-title { font-weight: 800; color: var(--text-strong); }
.whos-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.whos-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0.4rem 0; font: inherit; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.whos-tabs button b { font-size: 1.1rem; color: var(--text-strong); }
.whos-tabs button span { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.whos-tabs button.active { border-bottom-color: var(--accent); color: var(--accent); }
.whos-tabs button.active b { color: var(--accent); }
.whos-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 60px; flex: 1; }
.whos-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); background: transparent; border-radius: 0; box-shadow: none; margin: 0; }
.whos-list li:last-child { border-bottom: 0; }
.whos-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.whos-who a { font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whos-when { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.whos-clock { text-align: center; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.whos-time { font-size: 1.6rem; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .dash-layout { grid-template-columns: 1fr; } .whos { position: static; max-height: none; } .dash-top { grid-template-columns: 1fr; } }

/* leave balances (employee tiles) and the team leave calendar */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; margin-bottom: 0.75rem; }
.balance-tile { border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem 0.75rem; background: var(--bg-2); }
.balance-tile .num { font-size: 1.5rem; font-weight: 700; color: var(--text-strong); line-height: 1.1; }
.balance-tile .lbl { font-weight: 600; }
.leave-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.leave-cal .cal-head { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--muted); padding: 0.25rem 0; }
.leave-cal .cal-day { min-height: 72px; border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.4rem; background: var(--card); font-size: 0.78rem; overflow: hidden; }
.leave-cal .cal-day.empty { border: 0; background: transparent; }
.leave-cal .cal-day.off { background: var(--bg-2); }
.leave-cal .cal-day.holiday { background: var(--badge-ok-bg, #ecfdf5); }
.leave-cal .cal-day.today { border-color: var(--accent-solid, #dc3a2e); }
.leave-cal .cal-num { font-weight: 700; color: var(--text-strong); }
.leave-cal .cal-holiday { color: var(--ok, #16a34a); font-weight: 600; }
.leave-cal .cal-chip { display: block; margin-top: 2px; padding: 1px 5px; border-radius: 6px; background: var(--accent-soft, rgba(220,58,46,0.12)); color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-danger { color: var(--danger, #dc2626); }
@media (max-width: 700px) { .leave-cal .cal-day { min-height: 48px; font-size: 0.7rem; } .leave-cal .cal-chip { display: none; } .leave-cal .cal-day::after { content: attr(data-count); } }

/* discipline analytics */
.score { display: flex; align-items: center; gap: 0.5rem; min-width: 140px; }
.score-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.score-bar > div { height: 100%; background: var(--accent-solid, #dc3a2e); border-radius: 999px; }
.trend { display: flex; align-items: flex-end; gap: 0.75rem; height: 150px; padding: 0.5rem 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-bar { width: 60%; max-width: 48px; background: var(--accent, rgba(220,58,46,0.5)); border-radius: 6px 6px 0 0; }
.trend-bar.focus { background: var(--ok, #16a34a); }
.trend-lbl { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }
.trend-val { font-size: 0.8rem; font-weight: 600; }

/* face enrolment */
.face-stage { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.face-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-guide { position: absolute; inset-inline: 0; bottom: 0; padding: 0.6rem; text-align: center; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.65)); }

/* ================= 2026-10 polish: Cairo for Arabic, pure glass, borderless fields, centred text, back arrow ================= */
:root { --field: rgba(255, 255, 255, 0.07); --field-hover: rgba(255, 255, 255, 0.1); --glass: rgba(23, 27, 36, 0.62); --glass-border: rgba(255, 255, 255, 0.08); --glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.28); --chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23cbd5e1'><path d='M7 10l5 5 5-5z'/></svg>"); }
[data-theme="light"] { --field: rgba(17, 24, 39, 0.05); --field-hover: rgba(17, 24, 39, 0.08); --glass: rgba(255, 255, 255, 0.8); --glass-border: rgba(255, 255, 255, 0.95); --glass-shadow: 0 8px 28px rgba(31, 41, 55, 0.07); --chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'><path d='M7 10l5 5 5-5z'/></svg>"); --muted: rgba(17, 24, 39, 0.58); }

body { font-family: Figtree, Cairo, "Segoe UI", Tahoma, system-ui, sans-serif; }
html[lang="ar"] body { font-family: Cairo, Figtree, "Segoe UI", Tahoma, system-ui, sans-serif; line-height: 1.75; font-weight: 500; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .card-title, html[lang="ar"] strong, html[lang="ar"] th { font-weight: 700; }
html[lang="ar"] .btn, html[lang="ar"] label, html[lang="ar"] .top-nav a, html[lang="ar"] .tab { font-weight: 600; letter-spacing: 0; }
html[lang="ar"] .btn { text-transform: none; }
h1 { font-size: 1.45rem; letter-spacing: -0.01em; }

/* pure glass: clean white in the light mode, deep slate in the dark one; nothing foggy */
[data-theme="light"] body { background: radial-gradient(900px 520px at 8% -8%, rgba(220, 58, 46, 0.07), transparent 60%), radial-gradient(800px 480px at 105% 8%, rgba(80, 120, 255, 0.07), transparent 60%), linear-gradient(180deg, #f8f9fc 0%, #eef1f6 100%); background-attachment: fixed; }
.card, .stat, .tile, .tile-stat, .pill, .auth-card, .gallery figure, .day-list li, .balance-tile {
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); border-radius: 18px;
}
.day-list li, .balance-tile { border-radius: 14px; box-shadow: none; }
.card .card, .card .stat, .card .day-list li { background: var(--field); border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.topbar, .sidebar, .tabbar { background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-color: var(--glass-border); }
[data-theme="light"] .topbar, [data-theme="light"] .sidebar, [data-theme="light"] .tabbar { background: rgba(255, 255, 255, 0.72); border-color: rgba(17, 24, 39, 0.06); }
table { background: transparent; }
th { background: var(--field); border-bottom: 0; }
th:first-child { border-start-start-radius: 10px; } th:last-child { border-start-end-radius: 10px; }
td { border-bottom: 1px solid color-mix(in srgb, var(--text-strong) 6%, transparent); }
tr:hover td { background: var(--field); }
tr:last-child td { border-bottom: 0; }
code { background: var(--field); border: 0; }
hr { border-top-color: color-mix(in srgb, var(--text-strong) 8%, transparent); }

/* fields: soft fill, no hard edges; a chevron drawn by us for every dropdown; the file picker becomes a soft pill */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local],
input[type=search], input[type=tel], input[type=url], input[type=file], select, textarea {
  border: 1px solid transparent; background: var(--field); border-radius: 12px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  min-height: 42px; padding: 0.5rem 0.85rem; line-height: 1.4; transition: background .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { background: var(--field-hover); }
input:focus, select:focus, textarea:focus { background: var(--card); border-color: transparent; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus { background: rgba(255, 255, 255, 0.1); }
select { -webkit-appearance: none; appearance: none; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 20px; padding-right: 2.3rem; cursor: pointer; }
select:focus { background-image: var(--chevron); }
select[multiple], select[size] { background-image: none; padding-right: 0.85rem; }
input[type=file] { padding: 0.35rem 0.5rem; color: var(--muted); font-size: 0.9rem; cursor: pointer; }
input[type=file]::file-selector-button { border: 0; border-radius: 9px; padding: 0.45rem 0.9rem; margin-inline-end: 0.75rem; background: var(--btn); color: var(--btn-text); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--btn-hover); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-solid); width: 17px; height: 17px; cursor: pointer; }
textarea { min-height: 100px; }
label { font-size: 0.88rem; }
.field-hint { font-size: 0.8rem; line-height: 1.5; }

/* buttons, badges, pills: text sits in the middle, whatever the script */
.btn { border-radius: 12px; padding: 0.65rem 1.15rem; line-height: 1; min-height: 40px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; letter-spacing: 0.04em; gap: 0.4rem; }
.btn-sm { padding: 0.45rem 0.8rem; min-height: 32px; font-size: 0.74rem; }
.btn-lg { min-height: 48px; }
.btn-secondary, .btn-ghost { background: var(--field); border-color: transparent; }
.btn-secondary:hover, .btn-ghost:hover { background: var(--field-hover); }
.icon-btn { border-color: transparent; background: var(--field); border-radius: 10px; }
.lang-switch { border: 0; background: var(--field); border-radius: 10px; }
.lang-switch a { display: inline-flex; align-items: center; min-height: 34px; line-height: 1; }
.badge { display: inline-flex; align-items: center; justify-content: center; line-height: 1; padding: 0.3rem 0.6rem; min-height: 24px; border-color: transparent; }
html[lang="ar"] .badge { padding-top: 0.2rem; padding-bottom: 0.35rem; }
.pill { line-height: 1.2; }
.tab { display: inline-flex; align-items: center; min-height: 34px; line-height: 1; border-color: transparent; background: var(--field); }
.tab.active { background: var(--accent-soft); }
.alert { border-radius: 14px; -webkit-backdrop-filter: none; backdrop-filter: none; display: flex; align-items: center; gap: 0.5rem; }
.stat { text-align: center; }
.stat .value { line-height: 1.15; }
.empty { display: flex; align-items: center; justify-content: center; min-height: 80px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card-title { min-height: 24px; }
.sidebar a { min-height: 40px; }
.sidebar a.active { box-shadow: none; }
.top-nav a { display: inline-flex; align-items: center; min-height: 34px; line-height: 1; }
.topbar .user-name { line-height: 1; }
.clock-buttons .btn { min-height: 56px; }
.auth-card h1, .clock-state, .cert-box { text-align: center; }
.kv th, .kv td { vertical-align: middle; }

/* fewer words on the screen: the paragraph under a page title and the sentence under a card title are not shown in the signed-in areas */
.with-sidebar .content > h1 + p.muted, .with-sidebar .content > h1.page-head + p.muted, .with-sidebar .card > .card-title + p.muted.small, .with-sidebar .card > .card-title + p.muted { display: none; }

/* back arrow */
.back-btn { display: flex; width: max-content; align-items: center; gap: 0.3rem; margin-bottom: 0.5rem; padding: 0.35rem 0.75rem 0.35rem 0.5rem; border-radius: 999px; background: var(--field); color: var(--text); font-size: 0.82rem; font-weight: 600; line-height: 1; text-decoration: none; }
html[lang="ar"] .back-btn { margin-inline-start: auto; flex-direction: row-reverse; padding: 0.35rem 0.5rem 0.35rem 0.75rem; }
html[lang="ar"] .back-btn svg { transform: scaleX(-1); }
.back-btn:hover { background: var(--field-hover); color: var(--text-strong); }
.back-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* small screens: everything stays reachable and nothing overflows */
@media (max-width: 600px) {
  .btn { min-height: 42px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .stat { padding: 0.75rem; }
  .stat .value { font-size: 1.4rem; }
  .card { padding: 0.9rem; border-radius: 14px; }
  .filters > div { min-width: 0; flex: 1 1 45%; }
  .actions { gap: 0.4rem; }
  h1 { font-size: 1.25rem; }
}
@media (prefers-reduced-transparency: reduce) { .card, .stat, .tile, .tile-stat, .pill, .auth-card, .topbar, .sidebar, .tabbar { background: var(--card); } }

/* phones: the menu is one sticky strip of pills under the header that scrolls sideways; the page starts right below it */
@media (max-width: 860px) {
  .sidebar { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0.4rem; padding: 0.55rem 0.75rem; position: sticky; top: var(--topbar-h, 60px); z-index: 20; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar a { flex: 0 0 auto; min-height: 36px; padding: 0.4rem 0.9rem; border: 0; border-radius: 999px; background: var(--field); font-size: 0.88rem; scroll-snap-align: center; }
  .sidebar a.active { background: var(--accent-soft); color: var(--accent-dark); border: 0; }
  html[lang="ar"] .sidebar { flex-direction: row-reverse; }
  .content { padding: 1rem 0.9rem 1.5rem; }
  .back-btn { margin-bottom: 0.4rem; }
}
.dash-main, .dash-top > *, .dash-layout > * { min-width: 0; }
@media (max-width: 1100px) { .dash-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .card { overflow-x: auto; }
  .dash-hello h2 { font-size: 1.2rem; }
  .dash-pending { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: none; }
  .dash-pending .pill { flex: 0 0 auto; }
}
.alert.validation-summary-valid, .alert:empty { display: none; }

/* ================= 2026-10 round 2: clearer glass, fixed side menu, info buttons, quick search, grouped phone menu ================= */
:root { --glass: rgba(21, 25, 34, 0.52); --glass-border: rgba(255, 255, 255, 0.09); --glass-blur: 22px; }
[data-theme="light"] { --glass: rgba(255, 255, 255, 0.58); --glass-border: rgba(255, 255, 255, 0.9); --glass-shadow: 0 10px 32px rgba(31, 41, 55, 0.08); }
[data-theme="light"] body { background: radial-gradient(1100px 600px at 0% -10%, rgba(220, 58, 46, 0.14), transparent 60%), radial-gradient(900px 560px at 100% 0%, rgba(59, 130, 246, 0.14), transparent 60%), radial-gradient(900px 600px at 50% 110%, rgba(16, 185, 129, 0.1), transparent 60%), linear-gradient(180deg, #f6f7fb 0%, #eef1f7 100%); background-attachment: fixed; }
[data-theme="dark"] body { background: radial-gradient(1100px 600px at 0% -10%, rgba(220, 58, 46, 0.22), transparent 60%), radial-gradient(900px 560px at 100% 0%, rgba(59, 130, 246, 0.18), transparent 60%), radial-gradient(900px 600px at 50% 110%, rgba(16, 185, 129, 0.12), transparent 60%), linear-gradient(180deg, #0f1218 0%, #141821 100%); background-attachment: fixed; }
.card, .stat, .tile, .tile-stat, .pill, .auth-card, .gallery figure, .day-list li, .balance-tile { -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); backdrop-filter: blur(var(--glass-blur)) saturate(160%); }
.topbar, .sidebar, .tabbar { -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); backdrop-filter: blur(var(--glass-blur)) saturate(160%); }
[data-theme="light"] .topbar, [data-theme="light"] .sidebar, [data-theme="light"] .tabbar { background: rgba(255, 255, 255, 0.55); }
.topbar { background: var(--glass); }

/* dropdown arrow on the reading side; never over the text */
html[lang="ar"] select { background-position: left 0.7rem center; padding-left: 2.3rem; padding-right: 0.85rem; }
select::-ms-expand { display: none; }
input[type=file]::file-selector-button { background: var(--accent-soft); color: var(--accent-dark); }
input[type=file]::file-selector-button:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.file-btn { cursor: pointer; }

/* side menu stays while the page scrolls */
@media (min-width: 861px) {
  .sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; align-self: flex-start; scrollbar-width: thin; }
}

/* glass back arrow */
.back-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--glass-shadow); margin-bottom: 0.6rem; }
.back-btn svg { width: 20px; height: 20px; }
html[lang="ar"] .back-btn { padding: 0; }

/* header icons */
.icon-btn { position: relative; width: 38px; height: 38px; }
.icon-btn svg { width: 20px; height: 20px; }
.bell-btn .count-badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* field explanations */
.hint-btn { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-inline-start: 0.4rem; border: 0; border-radius: 50%; background: var(--field-hover); color: var(--muted); font: 700 0.7rem/1 Figtree, sans-serif; cursor: pointer; vertical-align: middle; }
.hint-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }
.hint-pop { display: none; margin-top: 0.35rem; padding: 0.5rem 0.7rem; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 0.8rem; line-height: 1.5; }
.hint-pop.open { display: block; }
label.check .hint-btn { margin-inline-start: 0.5rem; }

/* quick search */
.search-layer { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 18, 0.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem; }
.search-box { width: 100%; max-width: 560px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); padding: 0.9rem; }
.search-box input { width: 100%; font-size: 1.05rem; min-height: 48px; }
.search-results { list-style: none; margin: 0.6rem 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.search-results li a { display: block; padding: 0.55rem 0.8rem; border-radius: 10px; color: var(--text-strong); text-decoration: none; }
.search-results li.sel a, .search-results li a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.search-results li a.extra { color: var(--accent-dark); font-weight: 600; }
.search-help { margin-top: 0.5rem; text-align: center; }

/* rows of small actions */
.row-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.row-actions .btn { min-height: 30px; padding: 0.3rem 0.65rem; font-size: 0.72rem; }
.row-actions .btn.danger { color: var(--danger); }
.steps { margin: 0; padding-inline-start: 1.2rem; line-height: 1.7; }
.steps li { margin-bottom: 0.3rem; }
.setup-block[hidden] { display: none; }

/* audit log in words */
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 0.75rem; align-items: start; padding: 0.7rem 0.25rem; border-bottom: 1px solid color-mix(in srgb, var(--text-strong) 6%, transparent); }
.audit-row:last-child { border-bottom: 0; }
.audit-when { color: var(--muted); font-size: 0.82rem; padding-top: 0.15rem; white-space: nowrap; }
.audit-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.audit-entity { padding-top: 0.2rem; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--field); font-size: 0.82rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .audit-row { grid-template-columns: 1fr; gap: 0.2rem; } .audit-entity { display: none; } }

/* compact tables */
table.compact th, table.compact td { padding: 0.45rem 0.5rem; font-size: 0.88rem; }
.score { display: flex; align-items: center; gap: 0.5rem; min-width: 110px; }

/* phones: home pill + section drop-downs */
@media (max-width: 860px) {
  .sidebar { flex-wrap: wrap; overflow: visible; gap: 0.4rem; }
  html[lang="ar"] .sidebar { flex-direction: row; justify-content: flex-end; }
  .nav-dd { position: relative; }
  .nav-dd summary { list-style: none; display: inline-flex; align-items: center; gap: 0.3rem; min-height: 36px; padding: 0.4rem 0.9rem; border-radius: 999px; background: var(--field); font-size: 0.88rem; cursor: pointer; user-select: none; }
  .nav-dd summary::-webkit-details-marker { display: none; }
  .nav-dd summary::after { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0.6; }
  .nav-dd.has-active summary { background: var(--accent-soft); color: var(--accent-dark); }
  .nav-dd[open] summary { background: var(--accent-soft); color: var(--accent-dark); }
  .nav-dd-list { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 40; min-width: 230px; display: flex; flex-direction: column; gap: 2px; padding: 0.4rem; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); }
  html[lang="ar"] .nav-dd-list { inset-inline-start: auto; inset-inline-end: 0; }
  .nav-dd-list a { display: flex; min-height: 38px; padding: 0.4rem 0.8rem; border-radius: 10px; background: transparent; font-size: 0.9rem; }
  .nav-dd-list a.active { background: var(--accent-soft); color: var(--accent-dark); }
}
.search-layer[hidden] { display: none; }
input:not([type]) { border: 1px solid transparent; background: var(--field); border-radius: 12px; box-shadow: none; min-height: 42px; padding: 0.5rem 0.85rem; line-height: 1.4; }
input:not([type]):focus { background: var(--card); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.hint-pop { background: var(--field); border-inline-start: 3px solid var(--accent); }
@media (max-width: 860px) { .nav-dd-list { background: color-mix(in srgb, var(--card) 94%, transparent); } }
@media (max-width: 600px) { .topbar-right { gap: 0.25rem; } .icon-btn { width: 34px; height: 34px; } .lang-switch a { padding: 0.3rem 0.45rem; font-size: 0.76rem; } .topbar .user-name { display: none; } .topbar-left .brand svg { width: 28px; height: 28px; } }

/* permission grid */
.perm-grid { border-radius: 12px; background: var(--field); padding: 0.4rem 0.6rem; font-size: 0.86rem; }
.perm-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 54px 54px; align-items: center; padding: 0.3rem 0.2rem; border-bottom: 1px solid color-mix(in srgb, var(--text-strong) 6%, transparent); }
.perm-row:last-of-type { border-bottom: 0; }
.perm-row label { display: flex; justify-content: center; margin: 0; cursor: pointer; }
.perm-row input[type=radio] { width: 16px; height: 16px; margin: 0; }
.perm-head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.perm-head span:not(:first-child) { text-align: center; }
.perm-grid.locked { opacity: 0.55; pointer-events: none; }
.perm-tools { padding-top: 0.4rem; }
.perm-tools .link, .link { border: 0; background: none; color: var(--accent-dark); cursor: pointer; font: inherit; padding: 0; }
.edit-row td { background: var(--field); border-radius: 12px; }
body.view-only .content form[method="post"] button, body.view-only .content form[method="post"] input[type=submit], body.view-only .content form[method="post"] .btn { display: none !important; }
body.view-only .content form[method="post"] input, body.view-only .content form[method="post"] select, body.view-only .content form[method="post"] textarea { pointer-events: none; opacity: 0.7; }
.view-only-note { margin-bottom: 0.75rem; }

/* round 3: one arrow per dropdown even when focused; words instead of pills; aligned grids; site font in code blocks; map tiles */
select, select:focus, [data-theme="dark"] select:focus { background-repeat: no-repeat !important; background-size: 20px !important; background-position: right 0.7rem center !important; }
html[lang="ar"] select, html[lang="ar"] select:focus { background-position: left 0.7rem center !important; }
select[multiple], select[size] { background-image: none !important; }
.badge { background: transparent !important; border: 0 !important; padding: 0 !important; min-height: 0; font-weight: 700; letter-spacing: 0; }
.badge-ok { color: var(--ok); } .badge-warn { color: var(--warn); } .badge-danger { color: var(--danger); } .badge-info { color: var(--info); }
.card-title .badge { background: var(--field) !important; padding: 0.15rem 0.5rem !important; border-radius: 999px; font-weight: 600; color: var(--muted); }
.sub-state { display: flex; flex-direction: column; gap: 1px; font-size: 0.8rem; font-weight: 700; line-height: 1.35; margin-top: 0.35rem; }
.sub-state span:last-child { font-weight: 500; font-size: 0.76rem; opacity: 0.9; }
.sub-state.ok { color: var(--ok); } .sub-state.warn { color: var(--warn); } .sub-state.info { color: var(--info); }
.grid-2 > div, .grid-3 > div { display: flex; flex-direction: column; justify-content: flex-end; }
.grid-2 > div > label, .grid-3 > div > label { margin-top: auto; }
.row > .card.grow { flex: 1 1 360px; }
pre { font-family: inherit; font-size: 0.9rem; line-height: 1.6; background: var(--field); border-radius: 12px; padding: 0.75rem 0.9rem; }
.leaflet-container img { max-width: none !important; }
.leaflet-container { font-family: inherit; }
/* phone drop-downs: full width under the strip, never past the screen edge; text starts at the reading side */
@media (max-width: 860px) {
  .nav-dd-list { position: fixed; inset-inline: 0.75rem; left: 0.75rem; right: 0.75rem; top: var(--dd-top, 120px); min-width: 0; max-height: calc(100vh - var(--dd-top, 120px) - 1rem); overflow-y: auto; }
  html[lang="ar"] .nav-dd-list { inset-inline-start: 0.75rem; inset-inline-end: 0.75rem; }
  .nav-dd-list a { justify-content: flex-start; text-align: left; }
  html[lang="ar"] .nav-dd-list a { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
}
[hidden] { display: none !important; }
/* native pop-ups of dropdowns, date and time pickers follow the theme */
[data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
select option { background: var(--card); color: var(--text-strong); }
[data-theme="dark"] select option { background: #1b2029; color: #e5e7eb; }
/* the phone's main drop-downs: frosted glass over the page */
@media (max-width: 860px) {
  .nav-dd-list { background: color-mix(in srgb, var(--card) 70%, transparent); -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); border: 1px solid var(--glass-border); }
  [data-theme="light"] .nav-dd-list { background: rgba(255, 255, 255, 0.66); }
  [data-theme="dark"] .nav-dd-list { background: rgba(24, 28, 37, 0.66); }
}

/* (i) explanations float in a frosted bubble under the button; the form around them never moves */
.hint-pop.open { position: fixed; z-index: 75; margin: 0; padding: 0.7rem 0.9rem; border-radius: 14px; background: color-mix(in srgb, var(--card) 72%, transparent); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); color: var(--text-strong); font-size: 0.84rem; line-height: 1.55; border-inline-start: 1px solid var(--glass-border); }
[data-theme="light"] .hint-pop.open { background: rgba(255, 255, 255, 0.7); }
[data-theme="dark"] .hint-pop.open { background: rgba(24, 28, 37, 0.7); }
.hint-pop.open::before { content: ""; position: absolute; top: -6px; left: var(--arrow-x, 20px); width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); background: inherit; border-left: 1px solid var(--glass-border); border-top: 1px solid var(--glass-border); }

/* ================= 1.4.0: owner portal, announcements, lightbox, frosted drop-downs, pager, readability ================= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.kpi-sub { font-size: 0.9rem; color: var(--muted); margin-inline-start: 0.25rem; font-weight: 500; }
.stat-attn .value { color: var(--accent); }
.stat .label a { color: inherit; }
.text-warn { color: var(--warn); } .text-danger { color: var(--danger); }
.mail-preview { background: var(--field); border-radius: 14px; padding: 1rem; }
.mail-preview hr { margin: 0.6rem 0; }
.release-notes h2 { font-size: 1.15rem; margin: 1.2rem 0 0.4rem; } .release-notes h3 { font-size: 1rem; margin: 0.9rem 0 0.3rem; color: var(--accent-dark); }
.release-notes li { margin-inline-start: 1.2rem; line-height: 1.7; } .release-notes .gap { height: 0.4rem; }
.announce { align-items: flex-start; }
.announce .grow { flex: 1; }
.announce-close { width: 30px; height: 30px; border: 0; background: transparent; }
.pager { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.75rem; }
.pager a { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--field); color: var(--text); text-decoration: none; font-size: 0.85rem; }
.pager a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
/* readability: body text and muted text keep AA contrast in both themes; keyboard focus is visible */
[data-theme="light"] { --muted: #4b5563; }
[data-theme="dark"] { --muted: #a1a8b5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(8, 10, 16, 0.78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 1rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(96vw, 1100px); max-height: 88vh; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lightbox .lb-close { position: fixed; top: 16px; inset-inline-end: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.1rem; cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lightbox .lb-open { position: fixed; bottom: 16px; inset-inline-end: 16px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, 0.15); color: #fff; text-decoration: none; font-size: 1.1rem; }
body.lb-locked { overflow: hidden; }
/* frosted drop-downs (desktop) */
.dd { position: relative; }
.dd .dd-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.dd-btn { width: 100%; min-height: 42px; padding: 0.5rem 2.3rem 0.5rem 0.85rem; border: 1px solid transparent; border-radius: 12px; background: var(--field) var(--chevron) no-repeat right 0.7rem center / 20px; color: var(--text-strong); font: inherit; text-align: start; cursor: pointer; line-height: 1.4; }
html[lang="ar"] .dd-btn { padding: 0.5rem 0.85rem 0.5rem 2.3rem; background-position: left 0.7rem center; }
.dd-btn:hover { background-color: var(--field-hover); }
.dd-btn[aria-expanded="true"], .dd-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.dd-btn.placeholder { color: var(--muted); }
.dd-btn:disabled { opacity: 0.6; cursor: default; }
.dd-list { position: absolute; z-index: 65; inset-inline-start: 0; min-width: 100%; max-height: 280px; overflow-y: auto; margin-top: 6px; padding: 0.35rem; border-radius: 14px; background: color-mix(in srgb, var(--card) 72%, transparent); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
[data-theme="light"] .dd-list { background: rgba(255, 255, 255, 0.72); } [data-theme="dark"] .dd-list { background: rgba(24, 28, 37, 0.74); }
.dd-list.up { bottom: 100%; margin-top: 0; margin-bottom: 6px; }
.dd-item { padding: 0.5rem 0.75rem; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.dd-item:hover { background: var(--field-hover); }
.dd-item.selected { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.dd-item.disabled { opacity: 0.5; cursor: default; }
.filters .dd { min-width: 160px; }
