/* ==========================================================================
   Graini Platform — core stylesheet (canonical)
   One stylesheet for the shell, core pages and the shared design system.
   Load order inside the file: foundation → shell → core pages → product design system.
   Themes: light (default) and dark (html[data-theme="dark"]). Direction-agnostic
   (logical properties; RTL overrides under html[dir="rtl"]). EN · FR · AR.
   Module screens add their own stylesheet (e.g. modules/QuickAsk/Assets/css/quickask.css).
   ========================================================================== */

/* ===== Foundation: tokens, base elements, forms, controls, dialogs ===== */
:root {
  color-scheme: light;
  --overlay: rgba(15, 20, 30, .44);
  --text-on-primary: #ffffff;
  --brand-navy: #0b1f3a;
  --success: #12b76a;
  --success-soft: #ecfdf3;
  --success-text: #067647;
  --success-border: #abefc6;
  --warning: #f79009;
  --warning-soft: #fffaeb;
  --warning-text: #b54708;
  --warning-border: #fedf89;
  --danger: #f04438;
  --danger-soft: #fef3f2;
  --danger-text: #b42318;
  --danger-border: #fecdca;
  --info: #0ba5ec;
  --info-soft: #f0f9ff;
  --info-text: #026aa2;
  --info-border: #b9e6fe;
  --violet: #7a5af8;
  --violet-soft: #f4f3ff;
  --violet-text: #5925dc;
  --neutral-soft: #f2f4f7;
  --neutral-text: #344054;
  --tone-0: #2d5bff;
  --tone-1: #0e9384;
  --tone-2: #dd2590;
  --tone-3: #dc6803;
  --tone-4: #7a5af8;
  --tone-5: #0086c9;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .20), 0 6px 14px -6px rgba(16, 24, 40, .08);
  --shadow-xl: 0 28px 64px -16px rgba(16, 24, 40, .28);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Inter", ui-sans-serif, system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --bottomnav-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus-ring: 0 0 0 3px var(--primary-ring);
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-muted: var(--text-3);
  --surface-elevated: var(--surface);
  --surface-muted: var(--surface-2);
  --accent: var(--primary);
  --accent-hover: var(--primary-hover);
  --accent-soft: var(--primary-soft);
  --accent-text: var(--primary-text);
  --module-accent: var(--primary);
  --module-accent-soft: var(--primary-soft);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --overlay: rgba(0, 0, 0, .62);
  --primary-press: #5a7af0;
  --primary-ring: rgba(111, 141, 255, .35);
  --text-on-primary: #0b0e14;
  --success: #32d583;
  --success-soft: rgba(50, 213, 131, .12);
  --success-text: #75e0a7;
  --success-border: rgba(50, 213, 131, .3);
  --warning: #fdb022;
  --warning-soft: rgba(253, 176, 34, .12);
  --warning-text: #fec84b;
  --warning-border: rgba(253, 176, 34, .3);
  --danger: #f97066;
  --danger-soft: rgba(249, 112, 102, .12);
  --danger-text: #fda29b;
  --danger-border: rgba(249, 112, 102, .32);
  --info: #36bffa;
  --info-soft: rgba(54, 191, 250, .12);
  --info-text: #7cd4fd;
  --info-border: rgba(54, 191, 250, .3);
  --violet: #9b8afb;
  --violet-soft: rgba(155, 138, 251, .14);
  --violet-text: #bdb4fe;
  --neutral-soft: #1c2230;
  --neutral-text: #c9d0dc;
  --tone-0: #6f8dff;
  --tone-1: #2ed3b7;
  --tone-2: #f670c7;
  --tone-3: #fdb022;
  --tone-4: #9b8afb;
  --tone-5: #36bffa;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .55);
  --shadow-lg: 0 20px 44px -12px rgba(0, 0, 0, .65);
  --shadow-xl: 0 30px 70px -16px rgba(0, 0, 0, .75);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font-sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html[dir="rtl"] body, html[lang="ar"] body { font-family: var(--font-ar); }
img, svg, video { max-width: 100%; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4, h5 {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--primary-soft-2); }
:focus-visible { box-shadow: var(--focus-ring); }
code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.ti {
  display: inline-block;
  line-height: 1;
  font-size: 1.15em;
  vertical-align: -.14em;
  flex: none;
}
html[dir="rtl"] .ti-arrow-right,
html[dir="rtl"] .ti-arrow-left,
html[dir="rtl"] .ti-chevron-right,
html[dir="rtl"] .ti-chevron-left,
html[dir="rtl"] .ti-send,
html[dir="rtl"] .ti-logout { transform: scaleX(-1); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.break-words { overflow-wrap: anywhere; word-break: break-word; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; }
.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--btn-h);
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
  user-select: none;
}
.btn .ti, .btn-primary .ti, .btn-secondary .ti { font-size: 17px; }
.btn[disabled], .btn-primary[disabled], .btn-secondary[disabled], .btn.is-loading {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-secondary, .btn.btn-secondary { border-color: var(--border); }
.btn-ghost, .btn.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-danger, .btn-secondary.btn-danger { color: var(--danger-text); }
.btn-secondary.btn-danger:hover, .btn-ghost.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger-border); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(.95); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  background: transparent;
  position: relative;
}
.icon-btn .ti { font-size: 19px; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input:not([type]),
select,
textarea,
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: var(--fs-md);
  line-height: 1.4;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; }
select {
  padding-inline-end: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}
html[dir="rtl"] select { background-position: left 10px center; }
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:focus, select:focus, textarea:focus, .input:focus { outline: none; border-color: var(--primary); }
input:disabled, select:disabled, textarea:disabled, textarea[readonly] {
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
}
input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
  flex: none;
}
input[type="file"] {
  font-size: var(--fs-sm);
  color: var(--text-2);
  max-width: 100%;
}
input[type="file"]::file-selector-button {
  margin-inline-end: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(.85); }
.field, .form-field { display: grid; min-width: 0; }
.field-hint { font-size: var(--fs-xs); color: var(--text-3); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 16px; }
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group > .ti {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--text-3);
  pointer-events: none;
  font-size: 17px;
}
.input-group > input { padding-inline-start: 38px; }
.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
  z-index: 1;
}
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--border-strong);
  transition: background .15s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
