/* ==========================================================================
   منصة إدارة الورش المؤسسية — design system (Warsha)
   Arabic-first, RTL-native. Logical properties only (inline-start/end).
   ========================================================================== */

@font-face { font-family: "Noto Sans Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 500; font-display: swap; src: url("../fonts/noto-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2713; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 500; font-display: swap; src: url("../fonts/noto-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2713; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2713; }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2713; }

:root {
  /* palette — approved */
  --bg: #F4EFE6;
  --sand: #D8C7AE;
  --primary: #9A8064;
  --primary-deep: #745335;
  --surface: #FFFFFF;
  --surface-alt: #F7F7F7;
  /* text & functional */
  --ink: #1A1611;
  --ink-secondary: #4A3B2C;
  --on-primary-deep: var(--surface);
  --border-control: var(--primary);
  --divider: var(--sand);
  --focus: var(--primary-deep);
  /* status */
  --success: #2E6B3A; --success-soft: #E4EFE2;
  --warning: #8A5300; --warning-soft: #F7EAD2;
  --danger: #A3261B;  --danger-soft: #F7E2DE;
  --info: #2B5C8A;    --info-soft: #E1EAF3;
  /* scales */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 10px;
  --font-arabic: "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-arabic); font-size: 16px; line-height: 28px; text-align: start; }
a { color: var(--primary-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
.display { font-size: 40px; line-height: 56px; font-weight: 700; }
h1, .h1 { font-size: 28px; line-height: 40px; font-weight: 700; }
h2, .h2 { font-size: 22px; line-height: 32px; font-weight: 700; }
h3, .h3 { font-size: 18px; line-height: 28px; font-weight: 600; }
p { margin: 0 0 var(--space-3); }
.body-sm { font-size: 14px; line-height: 24px; }
.caption { font-size: 12px; line-height: 18px; font-weight: 500; }
.muted { color: var(--ink-secondary); }
.nu { white-space: nowrap; }
bdi { unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--divider); margin: var(--space-6) 0; }

/* brand strip — echoes the system cover */
.brand-strip { display: flex; height: 6px; }
.brand-strip span:nth-child(1) { flex: 7; background: var(--primary-deep); }
.brand-strip span:nth-child(2) { flex: 4; background: var(--primary); }
.brand-strip span:nth-child(3) { flex: 6; background: var(--sand); }
.brand-strip span:nth-child(4) { flex: 1; background: var(--ink); }
.brand-strip span:nth-child(5) { flex: 2; background: var(--primary); }

/* ------------------------------------------------------------------ layout */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--space-4); }
.container-narrow { max-width: 820px; }
.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-8); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

/* public header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--divider); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 72px; }
.site-brand { display: flex; align-items: center; gap: var(--space-3); color: var(--ink); text-decoration: none; }
.site-brand img { height: 44px; width: auto; }
.site-brand strong { display: block; font-size: 18px; line-height: 26px; }
.site-brand small { display: block; font-size: 12px; line-height: 18px; color: var(--ink-secondary); font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: var(--space-2); }
.site-nav a { padding: var(--space-2) var(--space-3); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-secondary); border-radius: var(--radius-sm); }
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); background: var(--bg); }
.lang-switch { font-size: 13px; font-weight: 600; border: 1px solid var(--border-control); padding: 2px var(--space-3); border-radius: var(--radius-sm); text-decoration: none; color: var(--primary-deep); }
.site-main { padding-block: var(--space-8) var(--space-12); }
.site-footer { border-top: 1px solid var(--divider); padding-block: var(--space-6); font-size: 12px; line-height: 18px; color: var(--ink-secondary); }

/* hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-8); align-items: stretch; }
.hero-copy { padding-block: var(--space-8); }
.hero-copy .display { margin-bottom: var(--space-4); }
.hero-copy p { font-size: 18px; line-height: 32px; max-width: 34em; }
.hero-art { position: relative; min-height: 300px; background: var(--primary-deep); border-radius: var(--radius-lg); overflow: hidden; }
.hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 2px solid var(--ink); }
.flow-step { padding: var(--space-4) 0 var(--space-4); padding-inline-end: var(--space-4); }
.flow-step + .flow-step { border-inline-start: 1px solid var(--divider); padding-inline-start: var(--space-4); }
.flow-step b { display: block; font-size: 32px; line-height: 40px; color: var(--primary); }
.flow-step h3 { margin: var(--space-2) 0 var(--space-1); }
.flow-step p { font-size: 14px; line-height: 24px; color: var(--ink-secondary); margin: 0; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); padding: var(--space-6); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel-tight { padding: var(--space-4); }
.panel-sand { background: var(--sand); border-color: var(--sand); }
.form-shell { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-lg); padding: var(--space-8); }
.section-title { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-4); }

/* definition list */
.dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; border-top: 1px solid var(--divider); }
.dl dt, .dl dd { margin: 0; padding: var(--space-3) 0; border-bottom: 1px solid var(--divider); }
.dl dt { font-size: 14px; font-weight: 600; color: var(--ink-secondary); padding-inline-end: var(--space-4); }

