/* ═══════════════════════════════════════════════════════════════════
   بوابة مزوّدي البيانات — Provider Portal (SDA)
   هوية بصرية عصرية: بطاقات ناعمة، ألوان نقية، تحسينات حركية وتجاوب كامل.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  --bg: #eef1f8;
  --bg-deep: #e7ebf4;
  --ink: #0b1220;
  --text: #1f2a44;
  --muted: #64748b;
  --line: #e6eaf2;
  --line-strong: #d3dae6;

  --panel: #ffffff;
  --panel-soft: #f7f9fd;
  --panel-soft-2: #eef3fb;

  --nav-0: #0b1020;
  --nav-1: #101b38;
  --nav-2: #14213f;

  --primary: #4f46e5;
  --primary-2: #4338ca;
  --primary-soft: #eef0ff;
  --primary-soft-2: #dfe3ff;
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);

  --teal: #0d9488;
  --teal-2: #0f766e;
  --teal-soft: #e6fbf9;
  --teal-soft-2: #d1f4ef;
  --grad-teal: linear-gradient(135deg, #14b8a6, #0d9488 55%, #0f766e);

  --gold: #d97706;
  --gold-soft: #fff7e6;
  --danger: #e11d48;
  --danger-soft: #fff0f3;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fff7ed;

  --shadow-xs: 0 1px 2px rgba(11, 18, 32, .05);
  --shadow-sm: 0 1px 3px rgba(11, 18, 32, .06), 0 1px 2px rgba(11, 18, 32, .04);
  --shadow-md: 0 14px 34px rgba(11, 18, 32, .10), 0 3px 8px rgba(11, 18, 32, .05);
  --shadow-lg: 0 30px 64px rgba(11, 18, 32, .16), 0 6px 18px rgba(11, 18, 32, .07);

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --ring: 0 0 0 4px rgba(79, 70, 229, .16);
  --ring-teal: 0 0 0 4px rgba(13, 148, 136, .14);

  --font-safe: "Cairo", "Segoe UI", Tahoma, "Helvetica Neue", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(79, 70, 229, .10), transparent 60%),
    radial-gradient(900px 480px at -6% 2%, rgba(13, 148, 136, .09), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  background-attachment: fixed;
  font-family: var(--font-safe);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(15, 23, 42, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent 78%);
}

::selection { color: #fff; background: var(--primary); }
:focus-visible { outline: none; }

/* ─────────────────────────── الشريط العلوي ─────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 22px;
  color: #dbe4f5;
  background: linear-gradient(100deg, var(--nav-0), var(--nav-1) 55%, var(--nav-2));
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 14px 34px rgba(11, 18, 32, .30);
}

.brand, .topbar-actions, .user-chip, .api-label { display: flex; align-items: center; }

.brand { gap: 12px; }
.brand strong { display: block; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: .1px; }
.brand small { display: block; color: #93a6c8; font-size: 11.5px; }

.logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #c7d2fe;
  background: linear-gradient(140deg, rgba(99, 102, 241, .30), rgba(124, 58, 237, .16));
  border: 1px solid rgba(165, 180, 252, .30);
  border-radius: 12px;
  box-shadow: inset 0 0 16px rgba(129, 140, 248, .14);
}
.logo svg { display: block; width: 22px; height: 22px; }

.topbar-actions { flex-wrap: wrap; gap: 10px; }

.api-label { gap: 8px; color: #b9c8dc; font-size: 11.5px; font-weight: 700; }

.api-label input {
  width: 240px;
  padding: 8px 12px;
  direction: ltr;
  color: #eef4ff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-sm);
  box-shadow: none;
  min-height: 36px;
}
.api-label input:focus { border-color: rgba(165, 180, 252, .7); box-shadow: 0 0 0 3px rgba(99, 102, 241, .25); }

.user-chip {
  gap: 9px;
  min-height: 40px;
  padding: 5px 8px 5px 13px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
}
.user-chip .u-name { color: #fff; font-weight: 800; font-size: 13.5px; }
.user-chip .u-role {
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 800;
  background: rgba(99, 102, 241, .28);
  padding: 2px 10px;
  border-radius: 999px;
}
.user-chip button {
  padding: 5px 12px;
  color: #fecdd3;
  background: rgba(225, 29, 72, .20);
  border: 1px solid rgba(254, 205, 211, .26);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12.5px;
  transition: background .15s, transform .1s;
}
.user-chip button:hover { background: rgba(225, 29, 72, .36); }

/* ─────────────────────────── الهيكل العام ─────────────────────────── */
.container {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 70px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

.empty {
  padding: 26px 18px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
}

code, .list-item code {
  display: inline-flex;
  align-items: center;
  direction: ltr;
  max-width: 100%;
  padding: 2px 9px;
  color: #3b4a8a;
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-2);
  border-radius: 999px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

/* ─────────────────────────── شاشة الدخول ─────────────────────────── */
.login-shell {
  display: grid;
  grid-template-columns: minmax(340px, 1.15fr) minmax(360px, 460px);
  gap: 24px;
  align-items: stretch;
  max-width: 1120px;
  margin: 46px auto 0;
}

.login-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 460px;
  padding: 44px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(620px 320px at 100% 0%, rgba(129, 140, 248, .30), transparent 60%),
    radial-gradient(520px 300px at 0% 100%, rgba(20, 184, 166, .22), transparent 60%),
    linear-gradient(150deg, #3840b8 0%, #1c2350 55%, #0b1020 100%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-copy::after {
  position: absolute;
  inset: auto -70px -100px auto;
  width: 300px;
  height: 300px;
  content: "";
  background: radial-gradient(circle, rgba(124, 58, 237, .34), transparent 65%);
  filter: blur(8px);
}

.login-copy h1 {
  max-width: 640px;
  margin: 8px 0 4px;
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -.3px;
}

.login-copy p { max-width: 580px; margin: 0; color: #cfd9ef; font-size: 15px; }

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 10px;
  padding: 0;
  list-style: none;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e3e9fb;
  font-size: 13.5px;
}
.feature-list li::before {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  content: "✓";
  color: #101d4d;
  background: linear-gradient(135deg, #a5b4fc, #c7d2fe);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}

.login-stack { margin-top: auto; position: relative; z-index: 1; }

.login-seal {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  color: #1e1233;
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .34);
}
.login-seal svg { width: 28px; height: 28px; }

.login-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 13px;
  color: rgba(233, 239, 255, .78);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.login-note::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: #a5b4fc;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(165, 180, 252, .2);
}

.login-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.login-panel-head h2 { margin: 0; font-size: 19px; }
.login-panel-head p { margin: 2px 0 0; }
.login-panel-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-2);
  border-radius: 14px;
}
.login-panel-icon svg { width: 24px; height: 24px; }

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 11.5px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 11px;
  color: var(--primary-2);
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2px;
}