html[dir="rtl"] .switch input:checked + span::after { transform: translateX(-16px); }
.switch input:focus-visible + span { box-shadow: var(--focus-ring); }
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  min-width: 0;
}
.card + .card { margin-top: 16px; }
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--text);
}
.card-title .ti { color: var(--text-3); font-size: 18px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2, .panel-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-head .ti { color: var(--text-3); }
.panel.flush { padding: 0; overflow: hidden; }
.divider-list > * + * { border-top: 1px solid var(--border-subtle); }
.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--neutral-text);
  border: 1px solid transparent;
}
.badge .ti, .pill .ti { font-size: 13px; }
.badge-neutral, .pill-neutral { background: var(--neutral-soft); color: var(--neutral-text); }
.badge-success, .pill-success { background: var(--success-soft); color: var(--success-text); }
.badge-warning, .pill-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-danger, .pill-danger { background: var(--danger-soft); color: var(--danger-text); }
.badge-info, .pill-info { background: var(--info-soft); color: var(--info-text); }
.badge-primary, .pill-primary { background: var(--primary-soft); color: var(--primary-text); }
.pill-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.ref-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}
.count {
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  line-height: 1;
}
.is-active > .count, .count.is-accent { background: var(--primary-soft-2); color: var(--primary-text); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.chip:hover { background: var(--surface-hover); color: var(--text); }
.chip.is-active, .chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}
.avatar {
  --size: 32px;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: calc(var(--size) * .4);
  line-height: 1;
  background: color-mix(in srgb, var(--tone, var(--tone-0)) 14%, var(--surface));
  color: var(--tone, var(--tone-0));
  border: 1px solid color-mix(in srgb, var(--tone, var(--tone-0)) 22%, transparent);
  text-transform: uppercase;
}
.avatar.sm { --size: 24px; }
.avatar.xs { --size: 20px; font-size: 9px; }
.avatar.xl { --size: 56px; }
.tone-0 { --tone: var(--tone-0); }
.tone-1 { --tone: var(--tone-1); }
.tone-2 { --tone: var(--tone-2); }
.tone-3 { --tone: var(--tone-3); }
.tone-4 { --tone: var(--tone-4); }
.tone-5 { --tone: var(--tone-5); }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack > .avatar { border: 2px solid var(--surface); margin-inline-start: -7px; }
.avatar-stack > .avatar:first-child { margin-inline-start: 0; }
.avatar-more {
  background: var(--surface-3);
  color: var(--text-2);
  --tone: var(--text-3);
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  border: 0;
  background: none;
  font-size: var(--fs-sm);
  white-space: nowrap;
  text-decoration: none !important;
}
.tab:hover { color: var(--text); }
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented > button, .segmented > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
  text-decoration: none !important;
}
.segmented > .is-active, .segmented > .active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.alert .ti { font-size: 18px; margin-top: 1px; }
.alert-success {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success-text);
}
.alert-danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-text);
}
.alert-warning {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning-text);
}
.alert-info {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--info-text);
}
.alert-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.toast-region {
  position: fixed;
  z-index: 5000;
  inset-inline: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, 100%);
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  font-weight: 600;
  animation: toast-in .25s var(--ease);
}
html[data-theme="dark"] .toast {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.toast .ti { font-size: 18px; color: var(--success); }
.toast.is-error .ti { color: var(--danger); }
.toast-close {
  margin-inline-start: 6px;
  background: none;
  border: 0;
  color: inherit;
  opacity: .6;
  padding: 2px;
}
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
body.has-bottomnav .toast-region { bottom: calc(var(--bottomnav-h) + 14px + env(safe-area-inset-bottom)); }
.empty-state, .empty {
  display: grid;
  justify-items: center;
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.empty-icon, .empty-state > .ti { display: grid; place-items: center; }
.empty-title { color: var(--text); }
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
}
.table th { text-align: start; white-space: nowrap; }
.table td {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-2);
  vertical-align: middle;
}
.table td strong { color: var(--text); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.ui-dialog {
  position: fixed;
  inset: 0;
  z-index: 3500;
  display: none;
}
.ui-dialog.is-open { display: block; }
.ui-dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  animation: fade-in .2s var(--ease);
  cursor: default;
  width: 100%;
  padding: 0;
}
.ui-dialog-panel {
  position: absolute;
  inset-inline: 0;
  margin-inline: auto;
  top: 8vh;
  width: min(560px, calc(100% - 32px));
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}
.ui-dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ui-dialog-head p {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-top: 3px;
}
.ui-dialog-head .icon-btn { margin-inline-start: auto; margin-top: -4px; }
.ui-dialog-body { position: relative; overflow-y: auto; overscroll-behavior: contain; }
.ui-dialog-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.sheet-handle { display: none; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes drawer-in-ltr { from { transform: translateX(100%); } }
@keyframes drawer-in-rtl { from { transform: translateX(-100%); } }
@media (max-width: 640px) {
  .ui-dialog-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 92dvh;
    border-inline: 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet-handle {
    display: block;
    margin: 8px auto 0;
    flex: none;
  }
  .ui-dialog-head { padding-top: 10px; }
  .ui-dialog-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}
html.ui-lock, html.ui-lock body { overflow: hidden; }
.menu {
  position: absolute;
  z-index: 3200;
  min-width: 220px;
  background: var(--surface);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font-size: var(--fs-sm);
  text-align: start;
  text-decoration: none !important;
}
.menu-item:hover, .menu-item:focus-visible { box-shadow: none; }
.menu-item .ti { color: var(--text-3); font-size: 17px; }
.menu-item.is-current { background: var(--primary-soft); color: var(--primary-text); }
.menu-item.is-current .ti { color: var(--primary-text); }
.menu-item.is-danger { color: var(--danger-text); }
.menu-item.is-danger .ti { color: var(--danger-text); }
.menu-sep { height: 1px; }
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 14px;
}
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: 13.5px;
  top: 28px;
  bottom: 0;
}
.timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-3);
  border: 1px solid var(--border);
  font-size: 14px;
}
.timeline-icon .ti { font-size: 14px; }
.timeline-icon.is-success {
  background: var(--success-soft);
  color: var(--success-text);
  border-color: var(--success-border);
}
.timeline-icon.is-danger {
  background: var(--danger-soft);
  color: var(--danger-text);
  border-color: var(--danger-border);
}
.timeline-icon.is-primary {
  background: var(--primary-soft);
  color: var(--primary-text);
  border-color: var(--primary-soft-2);
}
.timeline-icon.is-warning {
  background: var(--warning-soft);
  color: var(--warning-text);
  border-color: var(--warning-border);
}
.timeline-body { padding-top: 4px; min-width: 0; }
.timeline-title { color: var(--text); line-height: 1.4; }
.timeline-title b { font-weight: 600; }
.timeline-meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 2px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}
.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
}
.metric-label .ti { font-size: 15px; }
.metric-value {
  color: var(--text);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.metric.is-danger .metric-value { color: var(--danger-text); }
.metric.is-warning .metric-value { color: var(--warning-text); }
.metric.is-success .metric-value { color: var(--success-text); }
.metric.is-primary .metric-value { color: var(--primary-text); }
.progress { border-radius: 99px; overflow: hidden; }
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.progress.is-success > span { background: var(--success); }
.stack-bar {
  display: flex;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-3);
}
.stack-bar > span {
  display: block;
  height: 100%;
  min-width: 3px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i { display: inline-block; }
.page {
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}
.page-narrow { max-width: 880px; }
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header > div:first-child { min-width: 0; }
html[dir="rtl"] .page-title { letter-spacing: 0; }
.page-subtitle { max-width: 640px; }
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 8px;
}
.back-link:hover { color: var(--text); text-decoration: none; }
.section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .ti { color: var(--text-3); }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.kv {
  display: grid;
  grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  gap: 10px 14px;
  font-size: var(--fs-sm);
  margin: 0;
}
.kv dt { color: var(--text-3); }
.kv dd {
  margin: 0;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.spacer { flex: 1; }
@media (max-width: 640px) {
  .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .page-header { margin-bottom: 16px; }
  .page-actions .btn-primary, .page-actions .btn-secondary { flex: 1; }
}
.qa-autolink {
  color: var(--primary-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.qa-autolink:hover { text-decoration-color: currentColor; }
.user-content {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: normal;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.list > li + li { border-top: 1px solid var(--border-subtle); }
.ref {
  font-family: var(--font-mono);
  color: var(--text-3);
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--neutral-text);
  flex: none;
}
.tag-violet { background: var(--violet-soft); color: var(--violet-text); }
.tag-danger { background: var(--danger-soft); color: var(--danger-text); }
.tag-warning { background: var(--warning-soft); color: var(--warning-text); }
.tag-success { background: var(--success-soft); color: var(--success-text); }
.tag-primary { background: var(--primary-soft); color: var(--primary-text); }
.tag-info { background: var(--info-soft); color: var(--info-text); }
.link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--text-3);
  text-decoration: none !important;
}
.link-quiet:hover { color: var(--text); }
.link-quiet .ti { font-size: 15px; }
.muted-note { font-size: var(--fs-sm); color: var(--text-3); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
[data-bidi] { unicode-bidi: plaintext; text-align: start; }
html[dir="rtl"] [data-bidi] { text-align: right; }
html[dir="ltr"] [data-bidi] { text-align: left; }
.qa-day-group, .qa-team-section {
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}
:root {
  --sidebar-bg: #f5f6f8;
  --shadow-raise: 0 2px 4px -1px rgba(16, 24, 40, .05), 0 6px 16px -4px rgba(16, 24, 40, .08);
  --shadow-primary: 0 1px 2px rgba(35, 64, 214, .25), 0 4px 12px -2px rgba(52, 86, 240, .28);
  --fs-page: 26px;
  --tracking-tight: -.022em;
  --tracking-snug: -.011em;
}
html[data-theme="dark"] {
  --sidebar-bg: #0c1017;
  --shadow-raise: 0 8px 24px -8px rgba(0, 0, 0, .6);
  --shadow-primary: 0 4px 14px -4px rgba(111, 141, 255, .45);
}
body { font-feature-settings: "cv11", "ss01", "calt"; }
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: var(--tracking-snug); }
.page-subtitle {
  font-size: var(--fs-md);
  color: var(--text-3);
  margin-top: 6px;
}
.page-header { min-height: 40px; }
strong, b { font-weight: 600; }
.num, time { font-variant-numeric: tabular-nums; }
.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger-solid {
  letter-spacing: -.005em;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .2s var(--ease), transform .1s var(--ease);
}
html[dir="rtl"] :is(.btn, .btn-primary, .btn-secondary, .btn-ghost) { letter-spacing: 0; }
.btn-primary, .btn.btn-primary { border-color: color-mix(in srgb, var(--primary) 70%, #000 10%); }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn.btn-primary { background: var(--primary); box-shadow: var(--shadow-primary); }
html[data-theme="dark"] .btn-primary:hover { background: var(--primary-hover); }
.btn-secondary:hover { box-shadow: var(--shadow-sm); }
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-ghost:active { transform: translateY(1px) scale(.985); }
.btn-ghost:hover { background: var(--hover); }
.icon-btn {
  transition: background-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: scale(.94); }
:is(.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger-solid).is-loading {
  position: relative;
  color: transparent !important;
  opacity: 1;
  cursor: progress;
  pointer-events: none;
}
:is(.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger-solid).is-loading > * { visibility: hidden; }
:is(.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger-solid).is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid;
  border-color: rgba(255,255,255,.95) rgba(255,255,255,.95) rgba(255,255,255,.3) rgba(255,255,255,.3);
  animation: ui-spin .7s linear infinite;
}
:is(.btn-secondary, .btn-ghost).is-loading::after { border-color: var(--text-3) var(--text-3) var(--border) var(--border); }
html[data-theme="dark"] .btn-primary.is-loading::after { border-color: #0b0e14 #0b0e14 rgba(11,14,20,.3) rgba(11,14,20,.3); }
@keyframes ui-spin { to { transform: rotate(360deg); } }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary-ring), 0 0 0 5px color-mix(in srgb, var(--primary) 55%, transparent);
}
a:focus-visible, button:focus-visible { border-radius: 8px; }
html[data-theme="dark"] :is(input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input:not([type]), select, textarea) { background: var(--surface-2); box-shadow: none; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus, .input:focus {
  border-color: color-mix(in srgb, var(--primary) 70%, var(--border));
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.field, .form-field { gap: 7px; }
.field-hint { line-height: 1.45; }
input[type="checkbox"] { border-radius: 5px; }
.card, .panel { box-shadow: var(--shadow-card); border-color: var(--border); }
.card-title { font-size: 15px; font-weight: 600; }
.panel-head { padding: 14px 20px; border-bottom-color: var(--border-subtle); }
.panel-head h2, .panel-head h3 { font-size: 15px; font-weight: 600; }
.badge, .pill {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 550;
  font-size: 12px;
}
.tag {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 550;
  font-size: 12px;
  gap: 5px;
  letter-spacing: 0;
}
.tag-violet, .tag-danger, .tag-warning, .tag-success, .tag-primary, .tag-info { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent); }
.tag-dot::before, .pill-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.count {
  height: 19px;
  min-width: 19px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 650;
  background: var(--neutral-soft);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.chip {
  height: 32px;
  border-radius: 999px;
  font-weight: 550;
  box-shadow: var(--shadow-xs);
  transition: background-color .15s, color .15s, border-color .15s;
}
.ref, .ref-chip { font-size: 11.5px; letter-spacing: 0; }
.avatar {
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone, var(--tone-0)) 10%, transparent);
}
.tabs { gap: 4px; }
.tab {
  position: relative;
  padding: 10px 2px;
  margin-inline-end: 18px;
  border-bottom: 0;
  color: var(--text-3);
  font-weight: 550;
  transition: color .15s var(--ease);
}
.tab::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color .2s var(--ease);
}
.tab.is-active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: transparent;
}
.tab.is-active::after { background: var(--primary); }
.tab:hover:not(.is-active) { color: var(--text-2); }
.tab .count {
  background: transparent;
  color: var(--text-4);
  padding: 0 2px;
  min-width: 0;
}
.tab.is-active .count { color: var(--text-3); }
.segmented {
  border-radius: 10px;
  background: var(--surface-3);
  border-color: transparent;
}
.segmented > button, .segmented > a { border-radius: 7px; font-weight: 550; }
html[data-theme="dark"] .segmented > .is-active, html[data-theme="dark"] .segmented > .active { background: var(--surface-2); }
.empty-state, .empty { gap: 8px; padding: 48px 24px; }
.empty-icon, .empty-state > .ti {
  box-shadow: var(--shadow-card), 0 0 0 6px color-mix(in srgb, var(--surface-3) 60%, transparent);
}
.empty-title { letter-spacing: var(--tracking-snug); }
.empty-text { color: var(--text-3); line-height: 1.55; }
.empty-state .btn-secondary, .empty-state .btn-primary { margin-top: 8px; }
.table th { letter-spacing: 0; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover td { background: var(--hover); }
.ui-dialog-panel { animation: ui-dialog-rise .28s var(--ease-out); }
html[data-theme="dark"] .ui-dialog-panel { box-shadow: 0 0 0 1px var(--border), var(--shadow-xl); }
.ui-dialog-foot { border-top: 1px solid var(--border-subtle); }
@keyframes ui-dialog-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes ui-sheet-rise { from { transform: translateY(100%); } }
@media (max-width: 640px) {
  .ui-dialog-panel { animation: ui-sheet-rise .34s var(--ease-out); }
  .ui-dialog-foot > .btn-primary, .ui-dialog-foot > .btn-secondary { flex: 1; --btn-h: 44px; }
  .sheet-handle {
    width: 40px;
    height: 5px;
    border-radius: 5px;
    background: var(--border-strong);
    opacity: .8;
  }
}
.menu { padding: 6px; animation: ui-menu-in .16s var(--ease-out); }
.menu-item {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color .1s;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); }
.menu-sep { background: var(--border-subtle); margin: 5px 6px; }
@keyframes ui-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.timeline-icon { box-shadow: 0 0 0 3px var(--surface); }
.timeline-item:not(:last-child)::before { background: var(--border-subtle); width: 1.5px; }
.timeline-title { font-size: 13.5px; }
.metric { box-shadow: var(--shadow-card); }
.metric-label { font-size: 12.5px; font-weight: 550; }
.metric-value { font-weight: 650; letter-spacing: -.025em; }
.progress { height: 6px; background: var(--surface-3); }
.progress > span {
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 75%, #fff), var(--primary));
}
.stack-bar { height: 8px; gap: 3px; }
.stack-bar > span:first-child { border-start-start-radius: 99px; border-end-start-radius: 99px; }
.legend { gap: 8px 18px; }
.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.link-quiet { font-weight: 550; transition: color .12s; }
.link-quiet .ti { transition: transform .15s var(--ease); }
.link-quiet:hover .ti-arrow-right { transform: translateX(2px); }
html[dir="rtl"] .link-quiet:hover .ti-arrow-right { transform: scaleX(-1) translateX(2px); }
.qa-day-group, .qa-team-section {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px 20px 12px;
}
.section-title { font-size: 15px; font-weight: 600; }
@keyframes ui-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  animation: ui-shimmer 1.3s ease-in-out infinite;
}
.nav-progress {
  position: fixed;
  z-index: 7000;
  top: 0;
  inset-inline: 0;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.nav-progress::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  box-shadow: 0 0 8px var(--primary-ring);
  border-radius: 0 2px 2px 0;
}
html.is-navigating .nav-progress { opacity: 1; }
html.is-navigating .nav-progress::before { animation: ui-progress 8s cubic-bezier(.1, .8, .2, 1) forwards; }
@keyframes ui-progress { 0% { width: 0; } 10% { width: 38%; } 40% { width: 70%; } 100% { width: 92%; } }
@media (max-width: 640px) {
  :root { --fs-page: 22px; }
  .page-header { min-height: 0; }
  .qa-day-group, .qa-team-section { padding: 14px 16px 10px; border-radius: 16px; }
}