/* ------------------------------------------------------------------ admin shell */
.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--surface); border-inline-end: 1px solid var(--divider); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .side-brand { padding: var(--space-4); border-bottom: 1px solid var(--divider); display: flex; gap: var(--space-3); align-items: center; text-decoration: none; color: var(--ink); }
.admin-side .side-brand img { height: 36px; }
.admin-side .side-brand strong { font-size: 14px; line-height: 20px; }
.side-nav { padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; }
.side-nav .group { margin: var(--space-4) var(--space-3) var(--space-1); font-size: 12px; line-height: 18px; font-weight: 600; color: var(--ink-secondary); }
.side-nav a { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14px; line-height: 22px; font-weight: 500; }
.side-nav a:hover { background: var(--bg); }
.side-nav a.is-active { background: var(--sand); font-weight: 700; }
.side-nav .count { font-size: 12px; min-width: 22px; text-align: center; border-radius: var(--radius-sm); background: var(--primary-deep); color: var(--on-primary-deep); padding: 0 6px; line-height: 20px; }
.side-foot { margin-top: auto; padding: var(--space-4); border-top: 1px solid var(--divider); font-size: 13px; line-height: 20px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-8); border-bottom: 1px solid var(--divider); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.admin-main { padding: var(--space-6) var(--space-8) var(--space-12); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-head .meta { font-size: 14px; color: var(--ink-secondary); }


/* ------------------------------------------------------------------ components */
.ws-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 40px; padding: var(--space-2) var(--space-6); border: 1px solid transparent; border-radius: var(--radius-sm); font-family: var(--font-arabic); font-size: 15px; line-height: 24px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.ws-btn-sm { min-height: 32px; padding: var(--space-1) var(--space-4); font-size: 14px; line-height: 22px; }
.ws-btn-primary { background: var(--primary-deep); color: var(--on-primary-deep); }
.ws-btn-primary:hover { background: var(--ink); color: var(--on-primary-deep); }
.ws-btn-secondary { background: var(--surface); color: var(--primary-deep); border-color: var(--border-control); }
.ws-btn-secondary:hover { background: var(--bg); color: var(--primary-deep); }
.ws-btn-ghost { background: transparent; color: var(--primary-deep); }
.ws-btn-ghost:hover { background: var(--surface); color: var(--ink); }
.ws-btn-danger { background: var(--danger); color: var(--on-primary-deep); }
.ws-btn-danger:hover { background: #7f1d15; color: var(--on-primary-deep); }
.ws-btn:disabled, .ws-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.ws-btn:focus-visible, .ws-input:focus-visible, .ws-tab:focus-visible, .ws-rate-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.inline-form { display: inline; }

/* fields */
.ws-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ws-field-label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.ws-req { color: var(--danger); }
.ws-input { width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); background: var(--surface); color: var(--ink); border: 1px solid var(--border-control); border-radius: var(--radius-sm); font-family: var(--font-arabic); font-size: 16px; line-height: 28px; }
select.ws-input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234A3B2C' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 12px 8px; background-position: left 12px center; padding-inline-end: 36px; }
[dir="ltr"] select.ws-input { background-position: right 12px center; }
textarea.ws-input { min-height: 112px; resize: vertical; }
.ws-input:disabled, .ws-input[readonly] { background: var(--surface-alt); }
.ws-input[dir="ltr"] { text-align: left; }
.ws-field.is-error .ws-input, .ws-input.is-error { border-color: var(--danger); border-width: 2px; }
.ws-field-hint { margin: 0; font-size: 14px; line-height: 24px; color: var(--ink-secondary); }
.ws-field-error { margin: 0; font-size: 14px; line-height: 24px; font-weight: 600; color: var(--danger); }
.check { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 15px; line-height: 26px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary-deep); flex: none; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: var(--space-3) var(--space-4); border: 1px solid var(--border-control); border-radius: var(--radius-sm); background: var(--surface); font-size: 15px; font-weight: 600; cursor: pointer; }
.choice input:checked + span { background: var(--primary-deep); border-color: var(--primary-deep); color: var(--on-primary-deep); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* badges */
.ws-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 13px; line-height: 24px; font-weight: 600; white-space: nowrap; }
.ws-badge-neutral { background: var(--surface-alt); color: var(--ink-secondary); border-color: var(--divider); }
.ws-badge-info { background: var(--info-soft); color: var(--info); }
.ws-badge-success { background: var(--success-soft); color: var(--success); }
.ws-badge-danger { background: var(--danger-soft); color: var(--danger); }
.ws-badge-warning { background: var(--warning-soft); color: var(--warning); }
.ws-badge-done { background: var(--primary-deep); color: var(--on-primary-deep); }
.ws-badge-archived { background: transparent; color: var(--ink-secondary); border-color: var(--border-control); border-style: dashed; }

