/* ==========================================================================
   منصة جمعية دار الخير — نظام التصميم
   الألوان مأخوذة من شعار الجمعية: أخضر النخيل، ذهبي التشكيل، ورمادي الشريط.
   العلامة المميزة: «النقطة» المعيّنة (◆) المأخوذة من نقطة الخط في الشعار.
   ========================================================================== */

/* ---------- الخطوط ---------- */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("/vendor/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Alexandria"; font-weight: 100 900; font-display: swap; src: url("/vendor/fonts/alexandria-arabic-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Alexandria"; font-weight: 100 900; font-display: swap; src: url("/vendor/fonts/alexandria-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }

/* ---------- المتغيرات ---------- */
:root {
  --green-900: #0a3a22; --green-800: #0e5230; --green-700: #12683a; --green-600: #1a7d48; --green-500: #2f9a5e;
  --green-200: #bfe0cb; --green-100: #dcefe3; --green-50: #eef7f1;
  --amber-700: #a86a00; --amber-600: #d98e04; --amber-500: #f9ae1b; --amber-200: #fbdc93; --amber-100: #fdeec7; --amber-50: #fff8e6;
  --ink-900: #1c1e1f; --ink-800: #2a2c2e; --ink-750: #323436; --ink-700: #3a3c3e; --ink-600: #54585b; --ink-500: #6f7477;
  --ink-400: #979c9f; --ink-300: #c4c9c8; --ink-200: #dfe4e1; --ink-150: #e9edea; --ink-100: #f0f3f1; --ink-50: #f7f9f7;
  --red-700: #a32a1d; --red-600: #c0392b; --red-100: #f9dcd8; --red-50: #fdf1ef;
  --orange-600: #c8601a; --orange-50: #fdf1e6;
  --blue-600: #1c6aa8; --blue-50: #e9f2fa;
  --violet-600: #6a4bbd; --violet-50: #f1edfa;
  --teal-600: #0c8079; --teal-50: #e4f4f2;

  --bg: #f1f4f1; --surface: #ffffff; --line: var(--ink-200); --line-soft: var(--ink-150);
  --text: var(--ink-800); --muted: var(--ink-500);
  --primary: var(--green-700); --primary-hover: var(--green-800); --accent: var(--amber-500);

  --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(22, 32, 26, .05);
  --shadow-sm: 0 1px 3px rgba(22, 32, 26, .07), 0 1px 2px rgba(22, 32, 26, .04);
  --shadow-md: 0 10px 28px -10px rgba(16, 32, 23, .22), 0 2px 6px rgba(16, 32, 23, .06);
  --shadow-lg: 0 30px 70px -24px rgba(10, 28, 18, .45), 0 8px 20px -8px rgba(10, 28, 18, .18);
  --ring: 0 0 0 3px rgba(18, 104, 58, .18);

  --font-body: "IBM Plex Sans Arabic", "SF Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --side-w: 268px; --top-h: 62px;
}

/* ---------- أساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
::selection { background: var(--amber-200); color: var(--ink-900); }
.num, td.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* النقطة المعيّنة — علامة المنصة */
/* أيقونات Phosphor الثنائية تعتمد على تراكب طبقتين باتجاه LTR */
.ph-duotone { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nuqta { display: inline-block; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; flex: none; }

/* ---------- الهيكل العام ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--ink-800); color: #e9ecea; z-index: 40;
  background-image: radial-gradient(120% 60% at 100% 0%, rgba(18, 104, 58, .34), transparent 60%);
}
.side-brand { padding: 16px 16px 14px; }
.side-logo { display: block; background: #fff; border-radius: var(--r-lg); padding: 6px 10px; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5); }
.side-logo img { width: 100%; height: 104px; object-fit: contain; }
.side-brand-text { margin-top: 12px; display: flex; align-items: center; gap: 9px; padding-inline: 4px; }
.side-brand-text b { font: 600 13.5px/1.3 var(--font-display); color: #fff; letter-spacing: 0; }
.side-brand-text small { display: block; font-size: 11.5px; color: #aab1ad; margin-top: 2px; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: #4b4f52 transparent; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-eyebrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 11.5px; color: #9aa19d; }
.nav-eyebrow::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .09); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; margin-top: 2px;
  border-radius: var(--r); color: #d2d7d4; font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav-item i { font-size: 19px; color: #9fa7a2; transition: color .15s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active i { color: var(--amber-500); }
.nav-item.active::before {
  content: ""; position: absolute; inset-inline-start: -16px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  background: var(--amber-500); transform: rotate(45deg); border-radius: 1.5px;
}
.nav-item .count { margin-inline-start: auto; font-size: 11.5px; background: rgba(255, 255, 255, .12); padding: 0 7px; border-radius: 20px; color: #fff; }
.side-foot { padding: 12px 18px 16px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 11.5px; color: #8f9692; display: flex; justify-content: space-between; align-items: center; }
.side-foot b { color: #c9cfcb; font-weight: 500; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 10px;
  padding: 0 22px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-search { position: relative; flex: 0 1 380px; }
.topbar-search i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: 17px; pointer-events: none; }
.topbar-search input { width: 100%; height: 38px; border: 1px solid transparent; background: var(--ink-100); border-radius: 20px; padding-inline: 38px 14px; transition: .15s; }
.topbar-search input:focus { outline: 0; background: #fff; border-color: var(--green-500); box-shadow: var(--ring); }
.topbar-search .menu { inset-inline: 0; min-width: 0; max-height: 360px; overflow: auto; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.tb-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 11px; border-radius: 20px; color: var(--ink-600); font-weight: 500; font-size: 13px; transition: background .15s, color .15s; }
.tb-btn:hover, .dropdown.open > .tb-btn { background: var(--ink-100); color: var(--ink-900); }
.tb-btn i { font-size: 19px; }
.tb-btn .dot { position: absolute; top: 1px; inset-inline-start: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--red-600); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.tb-user { padding-inline: 5px 10px; gap: 9px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font: 600 12.5px var(--font-display); flex: none; }
.tb-user .who { text-align: start; line-height: 1.25; }
.tb-user .who b { display: block; font-size: 12.5px; color: var(--ink-800); font-weight: 600; }
.tb-user .who small { font-size: 11px; color: var(--muted); }
.menu-toggle { display: none; }

.ticker { display: flex; align-items: center; background: var(--green-900); color: #dff0e5; height: 36px; font-size: 12.8px; }
.ticker-label { flex: none; height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 16px 0 14px; background: var(--amber-500); color: var(--ink-900); font-weight: 600; clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%); padding-inline-end: 22px; }
.ticker-view { flex: 1; overflow: hidden; height: 100%; position: relative; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: flex; width: max-content; height: 100%; align-items: center; animation: ticker var(--ticker-time, 60s) linear infinite; }
.ticker-view:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding-inline: 18px; white-space: nowrap; }
.ticker-item b { font-weight: 500; color: #fff; }
.ticker-item .by { color: #9fc3ad; font-size: 12px; }
.ticker-item button { color: #7fa08d; font-size: 14px; opacity: 0; transition: opacity .15s; }
.ticker-item:hover button { opacity: 1; }
.ticker-add { flex: none; height: 100%; padding: 0 16px; color: #fff; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border-inline-start: 1px solid rgba(255, 255, 255, .12); }
.ticker-add:hover { background: rgba(255, 255, 255, .08); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }

.page { padding: 22px 26px 40px; width: 100%; max-width: 1680px; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.page-icon { width: 54px; height: 54px; border-radius: 15px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--green-700); font-size: 28px; box-shadow: var(--shadow-xs); position: relative; flex: none; }
.page-icon::after { content: ""; position: absolute; bottom: -4px; inset-inline-start: -4px; width: 11px; height: 11px; background: var(--amber-500); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 0 3px var(--bg); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.3px; color: var(--muted); }
.crumbs a:hover { color: var(--green-700); }
.crumbs i { font-size: 11px; color: var(--ink-300); }
.page-title { font: 700 24px/1.35 var(--font-display); color: var(--ink-900); margin-top: 2px; letter-spacing: 0; }
.page-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.page-foot { margin-top: 34px; text-align: center; color: var(--ink-400); font-size: 12px; }

/* ---------- البطاقات ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card + .card, .card + .alert, .alert + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.card-title { font: 600 15.5px/1.4 var(--font-display); color: var(--ink-900); display: flex; align-items: center; gap: 9px; }
.card-sub { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px; }
.section-title { font: 600 14.5px var(--font-display); color: var(--ink-900); display: flex; align-items: center; gap: 9px; margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: var(--r-sm); font-weight: 500; font-size: 13.5px; white-space: nowrap; border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 17px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(10, 58, 34, .3); }
.btn-primary:hover:not([disabled]) { background: var(--primary-hover); }
.btn-accent { background: var(--amber-500); color: var(--ink-900); font-weight: 600; }
.btn-accent:hover:not([disabled]) { background: #f3a30a; }
.btn-soft { background: var(--green-50); color: var(--green-800); border-color: var(--green-100); }
.btn-soft:hover:not([disabled]) { background: var(--green-100); }
.btn-ghost { background: #fff; color: var(--ink-700); border-color: var(--ink-300); }
.btn-ghost:hover:not([disabled]) { background: var(--ink-50); border-color: var(--ink-400); }
.btn-quiet { color: var(--ink-600); }
.btn-quiet:hover:not([disabled]) { background: var(--ink-100); color: var(--ink-900); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover:not([disabled]) { background: var(--red-700); }
.btn-danger-soft { background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }
.btn-danger-soft:hover:not([disabled]) { background: var(--red-100); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.8px; border-radius: 6px; }
.btn-sm i { font-size: 15px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-600); font-size: 17px; border: 1px solid transparent; transition: .15s; flex: none; }
.icon-btn:hover { background: var(--ink-100); color: var(--ink-900); }
.icon-btn.bordered { border-color: var(--ink-300); background: #fff; }
.icon-btn.bordered:hover { border-color: var(--ink-400); background: var(--ink-50); }
.icon-btn.on { color: var(--red-600); }
.icon-btn.danger:hover { background: var(--red-50); color: var(--red-600); }

/* ---------- حقول الإدخال ---------- */
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 7px 11px; background: #fff; border: 1px solid var(--ink-300); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s; color: var(--ink-900);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.7; display: block; }
.select { appearance: none; padding-inline-end: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236f7477' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 11px center; cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--green-600); box-shadow: var(--ring); }
.input[type="number"] { direction: ltr; text-align: right; }
.input[type="email"], .input[type="url"], .input.ltr-input { direction: ltr; text-align: right; }
.input[type="range"] { padding: 0; min-height: 24px; border: 0; accent-color: var(--green-700); box-shadow: none; }
.input[type="color"] { padding: 3px; width: 54px; cursor: pointer; }
.input-group { display: flex; align-items: stretch; direction: rtl; }
.input-group .input { border-radius: 0; flex: 1; min-width: 0; }
.input-group > :first-child { border-start-start-radius: var(--r-sm); border-end-start-radius: var(--r-sm); }
.input-group > :last-child { border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--ink-100); border: 1px solid var(--ink-300); color: var(--ink-600); font-size: 12.8px; white-space: nowrap; }
.input-group .addon + .input, .input-group .input + .addon { margin-inline-start: -1px; }
.input-group .input:focus { position: relative; z-index: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-error { font-size: 12px; color: var(--red-600); margin-top: 5px; display: none; }
.has-error .field-error { display: block; }
.has-error .input, .has-error .select, .has-error .textarea, .has-error .datefield-btn, .has-error .mselect-box { border-color: var(--red-600); background: var(--red-50); }
.has-error .radio-pill span { border-color: var(--red-600); }

/* ورقة النموذج: تسمية | حقل | تسمية | حقل — على هيئة النماذج الرسمية */
.sheet { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) minmax(150px, 200px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.sheet > .lbl { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--ink-50); color: var(--ink-700); font-weight: 500; font-size: 13.3px; line-height: 1.5; box-shadow: 0 1px 0 var(--line), -1px 0 0 var(--line), 1px 0 0 var(--line); }
.sheet > .fld { padding: 8px 10px; min-width: 0; box-shadow: 0 1px 0 var(--line); display: flex; flex-direction: column; justify-content: center; }
.sheet > .fld.span { grid-column: span 3; }
.req { width: 6px; height: 6px; background: var(--red-600); transform: rotate(45deg); border-radius: 1px; flex: none; margin-inline-start: 2px; }
.sheet + .sheet, .sheet + .workspace, .alert + .sheet, .sheet + .alert { margin-top: 16px; }

.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill { position: relative; cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-pill span { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--ink-300); border-radius: 20px; background: #fff; font-size: 13.2px; transition: .15s; }
.radio-pill span::before { content: ""; width: 7px; height: 7px; background: var(--ink-300); transform: rotate(45deg); border-radius: 1px; transition: .15s; }
.radio-pill:hover span { border-color: var(--ink-400); }
.radio-pill input:checked + span { border-color: var(--green-600); background: var(--green-50); color: var(--green-900); font-weight: 500; }
.radio-pill input:checked + span::before { background: var(--amber-500); }
.radio-pill input:focus-visible + span { box-shadow: var(--ring); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--ink-600); user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .lever { width: 42px; height: 24px; border-radius: 20px; background: var(--ink-300); position: relative; transition: background .18s; flex: none; }
.switch .lever::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: inset-inline-start .18s; }
.switch input:checked ~ .lever { background: var(--green-600); }
.switch input:checked ~ .lever::after { inset-inline-start: 21px; }
.switch input:focus-visible ~ .lever { box-shadow: var(--ring); }
.switch .on-text { display: none; color: var(--green-800); font-weight: 500; }
.switch input:checked ~ .on-text { display: inline; }
.switch input:checked ~ .off-text { display: none; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--green-700); cursor: pointer; margin: 0; }

/* حقل التاريخ */
.datefield { position: relative; display: flex; }
.datefield-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 6px 11px; background: #fff; border: 1px solid var(--ink-300); border-radius: var(--r-sm); text-align: start; transition: .15s; color: var(--ink-900); }
.datefield-btn:hover { border-color: var(--ink-400); }
.datefield-btn:focus-visible, .datefield.open .datefield-btn { outline: 0; border-color: var(--green-600); box-shadow: var(--ring); }
.datefield-btn i { color: var(--green-700); font-size: 17px; flex: none; }
.datefield-btn .ph-text { color: var(--ink-400); }
.datefield-btn .val { font-size: 13px; line-height: 1.5; }
.datefield-btn .val .muted { white-space: nowrap; }
.datefield-clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-400); font-size: 14px; }
.datefield-clear:hover { background: var(--ink-100); color: var(--red-600); }
.dp { position: fixed; z-index: 200; width: 306px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 12px; animation: pop .14s ease-out; }
.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dp-head .select { min-height: 32px; height: 32px; padding-block: 0; font-size: 13px; font-weight: 500; }
.dp-hijri { text-align: center; font-size: 12px; color: var(--amber-700); background: var(--amber-50); border-radius: 6px; padding: 3px; margin-bottom: 8px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid .dow { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.dp-day { height: 34px; border-radius: 8px; font-size: 13px; font-variant-numeric: tabular-nums; transition: .1s; }
.dp-day:hover { background: var(--green-50); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--amber-500); }
.dp-day.sel { background: var(--green-700); color: #fff; font-weight: 600; }
.dp-day.out { color: var(--ink-300); }
.dp-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.dp-time .select { min-height: 34px; height: 34px; padding-block: 0; font-size: 13px; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; }

/* الاختيار المتعدد */
.mselect { position: relative; }
.mselect-box { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 38px; padding: 4px 8px; background: #fff; border: 1px solid var(--ink-300); border-radius: var(--r-sm); cursor: pointer; transition: .15s; }
.mselect.open .mselect-box { border-color: var(--green-600); box-shadow: var(--ring); }
.mselect-box .ph-text { color: var(--ink-400); padding-inline: 3px; }
.mselect-box > i { margin-inline-start: auto; color: var(--ink-500); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 14px; background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-900); font-size: 12.5px; }
.chip button { font-size: 12px; color: var(--green-700); display: grid; place-items: center; }
.chip button:hover { color: var(--red-600); }
.mselect-menu { position: absolute; z-index: 60; inset-inline: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-md); padding: 6px; max-height: 260px; overflow: auto; display: none; }
.mselect.open .mselect-menu { display: block; animation: pop .12s ease-out; }
.mselect-menu input.input { min-height: 32px; margin-bottom: 4px; }
.mselect-opt { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13.2px; }
.mselect-opt:hover { background: var(--ink-50); }
.mselect-opt input { accent-color: var(--green-700); width: 16px; height: 16px; margin: 0; }

/* رفع الملفات */
.uploader { display: flex; flex-direction: column; gap: 8px; }
.uploader-drop { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-50); min-width: 0; }
.file-item > i { font-size: 24px; color: var(--green-700); flex: none; }
.file-item .thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; border: 1px solid var(--line); background: #fff; }
.file-item .meta { min-width: 0; flex: 1; line-height: 1.35; }
.file-item .meta a { display: block; font-size: 12.8px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .meta a:hover { color: var(--green-700); text-decoration: underline; }
.file-item .meta small { color: var(--muted); font-size: 11.5px; }
.file-item.loading { opacity: .6; }

/* ---------- التنبيهات ---------- */
.alert { display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--r); border: 1px solid; font-size: 13.3px; line-height: 1.75; }
.alert > i { font-size: 21px; flex: none; margin-top: 1px; }
.alert strong { font-weight: 600; display: block; }
.alert ul { margin: 4px 0 0; padding-inline-start: 0; list-style: none; }
.alert li { position: relative; padding-inline-start: 16px; }
.alert li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .72em; width: 5px; height: 5px; background: currentColor; opacity: .55; transform: rotate(45deg); }
.alert-info { background: var(--blue-50); border-color: #cfe1f1; color: #174f7d; }
.alert-warn { background: var(--amber-50); border-color: var(--amber-200); color: #7a4d00; }
.alert-danger { background: var(--red-50); border-color: var(--red-100); color: var(--red-700); }
.alert-success { background: var(--green-50); border-color: var(--green-200); color: var(--green-900); }
.alert-neutral { background: var(--ink-50); border-color: var(--line); color: var(--ink-700); }

/* ---------- الشارات ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; height: 25px; padding: 0 10px; border-radius: 13px; font-size: 12.3px; font-weight: 500; white-space: nowrap; background: var(--ink-100); color: var(--ink-700); }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); border-radius: 1px; }
.badge.plain::before { display: none; }
.badge[data-tone="amber"] { background: var(--amber-100); color: var(--amber-700); }
.badge[data-tone="green"] { background: var(--green-100); color: var(--green-800); }
.badge[data-tone="orange"] { background: var(--orange-50); color: var(--orange-600); }
.badge[data-tone="red"] { background: var(--red-50); color: var(--red-700); }
.badge[data-tone="blue"] { background: var(--blue-50); color: var(--blue-600); }
.badge[data-tone="violet"] { background: var(--violet-50); color: var(--violet-600); }
.badge[data-tone="teal"] { background: var(--teal-50); color: var(--teal-600); }
.badge[data-tone="gray"] { background: var(--ink-150); color: var(--ink-600); }
.badge[data-tone="solid"] { background: var(--green-700); color: #fff; }
.badge[data-tone="solid"]::before { background: var(--amber-500); }
.na { color: var(--ink-400); font-size: 12.3px; }

/* ---------- مساحة العمل: تبويبات جانبية + محتوى ---------- */
.workspace { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 18px; align-items: start; }
.workspace.narrow { grid-template-columns: 210px minmax(0, 1fr); }
.vtabs { display: flex; flex-direction: column; gap: 3px; padding: 6px; background: var(--ink-50); border: 1px solid var(--line); border-radius: var(--r); position: sticky; top: calc(var(--top-h) + 14px); }
.vtab { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink-600); font-weight: 500; font-size: 13.3px; text-align: start; transition: .15s; border: 1px solid transparent; }
.vtab i { font-size: 18px; color: var(--ink-400); }
.vtab:hover { background: #fff; color: var(--ink-900); }
.vtab.active { background: #fff; color: var(--green-800); border-color: var(--line); box-shadow: var(--shadow-xs); }
.vtab.active i { color: var(--green-700); }
.vtab.active::after { content: ""; margin-inline-start: auto; width: 7px; height: 7px; background: var(--amber-500); transform: rotate(45deg); border-radius: 1px; }
.vtab .count { margin-inline-start: auto; min-width: 24px; text-align: center; font-size: 11.8px; padding: 0 7px; border-radius: 10px; background: var(--ink-150); color: var(--ink-600); font-variant-numeric: tabular-nums; }
.vtab.active .count { background: var(--green-100); color: var(--green-800); }
.vtab.active .count + *, .vtab.has-count.active::after { display: none; }
.vtab.error { color: var(--red-700); }
.vtab.error i { color: var(--red-600); }
.vtab.error::after { content: ""; margin-inline-start: auto; width: 7px; height: 7px; background: var(--red-600); transform: rotate(45deg); border-radius: 1px; }
.pane { display: none; }
.pane.active { display: block; animation: fade .18s ease-out; }
.pane.has-error > #agenda-list .table-wrap { border-color: var(--red-600); background: var(--red-50); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 500; color: var(--ink-500); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--ink-900); }
.tab.active { color: var(--green-800); border-bottom-color: var(--amber-500); }
.tab i { font-size: 17px; }

/* ---------- القوائم المنسدلة ---------- */
.dropdown { position: relative; }
.menu { position: absolute; z-index: 80; top: calc(100% + 6px); inset-inline-end: 0; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-md); padding: 6px; display: none; }
.menu.start { inset-inline-end: auto; inset-inline-start: 0; }
.dropdown.open > .menu { display: block; animation: pop .13s ease-out; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; font-size: 13.2px; color: var(--ink-700); text-align: start; }
.menu-item i { font-size: 17px; color: var(--ink-500); }
.menu-item:hover { background: var(--ink-50); color: var(--ink-900); }
.menu-item.danger { color: var(--red-700); }
.menu-item.danger i { color: var(--red-600); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 0; }
.menu-head { padding: 8px 10px 6px; font-size: 11.8px; color: var(--muted); }
.menu-empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 12.8px; }
.menu-empty i { display: block; font-size: 30px; color: var(--ink-300); margin-bottom: 6px; }
.menu.wide { width: 380px; padding: 0; }
.menu.wide .menu-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--line-soft); }
.menu.wide .menu-tabs button { padding: 11px 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-500); border-bottom: 2px solid transparent; display: flex; align-items: center; justify-content: center; gap: 6px; }
.menu.wide .menu-tabs button.active { color: var(--green-800); border-bottom-color: var(--amber-500); }
.menu.wide .menu-list { max-height: 320px; overflow: auto; padding: 6px; }
.note-item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; width: 100%; text-align: start; }
.note-item:hover { background: var(--ink-50); }
.note-item > i { font-size: 20px; color: var(--green-700); margin-top: 2px; }
.note-item b { display: block; font-weight: 500; font-size: 13px; color: var(--ink-900); line-height: 1.5; }
.note-item small { color: var(--muted); font-size: 11.8px; }