/* ===== Application shell: sidebar, top bar, navigation ===== */
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 6000;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }
.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none !important;
}
.sidebar-brand .brand-mark-img {
  width: 26px;
  height: 26px;
  flex: none;
}
.brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-close { display: none; margin-inline-start: auto; }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  text-decoration: none !important;
  background: none;
  border: 0;
  width: 100%;
  text-align: start;
  list-style: none;
  cursor: pointer;
}
.nav-item::-webkit-details-marker { display: none; }
.nav-item > span:not(.nav-count) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.nav-item .ti { width: 20px; text-align: center; }
.nav-count {
  margin-inline-start: auto;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
}
.nav-caret {
  margin-inline-start: auto;
  font-size: 15px !important;
  transition: transform .15s;
}
.nav-section[open] > summary .nav-caret { transform: rotate(180deg); }
.nav-sub {
  display: grid;
  gap: 1px;
  padding: 2px 0 4px;
  border-inline-start: 1px solid var(--border);
}
.sidebar-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none !important;
}
.sidebar-user-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}
.sidebar-user-copy strong { font-size: var(--fs-sm); font-weight: 600; }
.sidebar-user-copy small { font-size: var(--fs-xs); }
.sidebar-logout { margin: 0; }
.main {
  flex: 1;
  min-width: 0;
  margin-inline-start: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}
.sidebar-toggle, .topbar-brand { display: none; }
.topbar-brand img { display: block; }
.topbar-context {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-sm);
}
.crumb {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--text-3);
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.crumb:hover { color: var(--text); }
.crumb-current { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--text-4); font-size: 14px; }
.topbar-spacer { flex: 1; }
.topbar-actions {
  display: flex;
  align-items: center;
  flex: none;
}
.popover-wrap { position: relative; }
.popover-menu { top: calc(100% + 8px); inset-inline-end: 0; }
.notif-badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  box-sizing: border-box;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  border: 2px solid var(--bg);
  pointer-events: none;
}
.notif-badge[hidden] { display: none !important; }
.lang-btn {
  display: inline-grid;
  place-items: center;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: var(--fs-xs);
  letter-spacing: .02em;
}
.lang-btn:hover { background: var(--hover); color: var(--text); }
.lang-menu { min-width: 170px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.topbar-user {
  border: 0;
  background: none;
  padding: 3px;
  border-radius: 50%;
  margin-inline-start: 4px;
  display: grid;
}
.topbar-user:hover .avatar { box-shadow: 0 0 0 3px var(--hover); }
.user-menu { min-width: 240px; }
.user-menu-head { min-width: 0; }
.user-menu-copy {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}
.user-menu-copy strong { font-size: var(--fs-sm); }
.user-menu-copy small { font-size: var(--fs-xs); color: var(--text-3); }
.user-menu form { margin: 0; }
.notification-popover { padding: 0; overflow: hidden; }
.notification-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notification-popover-header strong { font-weight: 650; }
.notification-popover-list {
  max-height: min(440px, 62vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 6px 6px;
}
.notification-popover-footer {
  display: block;
  text-align: center;
  padding: 11px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}
.notification-popover-footer:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--hover);
}
.notif-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: pointer;
  border: 0;
  width: 100%;
  text-align: start;
  background: none;
  color: inherit;
  text-decoration: none !important;
}
.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-3);
}
.notif-icon .ti { font-size: 16px; }
.notif-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.notif-title { line-height: 1.4; overflow-wrap: anywhere; }
.notif-row.is-unread .notif-title { color: var(--text); font-weight: 600; }
.notif-meta { display: flex; align-items: center; }
.notif-group-count {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 600;
  font-size: 10.5px;
}
.notif-unread-dot { border-radius: 50%; }
.notif-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.notif-skeleton {
  display: grid;
  gap: 10px;
  padding: 12px 10px;
}
.notif-skeleton span { height: 36px; }
.content { flex: 1; min-width: 0; }
.content:focus { outline: none; }
.flash-stack { margin-bottom: 16px; }
.core-push-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.core-push-notice[hidden] { display: none !important; }
.core-push-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
  flex: none;
}
.core-push-text {
  flex: 1;
  min-width: 180px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.bottom-nav { display: none; }
@media (max-width: 1023.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .26s var(--ease), visibility .26s;
    visibility: hidden;
    z-index: 3001;
  }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none !important; visibility: visible; }
  .sidebar-close { display: inline-grid; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: var(--overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
  .main { margin-inline-start: 0; }
  .topbar {
    gap: 2px;
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
  }
  .sidebar-toggle { display: inline-grid; }
  body.has-bottomnav .sidebar-toggle { display: none; }
  .topbar-brand { display: inline-grid; }
  body.has-bottomnav .content { padding-bottom: calc(var(--bottomnav-h) + 28px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    z-index: 35;
    display: flex;
    justify-content: space-around;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
  }
  .bottom-nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    padding: 0;
    text-decoration: none !important;
  }
  .bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
  }
}
@media (max-width: 640px) {
  .topbar-context { display: none; }
  .popover-menu {
    position: fixed;
    top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px);
    inset-inline: 10px;
    width: auto !important;
    min-width: 0;
  }
  .notification-popover-list { max-height: 64dvh; }
  .icon-btn { width: 38px; height: 38px; }
}
.sidebar { border-inline-end-color: var(--border-subtle); }
:root { --topbar-h: 60px; }
.sidebar-head { padding-inline: 18px 12px; }
html[dir="rtl"] .brand-name { letter-spacing: 0; }
.nav-count {
  height: 19px;
  min-width: 19px;
  font-size: 10.5px;
}
.topbar { transition: box-shadow .2s var(--ease), background-color .2s; }
.topbar-actions { gap: 4px; }
.lang-btn { border-radius: 9px; font-weight: 600; }
.topbar-user .avatar { transition: box-shadow .15s; }
.notif-badge { box-shadow: 0 1px 2px rgba(240, 68, 56, .35); }
.user-menu-head { padding: 10px 10px 8px; }
.notif-row { transition: background-color .12s; }
.notif-skeleton span {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  animation: ui-shimmer 1.3s ease-in-out infinite;
}
.flash-stack .alert { box-shadow: var(--shadow-card); }
@media (max-width: 1023.98px) {
  :root { --topbar-h: 56px; }
  .topbar { padding-top: env(safe-area-inset-top); }
  .sidebar { border-radius: 0; }
  html[dir="ltr"] .sidebar { border-start-end-radius: 20px; border-end-end-radius: 20px; }
  html[dir="rtl"] .sidebar { border-start-start-radius: 20px; border-end-start-radius: 20px; }
  .bottom-nav {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    border-top: 1px solid var(--border-subtle);
  }
  .bottom-nav-item { transition: color .15s; -webkit-tap-highlight-color: transparent; }
  .bottom-nav-item .ti {
    display: grid;
    place-items: center;
    border-radius: 99px;
    transition: background-color .2s var(--ease), transform .15s var(--ease);
  }
  .bottom-nav-item:active .ti { transform: scale(.9); }
  .bottom-nav-item.active { font-weight: 650; }
  .bottom-nav-item.active .ti { background: var(--primary-soft); }
}
@media (max-width: 380px) {
  .content { padding-inline: 12px; }
  .bottom-nav-item .ti { width: 48px; }
}