/* stepper */
.ws-stepper { display: flex; margin: 0 0 var(--space-8); padding: 0; list-style: none; }
.ws-step { flex: 1 1 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); position: relative; padding-inline-end: var(--space-2); }
.ws-step::after { content: ""; position: absolute; top: 15px; inset-inline-start: 40px; inset-inline-end: var(--space-2); height: 2px; background: var(--divider); }
.ws-step:last-child::after { display: none; }
.ws-step.is-done::after { background: var(--primary-deep); }
.ws-step-num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; }
.ws-step.is-done .ws-step-num { background: var(--sand); color: var(--ink); }
.ws-step.is-current .ws-step-num { background: var(--primary-deep); color: var(--on-primary-deep); }
.ws-step.is-next .ws-step-num { background: var(--surface); color: var(--ink-secondary); border: 1px solid var(--border-control); }
.ws-step-label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-secondary); }
.ws-step.is-current .ws-step-label { color: var(--ink); }
.step-pane { display: none; }
.step-pane.is-active { display: block; }
.no-js .step-pane { display: block; margin-bottom: var(--space-8); }
.step-actions { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--divider); }

/* tabs */
.ws-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--divider); overflow-x: auto; margin-bottom: var(--space-6); }
.ws-tab { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-secondary); text-decoration: none; white-space: nowrap; }
.ws-tab:hover { color: var(--ink); }
.ws-tab.is-active { color: var(--ink); border-bottom-color: var(--primary-deep); }
.ws-tab-count { min-width: 22px; padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--ink); font-size: 12px; line-height: 20px; text-align: center; }
.ws-tab.is-active .ws-tab-count { background: var(--sand); }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-8); }
.ws-stat { padding-top: var(--space-3); border-top: 2px solid var(--ink); min-width: 0; }
.ws-stat-label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-secondary); }
.ws-stat-value { display: flex; align-items: baseline; gap: var(--space-1); margin-top: var(--space-2); white-space: nowrap; color: var(--ink); }
.ws-num { font-size: 32px; line-height: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ws-stat-unit { font-size: 14px; line-height: 20px; font-weight: 600; }
.ws-stat-note { margin-top: var(--space-1); font-size: 12px; line-height: 18px; font-weight: 500; color: var(--ink-secondary); }
a.ws-stat { text-decoration: none; display: block; }
a.ws-stat:hover .ws-stat-label { color: var(--primary-deep); text-decoration: underline; }

/* tables */
.ws-table-wrap { overflow-x: auto; border: 1px solid var(--divider); border-radius: var(--radius-md); background: var(--surface); }
.ws-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 24px; color: var(--ink); }
.ws-table caption { padding: var(--space-3) var(--space-4); text-align: start; font-size: 18px; line-height: 28px; font-weight: 600; }
.ws-table th { padding: var(--space-2) var(--space-3); background: var(--sand); text-align: start; font-weight: 600; white-space: nowrap; }
.ws-table td { padding: var(--space-3); border-top: 1px solid var(--divider); text-align: start; vertical-align: middle; }
.ws-table td.num, .ws-td-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-table tbody tr:hover { background: var(--surface-alt); }
.ws-table .actions { white-space: nowrap; text-align: end; }
.ws-table a.title-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.ws-table a.title-link:hover { color: var(--primary-deep); text-decoration: underline; }
.empty { padding: var(--space-8); text-align: center; color: var(--ink-secondary); }