/* ---------- جدول البيانات ---------- */
.grid-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.grid-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.grid-toolbar .records { display: flex; align-items: center; gap: 8px; color: var(--ink-600); font-size: 12.8px; }
.grid-toolbar .records .select { width: 76px; min-height: 34px; height: 34px; padding-block: 0; }
.grid-toolbar .tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex-wrap: wrap; }
.grid-search { position: relative; }
.grid-search i { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: 15px; }
.grid-search .input { width: 210px; min-height: 34px; height: 34px; padding-inline-start: 31px; }
.grid-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); background: var(--amber-50); align-items: center; font-size: 12.5px; color: var(--amber-700); }
.grid-filters .chip { background: #fff; border-color: var(--amber-200); color: var(--ink-800); }
.grid-scroll { overflow: auto; max-height: min(70vh, 760px); position: relative; scrollbar-width: thin; scrollbar-color: var(--ink-300) transparent; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.2px; }
table.grid th { position: sticky; top: 0; z-index: 3; background: var(--ink-50); color: var(--ink-700); font-weight: 600; font-size: 12.6px; text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
table.grid th .th-in { display: flex; align-items: center; gap: 6px; }
table.grid th.sortable .th-label { cursor: pointer; }
table.grid th .sort { font-size: 12px; color: var(--ink-300); }
table.grid th.sorted .sort { color: var(--green-700); }
table.grid th .th-filter { width: 22px; height: 22px; border-radius: 5px; display: inline-grid; place-items: center; color: var(--ink-400); font-size: 13px; }
table.grid th .th-filter:hover { background: var(--ink-150); color: var(--ink-800); }
table.grid th .th-filter.on { background: var(--amber-500); color: var(--ink-900); }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; background: #fff; }
table.grid td.wrap { white-space: normal; min-width: 220px; }
table.grid tbody tr:hover td { background: #f6fbf8; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid td small.date { display: block; color: var(--ink-600); font-size: 12.3px; }
table.grid .sticky-start { position: sticky; inset-inline-start: 0; z-index: 2; box-shadow: -1px 0 0 var(--line-soft); }
table.grid .sticky-end { position: sticky; inset-inline-end: 0; z-index: 2; box-shadow: 1px 0 0 var(--line-soft); }
table.grid th.sticky-start, table.grid th.sticky-end { z-index: 4; }
table.grid td.actions { overflow: visible; }
table.grid td.actions .row { gap: 4px; }
table.grid td .title-cell { font-weight: 500; color: var(--ink-900); }
table.grid tr.selected td { background: var(--green-50); }
.grid-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line-soft); color: var(--ink-600); font-size: 12.8px; }
.pager { display: flex; gap: 4px; align-items: center; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--ink-200); background: #fff; font-size: 12.8px; font-variant-numeric: tabular-nums; display: inline-grid; place-items: center; }
.pager button:hover:not([disabled]) { border-color: var(--ink-400); }
.pager button.active { background: var(--green-700); color: #fff; border-color: var(--green-700); font-weight: 600; }
.pager button[disabled] { opacity: .4; cursor: default; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 40px; color: var(--ink-300); display: block; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-700); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.popover { position: fixed; z-index: 150; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-md); padding: 10px; width: 250px; animation: pop .13s ease-out; }
.popover .opts { max-height: 240px; overflow: auto; margin: 6px 0; }
.popover .mselect-opt { padding: 6px 7px; }

/* جدول بسيط */
table.simple { width: 100%; border-collapse: collapse; font-size: 13.2px; }
table.simple th { text-align: start; font-weight: 600; font-size: 12.5px; color: var(--ink-600); background: var(--ink-50); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.simple td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.simple tr:last-child td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: #fff; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- النوافذ ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(20, 28, 23, .5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 18px; overflow-y: auto; animation: fade .15s ease-out; }
.modal { width: 100%; max-width: 720px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: rise .2s cubic-bezier(.2, .8, .3, 1); display: flex; flex-direction: column; margin: auto 0; }
.modal.sm { max-width: 460px; } .modal.lg { max-width: 980px; } .modal.xl { max-width: 1200px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font: 600 16.5px/1.4 var(--font-display); color: var(--ink-900); display: flex; align-items: center; gap: 10px; }
.modal-head .icon-btn { margin-inline-start: auto; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--ink-50); border-radius: 0 0 16px 16px; }
.modal-foot .spacer { flex: 1; }
.form-row { display: grid; gap: 6px; margin-bottom: 14px; }
.form-row > label { font-weight: 500; font-size: 13px; color: var(--ink-700); display: flex; align-items: center; gap: 6px; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.toast-stack { position: fixed; z-index: 300; bottom: 22px; inset-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 16px; background: var(--ink-800); color: #fff; border-radius: var(--r); box-shadow: var(--shadow-md); font-size: 13.3px; animation: rise .22s ease-out; border-inline-start: 4px solid var(--green-500); }
.toast i { font-size: 20px; color: var(--green-500); }
.toast.error { border-inline-start-color: var(--red-600); } .toast.error i { color: #ff8a7c; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }

/* ---------- عناصر صفحات الاجتماعات ---------- */
.stamp { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; text-align: center; flex: none; color: var(--green-800); border: 2px solid var(--green-700); outline: 1px dashed var(--green-600); outline-offset: -7px; background: #fff; transform: rotate(-8deg); line-height: 1.1; }
.stamp small { display: block; font-size: 9.5px; font-weight: 500; letter-spacing: 0; }
.stamp b { display: block; font: 700 21px var(--font-display); font-variant-numeric: tabular-nums; }

.rail { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 2px 2px; }
.rail-step { position: relative; flex: 1 1 0; min-width: 96px; text-align: center; font-size: 12px; color: var(--ink-400); padding-top: 22px; }
.rail-step::before { content: ""; position: absolute; top: 6px; inset-inline: 0; height: 2px; background: var(--ink-200); }
.rail-step:first-child::before { inset-inline-start: 50%; }
.rail-step:last-child::before { inset-inline-end: 50%; }
.rail-step::after { content: ""; position: absolute; top: 1px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; background: #fff; border: 2px solid var(--ink-300); transform: rotate(45deg); border-radius: 2px; }
.rail-step.done { color: var(--green-800); }
.rail-step.done::before { background: var(--green-600); }
.rail-step.done::after { background: var(--green-600); border-color: var(--green-600); }
.rail-step.current { color: var(--ink-900); font-weight: 600; }
.rail-step.current::after { background: var(--amber-500); border-color: var(--amber-500); box-shadow: 0 0 0 4px var(--amber-100); }
.rail-step.current::before { background: linear-gradient(to left, var(--green-600) 50%, var(--ink-200) 50%); }
.rail-step.current:first-child::before, .rail-step.halted::before { background: var(--ink-200); }
.rail-step.halted { color: var(--red-700); font-weight: 600; }
.rail-step.halted::after { background: var(--red-600); border-color: var(--red-600); box-shadow: 0 0 0 4px var(--red-50); }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0; }
.kv > div { padding: 10px 14px; min-width: 0; box-shadow: -1px 0 0 var(--line), 0 1px 0 var(--line); }
.kv dt { font-size: 11.8px; color: var(--muted); margin-bottom: 2px; }
.kv dd { margin: 0; font-weight: 500; color: var(--ink-900); font-size: 13.3px; overflow-wrap: anywhere; }
.kv .full { grid-column: 1 / -1; }

.view-head { display: flex; align-items: center; gap: 16px; }
.view-head h2 { font: 700 19px/1.45 var(--font-display); color: var(--ink-900); }
.view-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-600); font-size: 12.8px; margin-top: 6px; }
.view-head .meta span { display: inline-flex; align-items: center; gap: 5px; }
.view-head .meta i { color: var(--green-700); font-size: 15px; }

.agenda-card { border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
.agenda-card + .agenda-card { margin-top: 10px; }
.agenda-card > header { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; user-select: none; }
.agenda-card > header:hover { background: var(--ink-50); }
.agenda-card .order { width: 28px; height: 28px; border-radius: 8px; background: var(--green-50); color: var(--green-800); display: grid; place-items: center; font: 600 13px var(--font-display); flex: none; }
.agenda-card .ttl { font-weight: 600; color: var(--ink-900); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-card .ttl.placeholder { color: var(--ink-400); font-weight: 500; }
.agenda-card .caret { color: var(--ink-400); transition: transform .2s; }
.agenda-card.open .caret { transform: rotate(180deg); }
.agenda-card > .body { display: none; padding: 4px 14px 14px; }
.agenda-card.open > .body { display: block; }
.agenda-card.has-error { border-color: var(--red-600); }
.agenda-card .drag { color: var(--ink-300); cursor: grab; font-size: 18px; }
.decision-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.drag { display: inline-grid; place-items: center; width: 26px; height: 32px; border-radius: 6px; color: var(--ink-400); font-size: 18px; cursor: grab; flex: none; }
.drag:hover { background: var(--ink-100); color: var(--ink-700); }
.drag:active { cursor: grabbing; }
.dragging { opacity: .45; outline: 2px dashed var(--green-500); outline-offset: 2px; }
.icon-btn.add { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.icon-btn.add:hover { background: var(--green-700); color: #fff; }
.icon-btn.remove { background: var(--red-50); color: var(--red-600); border-color: var(--red-100); }
.icon-btn.remove:hover { background: var(--red-600); color: #fff; }
.sheet.two { grid-template-columns: minmax(120px, 170px) minmax(0, 1fr); }
#assign-grid .grid-scroll { max-height: 46vh; }
.decision-row .input { flex: 1; }
.decision { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-50); margin-top: 8px; align-items: flex-start; }
.decision > i { color: var(--amber-600); font-size: 18px; margin-top: 2px; }
.decision .txt { flex: 1; font-weight: 500; }
.decision .votes { display: flex; gap: 10px; color: var(--ink-600); font-size: 12.3px; margin-top: 4px; }

.seg { display: inline-flex; border: 1px solid var(--ink-300); border-radius: 8px; overflow: hidden; background: #fff; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; font-size: 12.5px; color: var(--ink-600); border-inline-start: 1px solid var(--ink-200); transition: .12s; white-space: nowrap; }
.seg label:first-child span { border-inline-start: 0; }
.seg input:checked + span { color: #fff; font-weight: 500; background: var(--green-700); }
.seg input[value="present"]:checked + span, .seg input[value="approved"]:checked + span { background: var(--green-700); }
.seg input[value="absent"]:checked + span, .seg input[value="rejected"]:checked + span { background: var(--red-600); }
.seg input[value="excused"]:checked + span, .seg input[value="postponed"]:checked + span { background: var(--amber-600); }
.seg input[value="proxy"]:checked + span { background: var(--blue-600); }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--green-500); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 22px 16px 0; }
.timeline li::before { content: ""; position: absolute; right: 3px; top: 7px; width: 8px; height: 8px; background: var(--green-600); transform: rotate(45deg); border-radius: 1px; }
.timeline li::after { content: ""; position: absolute; right: 6.5px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; } .timeline li:last-child::after { display: none; }
.timeline b { font-weight: 600; color: var(--ink-900); }
.timeline .note { margin-top: 4px; padding: 7px 10px; background: var(--ink-50); border-radius: 6px; font-size: 12.8px; color: var(--ink-700); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; position: relative; overflow: hidden; text-align: start; transition: border-color .15s, box-shadow .15s; }
a.stat:hover, button.stat:hover { border-color: var(--green-500); box-shadow: var(--shadow-sm); }
.stat .lbl { color: var(--ink-600); font-size: 12.8px; display: flex; align-items: center; gap: 8px; }
.stat .val { font: 700 30px/1.25 var(--font-display); color: var(--ink-900); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 12.2px; margin-top: 2px; }
.stat > i { position: absolute; left: 14px; top: 14px; font-size: 26px; color: var(--green-200); }
.meter { height: 8px; border-radius: 5px; background: var(--ink-150); overflow: hidden; margin-top: 10px; position: relative; }
.meter > span { display: block; height: 100%; background: var(--green-600); border-radius: 5px; }
.meter.bad > span { background: var(--red-600); }
.meter > em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-800); }

.prose { white-space: pre-wrap; line-height: 1.95; color: var(--ink-800); }

/* بطاقة العضو */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-photo { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; background: var(--green-50); border: 1px solid var(--line); display: grid; place-items: center; color: var(--green-700); font: 700 28px var(--font-display); flex: none; overflow: hidden; }
.photo-picker { display: flex; align-items: center; gap: 14px; }
.addr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* ---------- مصمم قالب المستندات ---------- */
.designer { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.designer-panel { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--top-h) + 14px); max-height: calc(100vh - var(--top-h) - 28px); overflow: auto; padding-inline-end: 2px; }
.panel-block { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.panel-block > h4 { font: 600 13.2px var(--font-display); color: var(--ink-900); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.panel-block .form-row { margin-bottom: 10px; } .panel-block .form-row:last-child { margin-bottom: 0; }
.panel-block .form-row > label { font-size: 12.3px; color: var(--ink-600); justify-content: space-between; }
.comp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.comp-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); font-size: 12.8px; cursor: pointer; }
.comp-list li:hover { border-color: var(--ink-400); }
.comp-list li.sel { border-color: var(--green-600); background: var(--green-50); }
.comp-list li i { color: var(--green-700); font-size: 16px; }
.comp-list li .pos { margin-inline-start: auto; color: var(--muted); font-size: 11.3px; direction: ltr; }
.margins-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.margins-grid label { font-size: 11.5px; color: var(--muted); display: grid; gap: 3px; text-align: center; }
.margins-grid .input { padding-inline: 4px; text-align: center; min-height: 34px; }
.canvas-wrap { background: repeating-conic-gradient(#e7ebe8 0% 25%, #eef1ee 0% 50%) 0 0 / 22px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; overflow: auto; display: flex; justify-content: center; min-height: 480px; }
.sheet-page { position: relative; background: #fff; box-shadow: 0 14px 40px -14px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .06); flex: none; overflow: hidden; direction: ltr; user-select: none; }
.sheet-page .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.sheet-page .wm { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.sheet-page .margin-guide { position: absolute; border: 1px dashed rgba(18, 104, 58, .55); background: rgba(18, 104, 58, .035); pointer-events: none; display: grid; place-items: center; color: rgba(18, 104, 58, .5); font-size: 12px; direction: rtl; }
.comp { position: absolute; cursor: move; white-space: nowrap; line-height: 1.25; font-family: var(--font-body); padding: 1px 3px; border: 1px dashed transparent; direction: rtl; touch-action: none; }
.comp:hover { border-color: var(--ink-400); }
.comp.sel { border: 1px solid var(--green-600); background: rgba(18, 104, 58, .06); }
.comp.sel::after { content: attr(data-pos); position: absolute; top: -19px; left: 0; font: 500 10px/1 var(--font-body); background: var(--green-700); color: #fff; padding: 3px 5px; border-radius: 4px; direction: ltr; }
.comp img { display: block; width: 100%; pointer-events: none; }

/* معاينة المستند قبل التصدير */
.preview-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--r); background: #dfe3e0; }

/* ---------- الصفحة الرئيسية ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; background: var(--green-800); color: #fff; padding: 28px 30px; display: flex; align-items: center; gap: 24px; background-image: radial-gradient(90% 140% at 0% 0%, rgba(249, 174, 27, .22), transparent 55%), linear-gradient(120deg, var(--green-900), var(--green-700)); }
.hero h2 { font: 700 25px/1.5 var(--font-display); }
.hero p { color: #cfe6d7; margin-top: 6px; max-width: 60ch; }
.hero .slogan { display: inline-flex; align-items: center; gap: 9px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); padding: 4px 13px; border-radius: 20px; font-size: 12.5px; margin-bottom: 12px; }
.hero .hero-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.hero-next { margin-inline-start: auto; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 16px 18px; min-width: 280px; max-width: 360px; }
.hero-next small { color: #b9d8c5; font-size: 12px; }
.hero-next b { display: block; font: 600 15.5px/1.5 var(--font-display); margin: 4px 0 6px; }
.home-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); width: 100%; text-align: start; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--ink-50); }
.list-row .when { width: 54px; text-align: center; flex: none; border-radius: 10px; background: var(--green-50); color: var(--green-900); padding: 5px 0; line-height: 1.2; }
.list-row .when b { display: block; font: 700 17px var(--font-display); }
.list-row .when small { font-size: 10.5px; }
.list-row .t { font-weight: 600; color: var(--ink-900); }
.shortcut { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.shortcut:last-child { border-bottom: 0; }
.shortcut:hover { background: var(--ink-50); }
.shortcut > i:first-child { width: 38px; height: 38px; border-radius: 11px; background: var(--green-50); color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.shortcut b { display: block; font-weight: 600; color: var(--ink-900); }
.shortcut small { color: var(--muted); font-size: 12px; }
.shortcut .ph-caret-left { margin-inline-start: auto; color: var(--ink-300); }

/* ---------- متابعة الاجتماعات والتصويت ---------- */
.follow-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.follow-card { display: flex; flex-direction: column; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; overflow: hidden; }
.follow-card::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--ink-300); }
.follow-card.open::before { background: var(--blue-600); }
.follow-card:hover { border-color: var(--green-500); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.follow-card h3 { font: 600 15.5px/1.55 var(--font-display); color: var(--ink-900); }
.follow-card .meter { margin-top: 2px; }
.result-card { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 14px 16px; }
.result-card + .result-card { margin-top: 12px; }
.result-card > header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.result-card > header b { display: block; font-weight: 600; color: var(--ink-900); line-height: 1.7; }
.result-card > header small { display: block; font-size: 11.8px; }
.order { width: 28px; height: 28px; border-radius: 8px; background: var(--green-50); color: var(--green-800); display: inline-grid; place-items: center; font: 600 13px var(--font-display); flex: none; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 190px) minmax(60px, 1fr) 44px minmax(84px, auto); align-items: center; gap: 12px; padding: 5px 0; font-size: 13px; }
.bar-row .name { display: flex; align-items: center; gap: 9px; font-weight: 500; min-width: 0; }
.bar-row .bar { height: 12px; border-radius: 7px; background: var(--ink-150); overflow: hidden; }
.bar-row .bar > span { display: block; height: 100%; border-radius: 7px; min-width: 2px; transition: width .5s cubic-bezier(.2, .8, .3, 1); }
.bar-row.yes .bar > span { background: var(--green-600); } .bar-row.no .bar > span { background: var(--red-600); } .bar-row.abstain .bar > span { background: var(--ink-400); }
.bar-row > b { text-align: center; font-size: 15px; font-family: var(--font-display); }
.bar-row > small { font-size: 11.8px; }
.result-card details { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.result-card summary { cursor: pointer; font-size: 12.6px; color: var(--green-800); font-weight: 500; }
.who { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 10px; }
.who > div { display: flex; flex-direction: column; gap: 4px; font-size: 12.8px; }
.pick { display: inline-block; align-self: flex-start; padding: 1px 10px; border-radius: 12px; font-size: 12.2px; font-weight: 600; white-space: nowrap; }
.pick.yes { background: var(--green-100); color: var(--green-800); } .pick.no { background: var(--red-50); color: var(--red-700); } .pick.abstain { background: var(--ink-150); color: var(--ink-700); }

/* صفحة التصويت العامة (يفتحها العضو من جواله) */
.vote-body { background: var(--bg); }
.vote-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 9px 18px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.vote-top img { width: 62px; height: 46px; object-fit: contain; }
.vote-top b { display: block; font: 600 14.5px var(--font-display); color: var(--ink-900); }
.vote-top small { color: var(--muted); font-size: 12px; }
.vote-main { max-width: 760px; margin: 0 auto; padding: 18px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.vote-hero { border-radius: 22px; padding: 26px 24px; color: #fff; background: var(--green-800); background-image: radial-gradient(90% 130% at 0% 0%, rgba(249, 174, 27, .24), transparent 55%), linear-gradient(125deg, var(--green-900), var(--green-700)); box-shadow: var(--shadow-md); }
.vote-hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); padding: 3px 13px; border-radius: 20px; font-size: 12.5px; }
.vote-hero h1 { font: 700 25px/1.5 var(--font-display); margin-top: 12px; }
.vote-hero p { color: #d6ebdd; margin-top: 4px; line-height: 1.9; }
.vote-hero p b { color: #fff; font-weight: 600; }
.vote-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.vote-meta span { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .18); padding: 5px 11px; border-radius: 9px; font-size: 12.6px; }
.vote-meta i { color: var(--amber-500); font-size: 16px; }
.vote-info { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; font-size: 13px; color: var(--ink-700); }
.vote-info > div { display: flex; align-items: flex-start; gap: 9px; line-height: 1.7; } .vote-info i { color: var(--green-700); font-size: 18px; flex: none; margin-top: 3px; }
.vote-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-xs); transition: border-color .2s; }
.vote-card.answered { border-color: var(--green-200); }
.vote-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.6px; margin-bottom: 8px; }
.vote-card > header .chip { max-width: 100%; height: auto; min-height: 26px; white-space: normal; }
.vote-card h2 { font: 600 17px/1.75 var(--font-display); color: var(--ink-900); margin-bottom: 14px; }
.vote-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.choice span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 86px; padding: 10px 6px; border: 1.5px solid var(--ink-200); border-radius: 14px; background: #fff; font-weight: 600; font-size: 14px; color: var(--ink-700); text-align: center; transition: .15s; }
.choice span i { font-size: 27px; color: var(--ink-400); transition: .15s; }
.choice:hover span { border-color: var(--ink-400); }
.choice input:focus-visible + span { box-shadow: var(--ring); }
.choice.yes input:checked + span { background: var(--green-600); border-color: var(--green-600); color: #fff; box-shadow: 0 8px 20px -8px rgba(26, 125, 72, .7); }
.choice.no input:checked + span { background: var(--red-600); border-color: var(--red-600); color: #fff; box-shadow: 0 8px 20px -8px rgba(192, 57, 43, .7); }
.choice.abstain input:checked + span { background: var(--ink-600); border-color: var(--ink-600); color: #fff; }
.choice input:checked + span i { color: #fff; }
.vote-candidates { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 9px; }
.cand { position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1.5px solid var(--ink-200); border-radius: 14px; cursor: pointer; transition: .15s; }
.cand input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cand b { flex: 1; font-weight: 500; font-size: 14px; }
.cand > i { font-size: 22px; color: var(--ink-200); }
.cand:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }
.cand:has(input:checked) > i { color: var(--green-600); }
.cand.off { opacity: .5; cursor: not-allowed; }
.vote-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(16, 32, 23, .35); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.vote-bar .in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.vote-bar .progress { flex: 1; min-width: 0; font-size: 12.8px; color: var(--ink-600); }
.vote-bar .meter { margin-top: 6px; }
.vote-notice { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 20px; }
.vote-notice > i { font-size: 54px; display: block; margin-bottom: 8px; }
.vote-notice h1 { font: 700 20px/1.6 var(--font-display); color: var(--ink-900); }
.vote-notice p { color: var(--ink-600); margin-top: 6px; line-height: 1.9; max-width: 46ch; margin-inline: auto; }
.vote-notice.ok { border-color: var(--green-200); background: var(--green-50); } .vote-notice.ok > i { color: var(--green-600); }
.vote-notice.warn > i { color: var(--amber-600); } .vote-notice.bad > i { color: var(--red-600); }
.vote-summary { list-style: none; margin: 0; padding: 0; }
.vote-summary li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); line-height: 1.7; }
.vote-summary li:last-child { border-bottom: 0; }
.vote-summary small { display: block; color: var(--muted); font-size: 11.8px; }
.vote-foot { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-400); font-size: 12px; padding: 0 16px 130px; }
@media (max-width: 520px) {
  .vote-hero { padding: 22px 18px; border-radius: 18px; } .vote-hero h1 { font-size: 21px; }
  .choice span { min-height: 78px; font-size: 13px; }
  .vote-bar .in { flex-direction: column; align-items: stretch; gap: 9px; } .vote-bar .btn { width: 100%; }
  .bar-row { grid-template-columns: 1fr 44px; } .bar-row .bar { grid-column: 1 / -1; order: 3; } .bar-row > small { grid-column: 1 / -1; order: 4; }
}

/* ---------- شاشات الدخول ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; background: var(--bg); }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; padding: 56px clamp(28px, 5vw, 72px); color: #fff;
  background: var(--ink-800); background-image: radial-gradient(90% 70% at 100% 0%, rgba(18, 104, 58, .55), transparent 62%), radial-gradient(70% 60% at 0% 100%, rgba(249, 174, 27, .16), transparent 60%); }
.auth-brand::after { content: ""; position: absolute; inset-inline-start: -70px; bottom: -70px; width: 220px; height: 220px; background: var(--amber-500); opacity: .9; transform: rotate(45deg); border-radius: 26px; }
.auth-logo { background: #fff; border-radius: 22px; padding: 10px 22px; box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .6); margin-bottom: 10px; }
.auth-logo img { width: 230px; height: 190px; object-fit: contain; }
.auth-brand .slogan { display: inline-flex; align-items: center; gap: 9px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); padding: 4px 14px; border-radius: 20px; font-size: 12.8px; }
.auth-brand h1 { font: 700 30px/1.5 var(--font-display); position: relative; z-index: 1; }
.auth-brand p { color: #cfd6d1; max-width: 42ch; line-height: 2; position: relative; z-index: 1; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 22px 22px; }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md); padding: 30px 30px 26px; animation: rise .3s cubic-bezier(.2, .8, .3, 1) both; }
.auth-card h2 { font: 700 21px/1.5 var(--font-display); color: var(--ink-900); }
.auth-card > p.muted { margin: 6px 0 20px; line-height: 1.9; }
.auth-card .alert { margin-bottom: 16px; }
.auth-card .form-row > label { font-size: 13.2px; }
.auth-card .input { min-height: 44px; font-size: 15px; }
.auth-main .page-foot { margin-top: 26px; }
.pw-field { position: relative; }
.pw-field .input { padding-inline-start: 44px; }
.pw-field .icon-btn { position: absolute; inset-inline-start: 5px; top: 50%; transform: translateY(-50%); }
.form-row .field-error:empty { display: none; }

/* شبكة الصلاحيات */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.perm-grid fieldset { margin: 0; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px 10px; min-width: 0; background: var(--ink-50); }
.perm-grid legend { font: 600 12.5px var(--font-display); color: var(--green-800); padding: 0 6px; }
.check.perm { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; }
.check.perm input { margin-top: 4px; flex: none; }
.check.perm b { display: block; font-weight: 500; font-size: 13px; color: var(--ink-900); line-height: 1.6; }
.check.perm small { display: block; color: var(--muted); font-size: 11.8px; line-height: 1.6; }
.check.perm input:disabled ~ span b { color: var(--ink-600); }

/* ---------- الحركة ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page > * { animation: rise .26s cubic-bezier(.2, .8, .3, 1) both; }
.page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; } .page > *:nth-child(n+4) { animation-delay: .11s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- الاستجابة ---------- */
.side-overlay { display: none; }
@media (max-width: 1180px) {
  .tb-btn .text { display: none; }
  .tb-user .who { display: none; }
  .designer { grid-template-columns: 1fr; }
  .designer-panel { position: static; max-height: none; }
  .home-cols { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 26px 22px; align-items: center; text-align: center; gap: 8px; }
  .auth-brand::after, .auth-brand p { display: none; }
  .auth-logo img { width: 150px; height: 110px; }
  .auth-brand h1 { font-size: 21px; }
  .auth-main { justify-content: flex-start; padding-top: 22px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, var(--side-w)); transform: translateX(105%); transition: transform .25s ease; }
  body.side-open .side { transform: none; box-shadow: var(--shadow-lg); }
  body.side-open .side-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20, 28, 23, .45); }
  .menu-toggle { display: inline-grid; }
  .page { padding: 18px 14px 32px; }
  .topbar { padding: 0 12px; }
  .workspace, .workspace.narrow { grid-template-columns: 1fr; }
  .vtabs { position: static; flex-direction: row; overflow-x: auto; }
  .vtab { white-space: nowrap; }
  .vtab.active::after, .vtab.error::after { display: none; }
  .sheet { grid-template-columns: minmax(120px, 170px) minmax(0, 1fr); }
  .sheet > .fld.span { grid-column: span 1; }
  .hero { flex-direction: column; align-items: stretch; }
  .hero-next { margin: 0; max-width: none; }
  .addr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sheet { grid-template-columns: 1fr; }
  .sheet > .lbl { box-shadow: none; padding-bottom: 2px; background: #fff; }
  .page-title { font-size: 20px; }
  .page-icon { display: none; }
  .ticker-label span { display: none; }
  .form-cols { grid-template-columns: 1fr; }
  .grid-search .input { width: 150px; }
  .topbar-search { flex: 1; }
  .tb-hide-sm { display: none; }
  .topbar-actions { gap: 0; }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .menu.wide { width: min(92vw, 380px); }
}
@media print { .side, .topbar, .ticker, .toast-stack { display: none !important; } }