/* ===== Core pages: sign-in, home, notifications, profile, administration ===== */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 560px;
}
.inline-form > select, .inline-form > input { flex: 1 1 220px; width: auto; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.danger-zone { border-color: var(--danger-border); }
.danger-zone .card-title .ti { color: var(--danger-text); }
@media (max-width: 900px) {
  .hide-md { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
}
.home-empty { padding: 60px 20px; }
.notif-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.notif-card.is-unread .notif-icon { background: var(--primary-soft); color: var(--primary-text); }
.notif-open-form { margin: 0; }
.notif-open {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: start;
  color: inherit;
  cursor: pointer;
}
.notif-open:hover .notif-title { text-underline-offset: 2px; }
.notif-card .notif-title { color: var(--text-2); }
.notif-card.is-unread .notif-title { color: var(--text); font-weight: 600; }
.notif-mark { margin: 0; }
.notif-dot-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  background: none;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}
.notif-dot-btn:hover { background: var(--hover); }
.notif-dot-btn .notif-unread-dot { margin: 0; }
.notif-history { margin-top: 4px; font-size: var(--fs-xs); }
.notif-history summary {
  cursor: pointer;
  color: var(--text-3);
  font-weight: 500;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.notif-history summary::-webkit-details-marker { display: none; }
.notif-history summary:hover { color: var(--text); }
.notif-history-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  border-inline-start: 2px solid var(--border);
  padding-inline-start: 12px;
}
.notif-history-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
}
.notif-history-list time { color: var(--text-4); white-space: nowrap; }
@media (max-width: 640px) {
  .notif-card { grid-template-columns: minmax(0, 1fr) auto; }
  .notif-card .notif-icon { display: none; }
}
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.settings-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none !important;
}
.settings-card-icon {
  flex: none;
  display: grid;
  place-items: center;
}
.settings-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.settings-card-copy small { color: var(--text-3); line-height: 1.45; }
.settings-card-arrow { color: var(--text-4); }
.settings-section {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
}
.settings-section + .settings-section, .settings-section + .settings-card { margin-top: 16px; }
.settings-section-head h2 { font-weight: 650; }
.settings-section-head p {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-top: 4px;
}
@media (max-width: 800px) {
  .settings-section { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  min-width: 0;
}
.profile-head-copy { min-width: 0; }
.admin-directory-toolbar { flex-wrap: wrap; }
.admin-search { width: min(320px, 100%); }
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none !important;
  min-width: 0;
  max-width: 340px;
}
.user-cell-copy {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}
.user-cell-copy strong { color: var(--text); }
.user-cell-copy small { color: var(--text-3); font-size: var(--fs-xs); }
.module-access-row {
  display: grid;
  gap: 12px;
  padding: 16px 0;
}
.module-access-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.module-access-logo { border-radius: 8px; }
.module-access-name {
  display: grid;
  flex: 1;
  min-width: 140px;
}
.security-actions-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.security-actions-list form { margin: 0; }
.admin-delete-user-form {
  display: grid;
  gap: 12px;
  max-width: 460px;
}
.module-admin-list { display: grid; gap: 12px; }
.module-admin-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
}
.module-admin-logo { border-radius: 12px; flex: none; }
.module-admin-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.module-admin-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.module-admin-name { font-size: var(--fs-lg); }
.module-admin-desc { font-size: var(--fs-sm); color: var(--text-3); }
.module-admin-actions {
  display: grid;
  gap: 6px;
  width: 180px;
  flex: none;
}
.module-validation-errors ul { margin: 4px 0 0; padding-inline-start: 18px; }
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.upload-row input[type=file] { flex: 1; min-width: 0; }
@media (max-width: 700px) {
  .module-admin-row { flex-wrap: wrap; }
  .module-admin-actions { width: 100%; grid-template-columns: 1fr 1fr; }
}
.role-definition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.role-definition-card, .module-role-admin-card {
  display: grid;
  gap: 8px;
  align-content: start;
}
.role-definition-card p, .module-role-admin-card p { font-size: var(--fs-sm); color: var(--text-3); }
.role-definition-card code {
  justify-self: start;
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 5px;
}
.module-role-admin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.permission-checklist {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.permission-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.permission-chip .ti { color: var(--success); margin-top: 2px; }
.settings-kv { padding: 6px 20px; }
.settings-kv dt, .settings-kv dd { padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.settings-kv dt:last-of-type, .settings-kv dd:last-of-type { border-bottom: 0; }
.metric-value-sm { font-size: 18px; }
.pwa-feature-card {
  display: grid;
  gap: 12px;
  align-content: start;
}
.pwa-feature-copy h2 { font-size: var(--fs-md); font-weight: 650; }
.pwa-feature-copy p {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-top: 4px;
}
.pwa-feature-card .btn-primary { justify-self: start; }
.pwa-status { font-size: var(--fs-sm); color: var(--text-2); }
.pwa-settings-list { display: grid; }
.pwa-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.pwa-setting-row:hover { background: var(--surface-hover); }
.pwa-setting-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pwa-setting-row strong { font-size: var(--fs-sm); font-weight: 600; }
.pwa-setting-row small {
  font-size: 11px;
  color: var(--text-4);
  overflow-wrap: anywhere;
}
.pwa-master-setting { background: var(--surface-2); }
.pwa-settings-foot {
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
}
.pwa-admin-card + .pwa-admin-card, .metrics + .pwa-admin-card { margin-top: 16px; }
.pwa-admin-note { font-size: var(--fs-sm); color: var(--text-2); }
.pwa-last-attempt {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: var(--fs-sm);
}
.status-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.error-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 48px 24px;
  margin-top: 6vh;
}
.error-code {
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-block {
  display: grid;
  gap: 10px;
  text-align: center;
}
.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 44%) minmax(0, 1fr);
}
.auth-aside {
  position: relative;
  overflow: hidden;
  color: #fff;
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 80%);
}
.auth-aside-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
}
.auth-aside-copy { margin-top: auto; }
.auth-aside-copy h2 { color: #fff; }
.auth-aside-copy p { margin-top: 12px; max-width: 420px; }
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  min-width: 0;
}
.auth-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.auth-brand-mobile { display: none; margin-inline-end: auto; }
.auth-lang > a { min-width: 40px; justify-content: center; }
.auth-card {
  width: min(400px, 100%);
  margin: auto 0;
  padding: 32px 0;
  display: grid;
}
.auth-subtitle { color: var(--text-3); }
.auth-foot { font-size: var(--fs-xs); color: var(--text-4); }
@media (max-width: 900px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr); }
  .auth-brand-mobile { display: flex; }
  .auth-card { background: var(--surface); border: 1px solid var(--border); }
  .auth-main { padding: 16px; }
}
@media (max-width: 480px) {
  .admin-users-table thead { display: none; }
  .admin-users-table tr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .admin-users-table td { border: 0; padding: 0; }
  .admin-users-table td:first-child { flex: 1; min-width: 0; }
  .admin-users-table tbody tr:hover td { background: none; }
  .admin-users-table .num .btn-ghost { padding: 0 6px; }
}
.metric-label .ti { display: none; }
.admin-directory-toolbar { border-bottom: 1px solid var(--border-subtle); }
.notif-more {
  display: flex;
  justify-content: center;
  padding: 18px 0;
}
.notif-card:last-child { border-bottom: 0; }
.notif-filter { margin-bottom: 4px; }
.notif-page .notif-filter { margin-bottom: 6px; }
.notif-card {
  position: relative;
  padding: 13px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  border-bottom: 0;
  transition: background-color .12s;
}
.notif-card + .notif-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 10px;
  height: 1px;
  background: var(--border-subtle);
}
.notif-card:hover { background: var(--hover); }
.notif-card:hover::before, .notif-card:hover + .notif-card::before { opacity: 0; }
.notif-card .notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.notif-card.is-unread .notif-icon { border-color: transparent; }
.notif-card .notif-title { font-size: 14px; }
.notif-open:hover .notif-title { text-decoration: none; color: var(--primary-text); }
.settings-grid { gap: 14px; }
.settings-card {
  box-shadow: var(--shadow-card);
  transition: border-color .15s, box-shadow .2s var(--ease), transform .15s var(--ease);
}
.settings-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-raise);
  transform: translateY(-1px);
}
.settings-card-icon .ti { font-size: 19px; }
.settings-card:hover .settings-card-icon {
  color: var(--primary-text);
  background: var(--primary-soft);
  border-color: transparent;
}
.settings-card-copy strong { font-weight: 600; }
.settings-card-arrow { transition: transform .15s var(--ease), color .15s; }
.settings-card:hover .settings-card-arrow { color: var(--text-2); transform: translateX(2px); }
html[dir="rtl"] .settings-card:hover .settings-card-arrow { transform: scaleX(-1) translateX(2px); }
.settings-section-head h2 { font-size: 15px; }
.profile-head .avatar.xl { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
.admin-directory-toolbar { background: transparent; }
.admin-users-table .badge-primary, .admin-users-table .pill-primary {
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 500;
}
.admin-users-table .badge-neutral, .admin-users-table .pill-neutral {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text-2);
  font-weight: 500;
}
.user-cell-copy strong { font-weight: 600; }
.module-admin-row { border-radius: var(--radius-card); }
.module-admin-logo { box-shadow: var(--shadow-card); }
.error-panel { gap: 12px; }
.error-code { font-size: 64px; letter-spacing: -.05em; }
.auth-aside-copy h2 { font-weight: 650; }
html[dir="rtl"] .auth-aside-copy h2 { letter-spacing: 0; line-height: 1.35; }
.auth-aside-copy p { line-height: 1.6; color: rgba(255,255,255,.7); }
.auth-card { width: min(380px, 100%); gap: 16px; }
.auth-title { font-weight: 650; }
html[dir="rtl"] .auth-title { letter-spacing: 0; }
.auth-subtitle {
  font-size: 14.5px;
  margin-top: -8px;
  line-height: 1.5;
}
.auth-form { gap: 18px; margin-top: 8px; }
.auth-form input { min-height: 44px; font-size: 15px; }
.auth-form .btn-lg {
  --btn-h: 46px;
  margin-top: 6px;
  font-size: 15px;
  border-radius: 10px;
}
.auth-form .field-row a { font-weight: 550; }
@media (max-width: 900px) {
  .auth-card { padding: 28px 24px; border-color: var(--border); }
}