/* notices */
.ws-notice { padding: var(--space-4) var(--space-6); border: 1px solid; border-radius: var(--radius-md); color: var(--ink); }
.ws-notice-title { margin: 0; font-size: 16px; line-height: 28px; font-weight: 700; }
.ws-notice-body { font-size: 14px; line-height: 24px; }
.ws-notice-body p:last-child { margin: 0; }
.ws-notice-info { background: var(--info-soft); border-color: var(--info); } .ws-notice-info .ws-notice-title { color: var(--info); }
.ws-notice-success { background: var(--success-soft); border-color: var(--success); } .ws-notice-success .ws-notice-title { color: var(--success); }
.ws-notice-warning { background: var(--warning-soft); border-color: var(--warning); } .ws-notice-warning .ws-notice-title { color: var(--warning); }
.ws-notice-danger { background: var(--danger-soft); border-color: var(--danger); } .ws-notice-danger .ws-notice-title { color: var(--danger); }
.flashes { display: grid; gap: var(--space-2); margin-bottom: var(--space-6); }

/* rating */
.ws-rate { margin: 0; padding: 0; border: 0; min-width: 0; }
.ws-rate-q { padding: 0; margin-bottom: var(--space-3); font-size: 16px; line-height: 28px; font-weight: 600; color: var(--ink); }
.ws-rate-opts { display: flex; gap: var(--space-2); }
.ws-rate-opt { position: relative; }
.ws-rate-opt input { position: absolute; opacity: 0; }
.ws-rate-opt span { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--border-control); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; }
.ws-rate-opt span:hover { background: var(--bg); }
.ws-rate-opt input:checked + span { background: var(--primary-deep); border-color: var(--primary-deep); color: var(--on-primary-deep); }
.ws-rate-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.ws-rate-ends { display: flex; justify-content: space-between; width: calc(48px * 5 + var(--space-2) * 4); margin-top: var(--space-2); font-size: 12px; line-height: 18px; font-weight: 500; color: var(--ink-secondary); }
.question { padding-block: var(--space-6); border-top: 1px solid var(--divider); }
.question:first-child { border-top: 0; padding-top: 0; }
.option-list { display: grid; gap: var(--space-2); }
.option { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--border-control); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.option input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--primary-deep); flex: none; }
.option:has(input:checked) { border-color: var(--primary-deep); border-width: 2px; padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }

/* presenters picker */
.picker { position: relative; }
.picker-results { position: absolute; inset-inline: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-sm); margin-top: 4px; max-height: 280px; overflow-y: auto; }
.picker-results button { display: block; width: 100%; text-align: start; padding: var(--space-2) var(--space-3); background: none; border: 0; border-bottom: 1px solid var(--divider); font-family: var(--font-arabic); font-size: 15px; line-height: 24px; cursor: pointer; color: var(--ink); }
.picker-results button:hover, .picker-results button:focus { background: var(--bg); }
.picker-results small { display: block; color: var(--ink-secondary); font-size: 12px; line-height: 18px; }
.person-list { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.person { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface-alt); border: 1px solid var(--divider); border-radius: var(--radius-sm); }
.person strong { display: block; font-size: 15px; line-height: 24px; }
.person small { display: block; font-size: 13px; line-height: 20px; color: var(--ink-secondary); }

/* quiz builder */
.qb-question { border: 1px solid var(--divider); border-radius: var(--radius-md); background: var(--surface); padding: var(--space-4); }
.qb-question + .qb-question { margin-top: var(--space-3); }
.qb-head { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.qb-num { font-weight: 700; color: var(--primary-deep); }
.qb-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; margin-top: var(--space-2); }
.qb-option input[type="radio"] { width: 20px; height: 20px; accent-color: var(--success); }
.qb-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 var(--space-2); border: 1px solid var(--divider); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-arabic); font-size: 13px; color: var(--ink-secondary); }
.icon-btn:hover { border-color: var(--border-control); color: var(--ink); }

/* filters */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); align-items: end; padding: var(--space-4); background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); margin-bottom: var(--space-6); }
.filters .ws-input { min-height: 40px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.chip { font-size: 13px; font-weight: 600; padding: 2px var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--divider); background: var(--surface); text-decoration: none; color: var(--ink-secondary); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* charts */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.chart-card { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6) var(--space-6); min-width: 0; }
.chart-card h3 { font-size: 16px; line-height: 24px; margin-bottom: var(--space-3); }
.chart-box { position: relative; height: 260px; }
.chart-card .caption { color: var(--ink-secondary); margin-top: var(--space-2); }