.login-copy .eyebrow {
  color: #dfe5ff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
}

/* ─────────────────────────── اللوحات والرؤوس ─────────────────────────── */
.panel, .workspace-shell, .panel-lite {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel { min-width: 0; padding: 22px; }
.login-panel { max-width: none; margin: 0; padding: 32px; }

.panel-lite {
  margin: 14px 0;
  padding: 16px;
  background: var(--panel-soft);
  box-shadow: none;
}

.workspace-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-head h1 {
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.3px;
}
.panel-head p { margin: 0; }

.panel h1, .panel h2, .panel h3 { color: var(--ink); letter-spacing: 0; }
.panel h1 { margin: 0 0 8px; font-size: 22px; font-weight: 900; }
.panel h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 15.5px;
  font-weight: 800;
}
.panel h2::before {
  width: 5px;
  height: 17px;
  content: "";
  background: var(--grad-primary);
  border-radius: 5px;
  box-shadow: 0 0 12px rgba(99, 102, 241, .35);
}
.panel h3 { margin: 0 0 10px; font-size: 14px; font-weight: 800; }

.subhead { margin: 18px 0 8px; color: var(--muted); font-size: 13px; font-weight: 800; }

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-title-row h2, .panel-title-row h3 { margin: 0; }

/* ─────────────────────────── بطاقات الإحصاء ─────────────────────────── */
.ops-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 112px;
  padding: 18px 18px 16px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.stat-card::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  content: "";
  background: var(--grad-primary);
}
.stat-card:nth-child(2)::before { background: var(--grad-teal); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card:nth-child(4)::before { background: var(--grad-primary); }

.stat-label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.stat-card strong { display: block; margin: 2px 0; color: var(--ink); font-size: 30px; font-weight: 900; line-height: 1.15; }
.stat-card small { display: block; direction: ltr; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

/* ─────────────────────────── التبويبات ─────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 12px 12px 0;
  background: linear-gradient(180deg, var(--panel-soft-2), var(--panel-soft));
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 40px;
  padding: 9px 16px;
  color: #5b6a84;
  background: transparent;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
  transition: background .15s, color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.tab-btn.active {
  position: relative;
  color: var(--primary-2);
  background: #fff;
  border-color: var(--line) var(--line) #fff;
  box-shadow: 0 -6px 18px rgba(79, 70, 229, .08);
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  inset: auto 12px -1px 12px;
  height: 3px;
  background: var(--grad-primary);
  border-radius: 3px 3px 0 0;
}

.tab-pane { display: none; min-width: 0; padding: 22px; animation: fade .22s ease; }
.tab-pane.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────── الشبكات ─────────────────────────── */
.tab-pane > .grid-2,
#view-provider > .grid-2 {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.25fr);
  gap: 18px;
  align-items: start;
}

.form .grid-2, .panel .form .grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

#tab-register .panel { max-width: 100%; }

.form { display: flex; flex-direction: column; gap: 14px; }

.form-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.field label, .repeat-item .field label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.field .req { color: var(--danger); font-weight: 900; }

/* ─────────────────────────── عناصر الإدخال ─────────────────────────── */
input, textarea, select {
  max-width: 100%;
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #9aa8bb; }

textarea {
  min-height: 88px;
  resize: vertical;
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-inline-end: 8px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* قائمة الفلاتر المتعددة (filterColumns) */
select[multiple] {
  min-height: 112px;
  padding: 6px;
  background-image: none;
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
}
select[multiple] option {
  margin: 3px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 700;
}
select[multiple] option:checked {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
}

input[type="date"] { direction: ltr; text-align: center; }

:where(input, textarea, select):focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: #fff;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.checks label, label.checks {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ─────────────────────────── الأزرار ─────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1px;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, filter .15s ease;
}
.btn:focus-visible { box-shadow: var(--ring); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .56; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary {
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 12px 26px rgba(99, 102, 241, .34);
}
.btn.primary:hover { filter: brightness(1.06); }

.btn.secondary {
  color: #344054;
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn.secondary:hover { border-color: var(--primary); color: var(--primary-2); }

.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: #ffd1db; }
.btn.danger:hover { background: #ffe3e9; }

.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12px; border-radius: var(--radius-xs); }

/* ─────────────────────────── القوائم ─────────────────────────── */
.list-box { display: flex; flex-direction: column; gap: 9px; }

.list-item {
  display: grid;
  gap: 5px;
  padding: 14px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 4px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s, background .15s, transform .12s ease;
}

.provider-row, .topic-row { cursor: pointer; }

.provider-row:hover, .topic-row:hover {
  background: #fbfcff;
  border-color: var(--primary-soft-2);
  border-inline-start-color: var(--primary);
  box-shadow: 0 12px 26px rgba(79, 70, 229, .10);
  transform: translateY(-1px);
}

.list-item .lb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

/* ─────────────────────────── النتائج / المعلومات ─────────────────────────── */
.result-box {
  max-height: 430px;
  margin-top: 12px;
  padding: 14px;
  overflow: auto;
  direction: ltr;
  color: #dfe9ff;
  background: #0d1428;
  border: 1px solid #25344f;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.65;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .3);
}
.result-box.ok { border-color: var(--ok); box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .35); }
.result-box.err { border-color: var(--danger); box-shadow: inset 0 0 0 1px rgba(225, 29, 72, .4); }

.error-msg { color: var(--danger); font-size: 13px; font-weight: 700; }

.meta {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  gap: 9px 12px;
  margin: 0 0 16px;
  padding: 15px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.meta dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.meta dd { margin: 0; color: var(--ink); font-weight: 800; }

/* ─────────────────────────── المقاطع والأقسام ─────────────────────────── */
.form-section {
  counter-increment: section;
  margin-top: 18px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(79, 70, 229, .02), transparent),
    var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}
.form-section h3::before {
  counter-increment: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  content: counter(section);
  color: var(--primary-2);
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-2);
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 900;
}

.section-hint {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.field-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.repeater { display: flex; flex-direction: column; gap: 11px; }

.repeat-item {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 11px;
  align-items: end;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, transform .12s ease;
}
.repeat-item:hover { border-color: var(--primary-soft-2); box-shadow: var(--shadow-sm); }

.repeat-item .rm-btn {
  width: 34px;
  height: 34px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #ffd1db;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background .15s, transform .12s;
}
.repeat-item .rm-btn:hover { background: #ffe3e9; transform: rotate(90deg); }

.add-btn {
  min-height: 42px;
  color: var(--primary-2);
  background: var(--primary-soft);
  border: 1.5px dashed var(--primary-soft-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  transition: background .15s, border-color .15s;
}
.add-btn:hover { background: var(--primary-soft-2); border-color: var(--primary); }

.c-layer-hint {
  display: block;
  grid-column: 1 / -1;
  margin-top: -2px;
}

/* نطاق التواريخ في الفلاتر */
.f-range-field {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: center;
}
.f-range-field label { font-size: 11.5px; color: var(--muted); font-weight: 800; }
.f-range-field input[type="date"] { min-height: 38px; padding: 6px 9px; }

.permission-disabled { opacity: .55; cursor: not-allowed; }

/* ─────────────────────────── التنبيهات ─────────────────────────── */
.toasts {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: start;
  gap: 10px;
  max-width: 420px;
  padding: 13px 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
  animation: toast-in .25s cubic-bezier(.2, .9, .3, 1.2);
}
.toast::before {
  content: "ℹ";
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}
.toast.err { border-inline-start-color: var(--danger); }
.toast.err::before { background: var(--danger); content: "✕"; }
.toast.warn { border-inline-start-color: var(--gold); }
.toast.warn::before { background: var(--gold); content: "!"; }
.toast.ok { border-inline-start-color: var(--ok); }
.toast.ok::before { background: var(--ok); content: "✓"; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notice ol { padding-right: 18px; line-height: 1.9; font-size: 14px; }
.notice li + li { margin-top: 10px; }
.notice li strong { color: var(--primary-2); }

/* ─────────────────────────── التجاوب ─────────────────────────── */
@media (max-width: 1180px) {
  .login-shell { grid-template-columns: 1fr; max-width: 640px; }
  .login-copy { min-height: 0; }
  .tab-pane > .grid-2, #view-provider > .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 1120px) {
  .ops-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 20px, 1440px); padding-top: 18px; }
  .topbar, .topbar-actions, .api-label { align-items: stretch; flex-direction: column; }
  .api-label input { width: 100%; }
  .ops-strip, .form .grid-2, .panel .form .grid-2,
  .tab-pane > .grid-2, #view-provider > .grid-2, .repeat-item, .repeat-item.compact {
    grid-template-columns: 1fr;
  }
  .login-copy { padding: 28px; }
  .login-copy h1 { font-size: 28px; }
  .panel, .tab-pane { padding: 16px; }
  .tab-pane { padding: 16px 12px; }
  .tabs { padding: 10px 10px 0; }
  .panel-title-row, .list-item .lb { align-items: stretch; flex-direction: column; }
  .panel-head { flex-direction: column; align-items: stretch; }
}

/* ─────────────────────────── تفضيل تقليص الحركة ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}