/* ===== Product design system: themes, typography, components, screens ===== */
:root {
  --bg: #f3f4f7;
  --bg-subtle: #eceef2;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --surface-hover: #f5f6f9;
  --hover: rgba(15, 23, 42, .045);
  --border: #e3e6ec;
  --border-subtle: #edeff3;
  --border-strong: #d2d7e0;
  --text: #0c1220;
  --text-2: #3f4a5e;
  --text-3: #687286;
  --text-4: #9aa2b2;
  --primary: #3355f0;
  --primary-hover: #2746dc;
  --primary-press: #1d3bc7;
  --primary-soft: #eef1ff;
  --primary-soft-2: #dfe5ff;
  --primary-text: #2443d6;
  --primary-ring: rgba(51, 85, 240, .22);
  --ink: #0d1322;
  --ink-2: #151c2e;
  --ink-3: #1d2539;
  --ink-line: rgba(255, 255, 255, .07);
  --ink-text: #c7cedc;
  --ink-muted: #7e889c;
  --ink-strong: #ffffff;
  --st-pending: #b25e09;
  --st-pending-bg: #fff4e5;
  --st-pending-dot: #f59e0b;
  --st-accepted: #0b6aa2;
  --st-accepted-bg: #eaf6fd;
  --st-accepted-dot: #0ea5e9;
  --st-progress: #2443d6;
  --st-progress-bg: #eef1ff;
  --st-progress-dot: #3355f0;
  --st-done: #0f7a4d;
  --st-done-bg: #e9f8f0;
  --st-done-dot: #16a34a;
  --st-declined: #b42318;
  --st-declined-bg: #fef1f0;
  --st-declined-dot: #ef4444;
  --st-action: #5b2bd6;
  --st-action-bg: #f3efff;
  --st-action-dot: #7c4dff;
  --radius-card: 16px;
  --radius-ctl: 10px;
  --shadow-card: 0 1px 2px rgba(12, 18, 32, .04), 0 1px 1px rgba(12, 18, 32, .02);
  --shadow-float: 0 1px 2px rgba(12, 18, 32, .05), 0 8px 24px -8px rgba(12, 18, 32, .12);
  --shadow-pop: 0 0 0 1px rgba(12, 18, 32, .05), 0 12px 32px -8px rgba(12, 18, 32, .22), 0 4px 10px -4px rgba(12, 18, 32, .08);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --content-max: 1240px;
  --sidebar-w: 256px;
}
html[data-theme="dark"] {
  --bg: #090c13;
  --bg-subtle: #0c1018;
  --surface: #11151e;
  --surface-2: #151a25;
  --surface-3: #1b2130;
  --surface-hover: #171d29;
  --hover: rgba(255, 255, 255, .045);
  --border: #222938;
  --border-subtle: #1a202c;
  --border-strong: #303a4d;
  --text: #eef1f7;
  --text-2: #b7bfce;
  --text-3: #848fa3;
  --text-4: #5b6679;
  --primary: #6f8bff;
  --primary-hover: #86a0ff;
  --primary-soft: rgba(111, 139, 255, .13);
  --primary-soft-2: rgba(111, 139, 255, .22);
  --primary-text: #a7b8ff;
  --ink: #0b0f18;
  --ink-2: #121826;
  --ink-3: #1a2233;
  --st-pending: #fbbf54;
  --st-pending-bg: rgba(245, 158, 11, .13);
  --st-accepted: #7dd3fc;
  --st-accepted-bg: rgba(14, 165, 233, .13);
  --st-progress: #a7b8ff;
  --st-progress-bg: rgba(111, 139, 255, .14);
  --st-done: #6ee7a8;
  --st-done-bg: rgba(22, 163, 74, .14);
  --st-declined: #fca5a5;
  --st-declined-bg: rgba(239, 68, 68, .14);
  --st-action: #c4b1ff;
  --st-action-bg: rgba(124, 77, 255, .16);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-float: 0 10px 28px -10px rgba(0, 0, 0, .7);
  --shadow-pop: 0 0 0 1px var(--border), 0 18px 44px -12px rgba(0, 0, 0, .75);
}
body {
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -.004em;
  background: var(--bg);
}
html[lang="ar"] body, html[dir="rtl"] body {
  font-size: 14.5px;
  line-height: 1.7;
  letter-spacing: 0;
}
html[lang="ar"] :is(h1, h2, h3, h4, .page-title, .ph-title, strong, b) { letter-spacing: 0 !important; }
html[lang="ar"] :is(h1, h2, .page-title, .ph-title) { font-weight: 700; }
.eyebrow, .ph-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
}
html[lang="ar"] :is(.eyebrow, .ph-eyebrow) {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
}
.sidebar {
  background: var(--ink);
  border-inline-end: 1px solid var(--ink-line);
  color: var(--ink-text);
  width: var(--sidebar-w);
}
.sidebar-head { height: auto; padding: 18px 16px 14px; }
.sidebar-brand { gap: 11px; color: var(--ink-strong); }
.brand-tile {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(180deg, #ffffff, #e9edf7);
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 4px 10px -2px rgba(0,0,0,.45);
}
.brand-tile img { width: 22px; height: 22px; }
.brand-copy {
  display: grid;
  line-height: 1.2;
  min-width: 0;
}
.brand-name {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.015em;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 500;
}
.sidebar-close { color: var(--ink-text); }
.sidebar-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav { padding: 4px 12px 16px; gap: 2px; }
.nav-label {
  padding: 18px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.nav-label-top { padding-top: 6px; }
html[lang="ar"] .nav-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}
.nav-item {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-text);
  font-weight: 500;
  font-size: 14px;
  gap: 12px;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav-item .ti {
  color: var(--ink-muted);
  font-size: 18px;
  transition: color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item:hover .ti { color: #dfe4ee; }
.nav-item.active, html[data-theme="dark"] .nav-item.active {
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.07));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.25);
}
.nav-item.active .ti { color: #9db1ff; }
.nav-count {
  background: #4f6bff;
  color: #fff;
  box-shadow: none;
  font-weight: 700;
}
html[data-theme="dark"] .nav-count { color: #fff; }
.nav-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.nav-sub {
  border-inline-start-color: var(--ink-line);
  margin-inline-start: 21px;
  padding-inline-start: 10px;
}
.nav-sub-item {
  min-height: 32px;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.nav-sub-item.active, html[data-theme="dark"] .nav-sub-item.active {
  background: rgba(255,255,255,.07);
  box-shadow: none;
  color: #fff;
}
.sidebar-foot { border-top: 1px solid var(--ink-line); padding: 12px; }
.sidebar-user { padding: 8px; border-radius: 12px; }
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-user-copy strong { color: #fff; }
.sidebar-user-copy small { color: var(--ink-muted); }
.sidebar .avatar { box-shadow: 0 0 0 2px var(--ink); }
.sidebar .logout-btn { color: var(--ink-muted); }
.sidebar .logout-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.topbar { background: color-mix(in srgb, var(--bg) 86%, transparent); padding: 0 32px; }
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--border); }
.crumb { font-size: 13.5px; }
.content { padding: 8px 48px 80px; }
.page { max-width: var(--content-max); }
@media (max-width: 1023.98px) {
  .sidebar { background: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
  .topbar { padding: 0 12px; padding-top: env(safe-area-inset-top); }
  .content { padding: 4px 20px 48px; }
  .topbar-brand { padding: 4px; }
  .topbar-brand img { width: 26px; height: 26px; }
}
@media (max-width: 640px) {
  .content { padding: 2px 16px 40px; }
}
.ph {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin: 12px 0 28px;
}
.ph-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.ph-title, .page-title {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.03em;
  line-height: 1.12;
  color: var(--text);
}
.ph-sub {
  font-size: 14.5px;
  color: var(--text-3);
  max-width: 640px;
  line-height: 1.5;
}
.ph-sub b, .ph-sub strong { color: var(--text); font-weight: 600; }
.ph-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.page-header { margin: 12px 0 26px; align-items: flex-end; }
@media (max-width: 640px) {
  .ph {
    margin: 6px 0 20px;
    align-items: flex-start;
    flex-wrap: nowrap;
  }
  .ph-title, .page-title { font-size: 24px; }
  .ph-sub { font-size: 13.5px; }
  .ph-actions .btn-primary:not(.btn-icon) { --btn-h: 38px; padding: 0 14px; }
  .page-header { margin: 6px 0 18px; }
}
.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger-solid {
  --btn-h: 38px;
  border-radius: var(--radius-ctl);
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
}
.btn-sm {
  --btn-h: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 9px;
}
.btn-lg {
  --btn-h: 46px;
  padding: 0 20px;
  font-size: 15px;
  border-radius: 12px;
}
.btn-primary, .btn.btn-primary {
  background: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 80%, #000);
  box-shadow: 0 1px 2px rgba(20, 38, 140, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px -2px rgba(51, 85, 240, .55), inset 0 1px 0 rgba(255,255,255,.18);
}
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn.btn-primary { color: #0a0e18; border-color: transparent; }
.btn-secondary, .btn.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(12, 18, 32, .05);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-hover); }
html[data-theme="dark"] .btn-secondary { background: var(--surface-2); }
.btn-ghost { color: var(--text-2); }
.btn-icon { width: var(--btn-h); padding: 0; }
.icon-btn { border-radius: 10px; color: var(--text-3); }
.icon-btn:hover { color: var(--text); }
kbd, .kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input:not([type]),
select,
textarea,
.input {
  border-radius: var(--radius-ctl);
  border-color: var(--border);
  min-height: 40px;
  box-shadow: 0 1px 2px rgba(12, 18, 32, .04);
}
.field > label, .form-field > label, .field-label, .field-row > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
html[lang="ar"] :is(.field > label, .field-row > label) { font-size: 13.5px; }
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}
html[data-theme="dark"] .seg { background: var(--surface-2); }
.seg::-webkit-scrollbar { display: none; }
.seg > .tab, .seg > a, .seg > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  margin: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s;
}
.seg > .tab::after { display: none !important; }
.seg > .tab:hover, .seg > a:hover, .seg > button:hover { color: var(--text); }
.seg > .is-active, .seg > .active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(12, 18, 32, .08), 0 0 0 1px rgba(12, 18, 32, .04);
}
html[data-theme="dark"] .seg > .is-active, html[data-theme="dark"] .seg > .active { background: var(--surface-3); box-shadow: none; }
.seg .count {
  background: var(--surface-3);
  color: var(--text-3);
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  font-size: 11px;
}
.seg > .is-active .count { background: var(--primary-soft); color: var(--primary-text); }
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.search-field > .ti {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--text-4);
  font-size: 16px;
  pointer-events: none;
}
.search-field input {
  padding-inline: 36px 40px;
  min-height: 38px;
  background: var(--surface);
  font-size: 13.5px;
}
.search-field .kbd {
  position: absolute;
  inset-inline-end: 9px;
  pointer-events: none;
}
.search-field input:focus ~ .kbd, .search-field input:not(:placeholder-shown) ~ .kbd { display: none; }
.st {
  --c: var(--text-2);
  --b: var(--surface-3);
  --d: var(--text-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px 0 8px;
  border-radius: 7px;
  background: var(--b);
  color: var(--c);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  flex: none;
}
.st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--d);
  flex: none;
}
.st-pending {
  --c: var(--st-pending);
  --b: var(--st-pending-bg);
  --d: var(--st-pending-dot);
}
.st-accepted {
  --c: var(--st-accepted);
  --b: var(--st-accepted-bg);
  --d: var(--st-accepted-dot);
}
.st-in_progress, .st-progress {
  --c: var(--st-progress);
  --b: var(--st-progress-bg);
  --d: var(--st-progress-dot);
}
.st-done {
  --c: var(--st-done);
  --b: var(--st-done-bg);
  --d: var(--st-done-dot);
}
.st-declined {
  --c: var(--st-declined);
  --b: var(--st-declined-bg);
  --d: var(--st-declined-dot);
}
.st-action {
  --c: var(--st-action);
  --b: var(--st-action-bg);
  --d: var(--st-action-dot);
}
.st-neutral {
  --c: var(--text-2);
  --b: var(--surface-3);
  --d: var(--text-4);
}
.st-in_progress::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--d) 22%, transparent); }
.due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
}
.due .ti { font-size: 13.5px; color: var(--text-4); }
.due.due-overdue {
  color: var(--st-declined);
  background: var(--st-declined-bg);
  border-color: transparent;
}
.due.due-overdue .ti, .due.due-today .ti, .due.due-soon .ti { color: currentColor; }
.due.due-today, .due.due-soon {
  color: var(--st-pending);
  background: var(--st-pending-bg);
  border-color: transparent;
}
.due.due-met { color: var(--text-3); }
.prio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}
.prio .ti { font-size: 14px; }
.prio-high { color: #dc2626; }
html[data-theme="dark"] .prio-high { color: #f87171; }
.prio-low { color: var(--text-4); }
.ref-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
  letter-spacing: 0;
}
.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.surface-pad { padding: 20px 22px; }
.sec { min-width: 0; }
.sec + .sec { margin-top: 28px; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  min-height: 28px;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.015em;
  color: var(--text);
}
.sec-title .count { background: var(--surface-3); color: var(--text-2); }
.sec-sub { font-size: 13px; color: var(--text-3); }
.rows {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: grid;
}
.row-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 14px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none !important;
  min-width: 0;
  transition: background-color .12s var(--ease);
}
.rows > li + li > .row-link::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 14px;
  height: 1px;
  background: var(--border-subtle);
}
a.row-link:hover, button.row-link:hover { background: var(--hover); }
.rows > li:hover + li > .row-link::before, .rows > li:hover > .row-link::before { opacity: 0; }
.row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.row-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.008em;
}
.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.row-meta > .truncate { flex: 0 1 auto; }
.row-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-4);
  flex: none;
}
.row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.row-chev {
  color: var(--text-4);
  font-size: 16px;
  transition: transform .15s var(--ease), color .15s;
}
a.row-link:hover .row-chev { color: var(--text-2); transform: translateX(2px); }
html[dir="rtl"] a.row-link:hover .row-chev { transform: scaleX(-1) translateX(2px); }
.empty-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  color: var(--text-3);
  font-size: 13.5px;
}
.empty-inline .ti {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--st-done-bg);
  color: var(--st-done);
  font-size: 18px;
  flex: none;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.kpi {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none !important;
  transition: border-color .15s, box-shadow .2s var(--ease), transform .15s var(--ease);
  min-width: 0;
}
a.kpi:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-float);
  transform: translateY(-1px);
}
.kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 0;
}
.kpi-label .ti {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--surface-3);
  color: var(--text-3);
  flex: none;
}
.kpi-value {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}
.kpi.is-zero .kpi-value { color: var(--text-4); }
.kpi.tone-danger .kpi-label .ti { background: var(--st-declined-bg); color: var(--st-declined); }
.kpi.tone-warning .kpi-label .ti { background: var(--st-pending-bg); color: var(--st-pending); }
.kpi.tone-primary .kpi-label .ti { background: var(--st-progress-bg); color: var(--st-progress); }
.kpi.tone-success .kpi-label .ti { background: var(--st-done-bg); color: var(--st-done); }
.kpi.tone-violet .kpi-label .ti { background: var(--st-action-bg); color: var(--st-action); }
.kpi.tone-danger:not(.is-zero) .kpi-value { color: var(--st-declined); }
.kpi.is-alert:not(.is-zero) {
  border-color: color-mix(in srgb, var(--st-declined-dot) 30%, var(--border));
  box-shadow: inset 3px 0 0 var(--st-declined-dot), var(--shadow-card);
}
html[dir="rtl"] .kpi.is-alert:not(.is-zero) { box-shadow: inset -3px 0 0 var(--st-declined-dot), var(--shadow-card); }
.kpi.is-warn:not(.is-zero) { box-shadow: inset 3px 0 0 var(--st-pending-dot), var(--shadow-card); }
html[dir="rtl"] .kpi.is-warn:not(.is-zero) { box-shadow: inset -3px 0 0 var(--st-pending-dot), var(--shadow-card); }
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; gap: 8px; }
  .kpi-value { font-size: 26px; }
  .kpi-hint { display: none; }
}
.empty-state { padding: 56px 24px; gap: 10px; }
.empty-icon, .empty-state > .ti {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 24px;
  margin-bottom: 8px;
  background: var(--surface);
  color: var(--primary-text);
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px -10px rgba(51, 85, 240, .35), 0 0 0 8px color-mix(in srgb, var(--primary-soft) 55%, transparent);
}
.empty-title { font-size: 16px; font-weight: 650; }
.empty-text { font-size: 13.5px; max-width: 400px; }
.ui-dialog-backdrop {
  background: rgba(9, 12, 20, .48);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ui-dialog-panel {
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
  border: 0;
}
.ui-dialog-head { padding: 24px 26px 4px; }
.ui-dialog-head h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.02em;
}
.ui-dialog-body { padding: 18px 26px 22px; }
.ui-dialog-foot { padding: 14px 26px; background: var(--surface-2); }
.menu {
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  border: 0;
}
html[data-theme="dark"] .menu { background: var(--surface-2); }
@media (max-width: 640px) {
  .ui-dialog-panel { border-radius: 24px 24px 0 0; }
  .ui-dialog-head { padding: 12px 20px 4px; }
  .ui-dialog-body { padding: 14px 20px 18px; }
  .ui-dialog-foot { padding: 12px 20px max(14px, env(safe-area-inset-bottom)); }
}
.home2-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px 32px;
  padding: 28px 30px;
  margin: 12px 0 24px;
  border-radius: 22px;
  color: #fff;
  background: radial-gradient(600px 260px at 100% 0%, rgba(111, 139, 255, .38), transparent 60%),
    radial-gradient(420px 220px at 0% 120%, rgba(124, 77, 255, .28), transparent 60%),
    var(--ink);
  box-shadow: 0 18px 40px -22px rgba(13, 19, 34, .6);
}
html[dir="rtl"] .home2-hero {
  background: radial-gradient(600px 260px at 0% 0%, rgba(111, 139, 255, .38), transparent 60%), radial-gradient(420px 220px at 100% 120%, rgba(124, 77, 255, .28), transparent 60%), var(--ink);
}
.home2-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
}
.home2-hero > * { position: relative; z-index: 1; }
.home2-date {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,.62);
  text-transform: uppercase;
  letter-spacing: .07em;
}
html[lang="ar"] .home2-date {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.home2-greet {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -.032em;
  line-height: 1.1;
  color: #fff;
  margin-top: 8px;
}
.home2-focus {
  margin-top: 10px;
  font-size: 15.5px;
  color: rgba(255,255,255,.78);
}
.home2-focus b { color: #fff; font-weight: 650; }
.home2-hero .btn-primary {
  background: #fff;
  color: var(--ink);
  border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.5);
}
.home2-hero .btn-primary:hover { background: #eef1ff; }
.home2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.home2-side {
  display: grid;
  gap: 24px;
  min-width: 0;
}
.home2-list .row-link { min-height: 64px; }
.home2-mark {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--border);
  flex: none;
  margin-block: 4px;
}
.home2-mark.tone-danger { background: var(--st-declined-dot); }
.home2-mark.tone-warning { background: var(--st-pending-dot); }
.home2-mark.tone-violet { background: var(--st-action-dot); }
.home2-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  text-decoration: none !important;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.home2-notice .ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--st-pending-bg);
  color: var(--st-pending);
  font-size: 18px;
  flex: none;
}
.home2-notice .txt {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
  font-size: 13.5px;
  font-weight: 600;
}
.home2-notice .txt small {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.home2-notice .go {
  font-size: 13px;
  font-weight: 650;
  color: var(--primary-text);
  white-space: nowrap;
}
.feed {
  list-style: none;
  margin: 0;
  padding: 4px 6px 6px;
  display: grid;
}
.feed-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none !important;
}
a.feed-item:hover { background: var(--hover); }
.feed-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-3);
  font-size: 15px;
}
.feed-item.is-unread .feed-ico {
  background: var(--primary-soft);
  color: var(--primary-text);
  border-color: transparent;
}
.feed-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.feed-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-meta {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-meta .what { color: var(--text-2); }
.meet-mini {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none !important;
}
.meet-mini:hover { background: var(--hover); }
.date-tile {
  width: 44px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.05;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: none;
}
.date-tile b {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.date-tile small {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-text);
  text-transform: uppercase;
  letter-spacing: .04em;
}
@media (max-width: 1100px) {
  .home2-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .home2-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 20px 20px;
    border-radius: 20px;
    margin: 6px 0 20px;
  }
  .home2-greet { font-size: 26px; }
  .home2-focus { font-size: 14.5px; }
}
.nt-list { padding: 6px; }
.nt-day {
  padding: 14px 14px 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
html[lang="ar"] .nt-day {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.nt-item {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
}
.nt-item:hover { background: var(--hover); }
.nt-item + .nt-item::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 14px;
  height: 1px;
  background: var(--border-subtle);
}
.nt-item:hover::before, .nt-item:hover + .nt-item::before { opacity: 0; }
.nt-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-3);
}
.nt-item.is-unread .nt-ico {
  background: var(--primary-soft);
  color: var(--primary-text);
  border-color: transparent;
}
.nt-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.nt-open {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: start;
  color: inherit;
  cursor: pointer;
}
.nt-subject {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nt-item:not(.is-unread) .nt-subject { font-weight: 550; color: var(--text-2); }
.nt-what {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-3);
  min-width: 0;
}
.nt-what .grp {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
}
.nt-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}
.nt-time {
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.nt-mark { margin: 0; }
.nt-mark button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.nt-mark button:hover { background: var(--hover); }
.nt-open:hover .nt-subject { color: var(--primary-text); }
@media (max-width: 640px) {
  .nt-item {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 10px;
  }
  .nt-ico {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .nt-subject {
    font-size: 14px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
.settings-card {
  border-radius: 16px;
  padding: 20px;
  gap: 16px;
}
.settings-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-text);
  border: 0;
}
.settings-card-copy strong { font-size: 15px; }
.settings-card-copy small { font-size: 12.5px; }
.card, .panel { border-radius: var(--radius-card); }
.table th {
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.table td { padding: 14px 16px; border-bottom-color: var(--border-subtle); }
.admin-users-table .badge { height: 22px; border-radius: 7px; }
.metric { border-radius: 16px; padding: 18px 20px; }
.metric-value { font-size: 30px; }
.auth-body { background: var(--surface); }
.auth-screen { grid-template-columns: minmax(420px, 46%) minmax(0, 1fr); }
.auth-aside {
  margin: 12px;
  border-radius: 24px;
  padding: 48px;
  background: radial-gradient(700px 380px at 110% -10%, rgba(111, 139, 255, .42), transparent 60%),
    radial-gradient(520px 300px at -10% 110%, rgba(124, 77, 255, .32), transparent 60%),
    var(--ink);
}
.auth-aside::after { background-size: 32px 32px; }
.auth-brand .brand-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.auth-brand .brand-tile img { width: 26px; height: 26px; }
.auth-aside-copy h2 {
  line-height: 1.08;
  letter-spacing: -.035em;
  max-width: 480px;
}
html[lang="ar"] .auth-aside-copy h2 { line-height: 1.3; }
.auth-aside-copy p { font-size: 16px; }
.auth-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 0;
}
.auth-proof > div {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  display: grid;
  gap: 8px;
}
.auth-proof .ti {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(143, 168, 255, .16);
  color: #b7c6ff;
  font-size: 16px;
}
.auth-proof span {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  line-height: 1.4;
}
.auth-card { width: min(380px, 100%); }
.auth-title { font-size: 30px; letter-spacing: -.03em; }
@media (max-width: 900px) {
  .auth-aside { display: none; }
  .auth-card { border-radius: 22px; box-shadow: var(--shadow-float); }
}
@media (max-width: 1023.98px) {
  .bottom-nav {
    inset-inline: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    height: 64px;
    padding: 6px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--ink) 92%, transparent);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 16px 36px -12px rgba(9, 12, 20, .55);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }
  .bottom-nav-item {
    color: var(--ink-muted);
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 14px;
    gap: 2px;
  }
  .bottom-nav-item .ti {
    font-size: 21px;
    width: auto;
    height: auto;
    padding: 0;
    background: none !important;
    color: inherit !important;
  }
  .bottom-nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
  .bottom-nav-item.active .ti { color: #a9bbff !important; }
  body.has-bottomnav .content { padding-bottom: calc(64px + 36px + env(safe-area-inset-bottom)); }
  body.has-bottomnav .toast-region { bottom: calc(64px + 24px + env(safe-area-inset-bottom)); }
}
.notification-popover { width: 400px; border-radius: 16px; }
.notification-popover-header { padding: 16px 16px 10px; }
.notification-popover-header strong { font-size: 15px; }
.notif-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  align-items: start;
}
.notif-row > .notif-icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-3);
}
.notif-row.is-unread > .notif-icon {
  background: var(--primary-soft);
  color: var(--primary-text);
  border-color: transparent;
}
.notif-row.is-unread { background: transparent; }
.notif-row:hover, .notif-row.is-unread:hover { background: var(--hover); }
.notif-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-row:not(.is-unread) .notif-title { font-weight: 550; color: var(--text-2); }
.notif-meta {
  font-size: 12px;
  color: var(--text-3);
  gap: 6px;
  flex-wrap: wrap;
}
.notif-what { color: var(--text-2); }
.notif-unread-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  margin-top: 6px;
}
.notif-page .notif-history { margin-top: 6px; font-size: 12.5px; }
.notif-page .notif-history summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-3);
}
.notif-page .notif-more { padding: 12px 0 8px; }
.nt-group + .nt-group { border-top: 1px solid var(--border-subtle); margin-top: 4px; }
.kpi .progress { display: block; margin-top: 2px; }
.admin-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.settings-card { align-items: flex-start; }
.settings-card-copy small { margin-top: 2px; }
.auth-brand { color: #fff; }
.auth-brand-mobile { color: var(--text); }
.auth-brand-mobile .brand-tile { box-shadow: 0 0 0 1px var(--border), 0 4px 10px -4px rgba(12,18,32,.2); }
@media (max-width: 640px) {
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
.nt-what { flex-wrap: wrap; row-gap: 4px; }
.nt-what .grp { white-space: nowrap; }
@media (max-width: 640px) {
  .home2-hero .ph-actions { display: flex; margin-top: 2px; }
  .home2-hero .ph-actions .btn-primary {
    width: 100%;
    --btn-h: 44px;
    font-size: 14.5px;
  }
  .nt-side {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 6px;
  }
  .nt-time { font-size: 11.5px; }
}
@media (max-width: 480px) {
  .module-access-head > * { min-width: 0; }
  .module-access-name { min-width: 0; flex: 1 1 0; }
  .module-access-row .inline-form > select, .module-access-row .inline-form > input { flex: 1 1 100%; width: 100%; }
  .module-access-row .badge {
    white-space: normal;
    height: auto;
    min-height: 22px;
    padding: 3px 8px;
    line-height: 1.35;
    max-width: 100%;
  }
  .module-access-row form { max-width: 100%; }
}
:root:not([data-theme="dark"]) {
  --bg: #f6f7f9;
  --bg-subtle: #eff1f4;
  --surface-2: #f8f9fb;
  --border: #e5e8ee;
  --border-subtle: #eef0f3;
  --nav-bg: #fbfbfc;
  --nav-hover: rgba(15, 23, 42, .045);
}
:root:not([data-theme="dark"]) .sidebar {
  background: var(--nav-bg);
  border-inline-end: 1px solid var(--border);
  color: var(--text-2);
}
:root:not([data-theme="dark"]) .sidebar-brand, :root:not([data-theme="dark"]) .brand-name { color: var(--text); }
:root:not([data-theme="dark"]) .brand-sub { color: var(--text-3); }
:root:not([data-theme="dark"]) .brand-tile {
  background: #fff;
  box-shadow: 0 0 0 1px var(--border), 0 2px 6px -2px rgba(12, 18, 32, .12);
}
:root:not([data-theme="dark"]) .sidebar-close { color: var(--text-3); }
:root:not([data-theme="dark"]) .sidebar-close:hover { background: var(--nav-hover); color: var(--text); }
:root:not([data-theme="dark"]) .nav-label { color: var(--text-4); }
:root:not([data-theme="dark"]) .nav-item { color: var(--text-2); }
:root:not([data-theme="dark"]) .nav-item .ti { color: var(--text-3); }
:root:not([data-theme="dark"]) .nav-item:hover { background: var(--nav-hover); color: var(--text); }
:root:not([data-theme="dark"]) .nav-item:hover .ti { color: var(--text-2); }
:root:not([data-theme="dark"]) .nav-item.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(12, 18, 32, .06);
}
:root:not([data-theme="dark"]) .nav-item.active .ti { color: var(--primary); }
:root:not([data-theme="dark"]) .nav-count { background: var(--primary); color: #fff; }
:root:not([data-theme="dark"]) .nav-sub { border-inline-start-color: var(--border); }
:root:not([data-theme="dark"]) .nav-sub-item { color: var(--text-3); }
:root:not([data-theme="dark"]) .nav-sub-item:hover { background: var(--nav-hover); color: var(--text); }
:root:not([data-theme="dark"]) .nav-sub-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}
:root:not([data-theme="dark"]) .sidebar-foot { border-top-color: var(--border-subtle); }
:root:not([data-theme="dark"]) .sidebar-user:hover { background: var(--nav-hover); }
:root:not([data-theme="dark"]) .sidebar-user-copy strong { color: var(--text); }
:root:not([data-theme="dark"]) .sidebar-user-copy small { color: var(--text-3); }
:root:not([data-theme="dark"]) .sidebar .avatar { box-shadow: 0 0 0 2px var(--nav-bg); }
:root:not([data-theme="dark"]) .sidebar .logout-btn { color: var(--text-3); }
:root:not([data-theme="dark"]) .sidebar .logout-btn:hover { background: var(--nav-hover); color: var(--text); }
:root:not([data-theme="dark"]) .sidebar ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, .14); }
@media (max-width: 1023.98px) {
  :root:not([data-theme="dark"]) .sidebar { background: var(--surface); box-shadow: 0 20px 60px rgba(12, 18, 32, .18); }
  :root:not([data-theme="dark"]) .bottom-nav {
    background: color-mix(in srgb, #ffffff 88%, transparent);
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px -14px rgba(12, 18, 32, .22), 0 2px 6px rgba(12, 18, 32, .05);
  }
  :root:not([data-theme="dark"]) .bottom-nav-item { color: var(--text-3); }
  :root:not([data-theme="dark"]) .bottom-nav-item.active { color: var(--primary-text); background: var(--primary-soft); }
  :root:not([data-theme="dark"]) .bottom-nav-item.active .ti { color: var(--primary) !important; }
}
.home2-copy { grid-area: copy; min-width: 0; }
.home2-act { grid-area: act; }
.home2-hero { grid-template-areas: "copy act"; }
@media (max-width: 640px) {
  .home2-hero { grid-template-areas: "copy" "act"; }
}
:root:not([data-theme="dark"]) .home2-hero {
  background: none;
  box-shadow: none;
  color: var(--text);
  border-radius: 0;
  overflow: visible;
  padding: 6px 0 0;
  margin: 12px 0 28px;
  grid-template-areas: "copy act";
  align-items: end;
  gap: 24px 32px;
}
:root:not([data-theme="dark"]) .home2-hero::after { display: none; }
:root:not([data-theme="dark"]) .home2-date { color: var(--text-3); }
:root:not([data-theme="dark"]) .home2-greet {
  color: var(--text);
  font-size: 34px;
  letter-spacing: -.035em;
}
:root:not([data-theme="dark"]) .home2-focus { color: var(--text-2); }
:root:not([data-theme="dark"]) .home2-focus b { color: var(--text); }
:root:not([data-theme="dark"]) .home2-hero .btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: color-mix(in srgb, var(--primary) 80%, #000);
  box-shadow: 0 1px 2px rgba(20, 38, 140, .28), 0 8px 20px -10px rgba(51, 85, 240, .6), inset 0 1px 0 rgba(255, 255, 255, .18);
}
:root:not([data-theme="dark"]) .home2-hero .btn-primary:hover { background: var(--primary-hover); }
@media (max-width: 640px) {
  :root:not([data-theme="dark"]) .home2-hero {
    grid-template-areas: "copy" "act";
    padding: 0;
    margin: 6px 0 22px;
    gap: 16px;
  }
  :root:not([data-theme="dark"]) .home2-greet { font-size: 26px; }
}
.home2-mark.tone-info { background: var(--st-accepted-dot); }
.st-compact { padding-inline: 7px; }
:root:not([data-theme="dark"]) .auth-aside {
  color: var(--text);
  border: 1px solid #e2e7f6;
  background: radial-gradient(700px 380px at 110% -10%, rgba(51, 85, 240, .16), transparent 60%),
    radial-gradient(520px 300px at -10% 110%, rgba(124, 77, 255, .11), transparent 60%),
    linear-gradient(180deg, #f6f8ff, #eef1fb);
}
:root:not([data-theme="dark"]) .auth-aside::after {
  background-image: linear-gradient(rgba(51, 85, 240, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(51, 85, 240, .05) 1px, transparent 1px);
}
:root:not([data-theme="dark"]) .auth-brand { color: var(--text); }
:root:not([data-theme="dark"]) .auth-aside .brand-tile { background: #fff; box-shadow: 0 0 0 1px #e2e7f6, 0 6px 14px -6px rgba(51, 85, 240, .35); }
:root:not([data-theme="dark"]) .auth-aside-copy h2 { color: var(--text); }
:root:not([data-theme="dark"]) .auth-aside-copy p { color: var(--text-2); }
:root:not([data-theme="dark"]) .auth-proof > div {
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(51, 85, 240, .12);
  box-shadow: 0 1px 2px rgba(12, 18, 32, .04);
}
:root:not([data-theme="dark"]) .auth-proof .ti { background: var(--primary-soft); color: var(--primary); }
:root:not([data-theme="dark"]) .auth-proof span { color: var(--text-2); }
.ui-dialog-panel { animation-duration: .18s; }
.ui-dialog-backdrop { animation-duration: .14s; }
.menu { animation-duration: .12s; }
@media (max-width: 640px) {
  .ui-dialog-panel { animation-duration: .24s; }
}
.home2-side > .sec + .sec, .home2-main > .sec + .sec { margin-top: 0; }
.home2-main {
  display: grid;
  gap: 28px;
  min-width: 0;
  align-content: start;
}
.auth-aside-inner { gap: 24px; }
.auth-preview {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px 0 12px;
}
.auth-aside .auth-aside-copy { margin-top: 0; }
.auth-aside-copy h2 { font-size: 36px; }
html[lang="ar"] .auth-aside-copy h2 { font-size: 32px; }
.ap {
  position: relative;
  width: min(100%, 480px);
  text-align: start;
}
.ap-window {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 34px 64px -34px rgba(30, 45, 110, .42), 0 14px 28px -16px rgba(12, 18, 32, .14);
}
html[data-theme="dark"] .ap-window { box-shadow: 0 34px 70px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .04); }
.ap-bar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.ap-bar > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b61;
}
.ap-bar > i:nth-child(2) { background: #f7c04a; }
.ap-bar > i:nth-child(3) { background: #3fcf6a; }
.ap-addr {
  margin-inline-start: 10px;
  height: 10px;
  width: 38%;
  border-radius: 6px;
  background: var(--surface-3);
}
.ap-body { display: grid; grid-template-columns: 46px minmax(0, 1fr); }
.ap-side {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: 12px 7px;
  background: var(--nav-bg, var(--surface-2));
  border-inline-end: 1px solid var(--border-subtle);
}
html[data-theme="dark"] .ap-side { background: var(--ink); border-inline-end-color: var(--ink-line); }
.ap-logo {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--primary), #7c4dff);
}
.ap-nav {
  width: 30px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-4);
  font-size: 14px;
}
.ap-nav em { display: none; }
.ap-nav.is-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(12, 18, 32, .06);
}
html[data-theme="dark"] .ap-nav.is-active {
  background: rgba(255, 255, 255, .09);
  box-shadow: none;
  color: #a9bbff;
}
.ap-main {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px 16px 16px;
  min-width: 0;
}
.ap-greet { display: grid; gap: 1px; }
.ap-greet b {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -.015em;
}
.ap-greet small { font-size: 11px; color: var(--text-3); }
.ap-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ap-kpi {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}
.ap-kpi span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-kpi span i { font-size: 12px; flex: none; }
.ap-kpi b {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ap-kpi-danger i, .ap-kpi-danger b { color: var(--st-declined); }
.ap-kpi-progress i { color: var(--st-progress); }
.ap-kpi-done i { color: var(--st-done); }
.ap-list {
  display: grid;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.ap-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
}
.ap-row + .ap-row::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 6px;
  height: 1px;
  background: var(--border-subtle);
}
.ap-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.ap-lines {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.ap-lines em {
  display: block;
  height: 6px;
  border-radius: 4px;
  background: var(--surface-3);
  width: 42%;
}
.ap-lines em:first-child { height: 7px; background: color-mix(in srgb, var(--text) 20%, transparent); }
.ap-pill {
  font-size: 9.5px;
  font-weight: 650;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.ap-tone-action .ap-ico, .ap-pill-action { background: var(--st-action-bg); color: var(--st-action); }
.ap-tone-progress .ap-ico, .ap-pill-progress { background: var(--st-progress-bg); color: var(--st-progress); }
.ap-tone-accepted .ap-ico, .ap-pill-accepted { background: var(--st-accepted-bg); color: var(--st-accepted); }
.ap-tone-done .ap-ico, .ap-pill-done { background: var(--st-done-bg); color: var(--st-done); }
.ap-tone-action::after {
  content: "";
  position: absolute;
  inset-inline-start: -4px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--st-action-dot);
}
.ap-toast {
  position: absolute;
  inset-inline-end: -16px;
  bottom: -30px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px -16px rgba(12, 18, 32, .32);
  animation: ap-float 7s ease-in-out infinite;
}
html[data-theme="dark"] .ap-toast { background: var(--surface-2); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .7); }
.ap-toast-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--st-done-bg);
  color: var(--st-done);
  flex: none;
}
.ap-toast-copy { display: grid; gap: 1px; }
.ap-toast-copy b {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.ap-toast-copy small {
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
}
@keyframes ap-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.auth-aside .auth-preview { container-type: size; align-self: stretch; }
@container (max-height: 330px) {
  .auth-aside .ap { zoom: .86; }
}
@container (max-height: 285px) {
  .auth-aside .ap { zoom: .74; }
}
@container (max-height: 245px) {
  .auth-aside .ap { zoom: .62; }
}
@container (max-height: 205px) {
  .auth-aside .ap { zoom: .5; }
}
@container (max-height: 160px) {
  .auth-aside .ap { display: none; }
}
@media (min-width: 901px) and (max-height: 820px) {
  .auth-aside-copy h2 { font-size: 30px; }
  .auth-aside { padding: 36px 40px; }
}
.auth-mhero, .auth-mfeatures { display: none; }
@media (max-width: 900px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr); }
  .auth-main { padding: 16px 16px max(20px, env(safe-area-inset-bottom)); }
  .auth-mhero {
    display: grid;
    gap: 10px;
    width: min(520px, 100%);
    margin: 20px 0 4px;
  }
  .auth-mhero-title {
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--text);
  }
  html[lang="ar"] .auth-mhero-title {
    font-size: 26px;
    line-height: 1.35;
    letter-spacing: 0;
  }
  .auth-mhero-body {
    font-size: 14.5px;
    color: var(--text-2);
    line-height: 1.55;
  }
  .auth-mhero-preview {
    margin: 12px 0 22px;
    display: grid;
    justify-items: center;
  }
  .auth-mhero .ap { width: 100%; }
  .auth-mhero .ap-toast { inset-inline-end: 10px; bottom: -18px; }
  .auth-card { width: min(520px, 100%); margin: 14px 0 0; }
  .auth-mfeatures {
    display: grid;
    gap: 8px;
    width: min(520px, 100%);
    margin: 16px 0 20px;
  }
  .auth-mfeatures > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 550;
    color: var(--text-2);
  }
  .auth-mfeatures .ti {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 17px;
    background: var(--primary-soft);
    color: var(--primary-text);
  }
  .auth-foot { margin-top: auto; }
  :root:not([data-theme="dark"]) .auth-body {
    background: radial-gradient(520px 280px at 100% 0%, rgba(51, 85, 240, .10), transparent 65%), radial-gradient(420px 260px at 0% 30%, rgba(124, 77, 255, .07), transparent 60%), var(--bg);
    background-repeat: no-repeat;
  }
}
@media (max-width: 380px) {
  .ap-body { grid-template-columns: 38px minmax(0, 1fr); }
  .ap-main { padding: 12px 12px 14px; gap: 10px; }
  .ap-kpi { padding: 8px; }
  .ap-kpi span { font-size: 9px; }
  .ap-kpi b { font-size: 16px; }
  .ap-toast-copy small { display: none; }
}