/* bars (survey averages) */
.bar-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 56px; gap: var(--space-3); align-items: center; padding-block: var(--space-2); border-bottom: 1px solid var(--divider); font-size: 14px; line-height: 22px; }
.bar { height: 12px; background: var(--surface-alt); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary-deep); }
.bar.alt i { background: var(--primary); }

/* QR */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.qr-card { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); padding: var(--space-4); text-align: center; }
.qr-card img { width: 180px; height: 180px; image-rendering: pixelated; display: block; margin: var(--space-2) auto; }
.qr-card.is-off img { opacity: .25; }
.qr-url { font-size: 11px; line-height: 16px; word-break: break-all; color: var(--ink-secondary); direction: ltr; text-align: left; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--space-4); padding-block: var(--space-3); border-bottom: 1px solid var(--divider); font-size: 14px; line-height: 22px; }
.timeline time { color: var(--ink-secondary); font-size: 13px; }
.lifecycle { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: var(--space-6); border: 1px solid var(--divider); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.lifecycle span { flex: 1 1 0; min-width: 110px; padding: var(--space-2) var(--space-3); font-size: 13px; font-weight: 600; text-align: center; color: var(--ink-secondary); border-inline-start: 1px solid var(--divider); }
.lifecycle span:first-child { border-inline-start: 0; }
.lifecycle span.is-done { background: var(--sand); color: var(--ink); }
.lifecycle span.is-current { background: var(--primary-deep); color: var(--on-primary-deep); }
.lifecycle span.is-stop { background: var(--danger-soft); color: var(--danger); }

.action-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); }
details.drawer { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); }
details.drawer summary { cursor: pointer; padding: var(--space-3) var(--space-4); font-weight: 600; font-size: 15px; }
details.drawer > div { padding: 0 var(--space-4) var(--space-4); }

.pagination { display: flex; flex-wrap: wrap; gap: var(--space-1); justify-content: center; margin-top: var(--space-6); }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--space-2); border: 1px solid var(--divider); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; font-size: 14px; color: var(--ink); }
.pagination .is-current { background: var(--primary-deep); border-color: var(--primary-deep); color: var(--on-primary-deep); }

/* auth */
.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; }

/* result */
.score-ring { display: flex; align-items: baseline; gap: var(--space-2); }
.score-ring .ws-num { font-size: 56px; line-height: 64px; }
.big-ref { font-size: 28px; line-height: 40px; font-weight: 700; letter-spacing: .5px; }

/* print sheet */
.print-sheet { background: #fff; }
.print-sheet .sheet { max-width: 900px; margin: 0 auto; padding: 32px; }
.print-sheet .qr-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.print-sheet .qr-card img { width: 260px; height: 260px; }

/* user-entered text takes its own direction (Arabic text inside the English UI and vice versa) */
.dl dd, .ws-table td, .ws-notice-body p, .timeline span, .comment { unicode-bidi: plaintext; }
.admin-top .menu-toggle { display: none; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .admin-main, .admin-top { padding-inline: var(--space-4); }
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 272px; z-index: 30; transform: translateX(100%); transition: transform .2s; }
  [dir="ltr"] .admin-side { transform: translateX(-100%); }
  .admin-side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(26, 22, 17, .35); }
  .admin-top .menu-toggle { display: inline-flex; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { min-height: 180px; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-step + .flow-step { border-inline-start: 0; border-top: 1px solid var(--divider); padding-inline-start: 0; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .display { font-size: 30px; line-height: 44px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-shell { padding: var(--space-4); }
  .ws-step-label { display: none; }
  .ws-step.is-current .ws-step-label { display: block; position: absolute; top: 40px; white-space: nowrap; }
  .ws-stepper { margin-bottom: var(--space-12); }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .dl dt { border-bottom: 0; padding-bottom: 0; }
  .site-nav a:not(.lang-switch) { display: none; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ws-rate-opt span { width: 44px; height: 44px; }
  .ws-rate-ends { width: calc(44px * 5 + var(--space-2) * 4); }
}
@media print {
  .admin-side, .admin-top, .no-print, .site-header, .site-footer { display: none !important; }
  body { background: #fff; }
  .admin-shell { display: block; }
}