/* ===== Home on phones: badges under the title ===== */
@media (max-width: 600px) {
  .home2-list .row-link {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr);
    grid-template-areas: "mark main" "mark side";
    column-gap: 12px;
    row-gap: 6px;
    padding-inline-end: 36px;
  }
  .home2-list .home2-mark { grid-area: mark; }
  .home2-list .row-main { grid-area: main; }
  .home2-list .row-side { grid-area: side; flex-wrap: wrap; gap: 6px; }
  .home2-list .row-chev { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); }
}

/* ===== Dialogs: the panel never scrolls itself (focus inside a long list scrolls only the body) ===== */
.ui-dialog-panel { overflow: clip; }

/* ===== Home: work board (tabs that show their requests in place) ===== */
.home2-mark.tone-primary { background: var(--st-progress-dot); }
.board {
  margin: 0 0 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
}
.board-title { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.board-sub { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.board-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 0 16px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.board-tab {
  --dot: var(--text-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color .12s, box-shadow .12s, color .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.board-tab:hover { background: var(--surface-3); }
.board-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--border); }
.board-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.board-tab-n { font-size: 24px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.board-tab.is-zero .board-tab-n { color: var(--text-4); }
.board-tab.tone-danger:not(.is-zero) .board-tab-n { color: var(--st-declined); }
.board-tab-l { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.board-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.board-tab.tone-neutral { --dot: var(--text); }
.board-tab.tone-danger { --dot: var(--st-declined-dot); }
.board-tab.tone-warning { --dot: var(--st-pending-dot); }
.board-tab.tone-info { --dot: var(--st-accepted-dot); }
.board-tab.tone-primary { --dot: var(--st-progress-dot); }
.board-panel { padding: 6px 8px 8px; }
.board-panel[hidden] { display: none; }
.board-hint { margin: 10px 12px 4px; font-size: 12.5px; color: var(--text-3); }
.board-panel .home2-list { margin: 0; }
.board-you {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-strong, var(--border));
}
.board-empty { display: flex; align-items: center; gap: 10px; padding: 22px 12px 24px; font-size: 13.5px; color: var(--text-3); }
.board-empty-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--st-done); background: var(--st-done-bg); }
.board-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px 4px 2px;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none !important;
}
.board-more:hover { background: var(--surface-2); color: var(--text); }
html[dir="rtl"] .board-more .ti { transform: scaleX(-1); }
@media (max-width: 1180px) and (min-width: 1024px), (max-width: 860px) {
  .board-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .board { border-radius: 16px; margin-bottom: 22px; }
  .board-head { padding: 14px 14px 10px; }
  .board-tabs { margin: 0 10px; }
  .board-tab { padding: 8px 10px 9px; }
  .board-tab-n { font-size: 21px; }
  .board-tab-l { font-size: 12px; }
  .board-panel { padding: 4px 4px 6px; }
  .board-hint { margin: 10px 10px 2px; }
}

/* ===== Phones/tablets: instant sidebar drawer =====
   Short ease-out, GPU-only transform, no full-screen blur, light shadow painted once. */
@media (max-width: 1023.98px) {
  .sidebar {
    transition: transform .18s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .18s;
    will-change: transform;
    contain: layout paint;
    overscroll-behavior: contain;
    box-shadow: none;
  }
  .sidebar.open { transition: transform .2s cubic-bezier(.32, .72, 0, 1), visibility 0s; box-shadow: 0 10px 34px rgba(12, 18, 32, .22); }
  :root:not([data-theme="dark"]) .sidebar { box-shadow: none; }
  :root:not([data-theme="dark"]) .sidebar.open { box-shadow: 0 10px 34px rgba(12, 18, 32, .16); }
  .sidebar-backdrop { transition: opacity .16s linear; touch-action: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sidebar-toggle, [data-open-sidebar] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
}
