/* نظام التصميم — مستوحى من شكل فريشا كما يُرى في لقطاتها، لا من مواصفة
   رسمية (انظر التحذير في docs/FRESHA_HARVEST_AR.md §15). الفارق الأكبر
   كان أن الخلفية والبطاقة كلتاهما بيضاء، فلا تُقرأ البطاقة كبطاقة. */
:root {
  --bg: #f5f5f5;          /* خلفية الصفحة رمادي فاتح جدًا */
  --surface: #ffffff;     /* البطاقات والجداول */
  --surface-2: #fafafa;
  --ink: #0d0d0d;         /* لا أسود خالص */
  --muted: #767676;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --black: #17170f;
  --mint: #7d7b26;
  --mint-soft: #f0efd8;
  --coral: #f9735b;
  --coral-soft: #ffe5df;
  --blue: #2563eb;
  --blue-soft: #e0ecff;
  --amber: #a8735c;
  --amber-soft: #f6e8e1;
  --violet: #6d5dfc;
  --shadow: 0 2px 8px rgba(19, 19, 19, 0.08), 0 6px 24px rgba(13, 22, 25, 0.06);

  /* الانحناءات: تباين متعمّد — بطاقات ناعمة وأزرار/حقول كبسولات كاملة */
  --radius: 12px;         /* البطاقات */
  --radius-icon: 8px;     /* أزرار الأيقونات — ليست كبسولة */
  --pill: 999px;          /* الأزرار والحقول */

  /* الارتفاعات */
  --h-button: 40px;
  --h-icon-btn: 44px;
  --h-input: 40px;
  --h-row: 72px;          /* صف الجدول عالٍ ليتسع لسطرين وصورة */

  /* تفاعل الشريط الجانبي */
  --hover-bg: rgba(0, 0, 0, 0.04);
  --focus-bg: rgba(0, 0, 0, 0.08);
  --ease: all 0.2s ease;

  --sidebar: 72px;
  --browser-safe-edge: 52px;
  --topbar: 70px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* Roobert خط تجاري. Inter أقرب بديل حر للاتيني، وللعربي نعتمد خطوط
     النظام (SF Arabic على أبل، Segoe UI على ويندوز) قبل Tahoma. */
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Arabic",
               "Segoe UI", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  display: none;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.12), transparent 32%),
    var(--bg);
}

body.auth-locked .auth-screen {
  display: grid;
}

.auth-card {
  width: min(760px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--black);
  padding: 8px;
}

.auth-brand img.auth-logo-full {
  width: auto;
  height: 60px;
  background: none;
  padding: 0;
  border-radius: 0;
}

.auth-brand div,
.auth-copy,
.role-picker button {
  display: grid;
  gap: 4px;
}

.auth-brand strong {
  font-size: 22px;
}

.auth-brand span,
.auth-card p,
.auth-copy p,
.role-picker span,
.user-chip em {
  color: var(--muted);
}

.auth-copy h1 {
  margin: 0;
  font-size: 28px;
}

.auth-form,
.role-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  font-weight: 500;
}

.auth-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface-2);
  outline: none;
}

.role-picker button {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  text-align: right;
}

.role-picker button.active {
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.auth-submit {
  min-height: 46px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--browser-safe-edge) var(--sidebar) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

/* بدون min-height:0 يتمدّد العمود مع أطول محتوى بدل ما يعمل تمرير داخلي */
.app-shell > * {
  min-height: 0;
}

.sidebar {
  grid-column: 2;
  background: var(--black);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  z-index: 50;
  position: relative;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.workspace {
  grid-column: 3;
}

.nav-indicator {
  position: absolute;
  right: 0;
  top: var(--nav-indicator-top, 84px);
  width: 4px;
  height: var(--nav-indicator-height, 28px);
  background: var(--mint);
  border-radius: 4px 0 0 4px;
  transform: translateY(var(--nav-indicator-y, 0));
  transition:
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    top 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 180ms ease,
    opacity 160ms ease;
  opacity: var(--nav-indicator-opacity, 1);
  pointer-events: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #111318;
}

.brand-mark img {
  width: auto;
  height: 32px;
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  align-items: center;
}

.nav-settings {
  margin-top: auto;
}

.nav-btn {
  width: 44px;
  height: 44px;
  transition: var(--ease);
  display: grid;
  place-items: center;
  border: 0;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  border-radius: var(--radius);
  position: relative;
}

.nav-btn:hover {
  color: #fff;
  background: #242731;
}

/* النشط: مربع ممتلئ بلون الهوية — نفس أسلوب فريشا */
.nav-btn.active {
  color: #fff;
  background: var(--mint);
  border-radius: 12px;
}

/* نقطة تنبيه على الأيقونة نفسها */
.nav-btn[data-badge]::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: var(--topbar) minmax(0, 1fr);
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
}

.business-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.business-block strong {
  font-size: 22px;
}

.business-block span,
.eyebrow,
.staff-head span,
.waitlist-item span,
.team-card span,
.service-row span,
.profile-head span,
.rule-row span,
.segment-row span,
.wallet-preview span,
.builder-row span,
.kpi-card span,
.metric-strip span,
.source-list span,
.activity-feed time {
  color: var(--muted);
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  min-height: var(--h-input);
  padding: 0 16px;
  outline: none;
  background: var(--surface);
  font-size: 15px;
}

.search-box input:focus,
.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.search-box.slim {
  max-width: 280px;
  min-width: 220px;
}

.top-actions,
.toolbar-group,
.date-switcher,
.table-toolbar,
.section-head,
.drawer-actions,
.profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  justify-content: end;
}

.user-chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 4px 9px;
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 8px;
  text-align: right;
}

.user-chip span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--black);
  color: #fff;
  font-weight: 600;
}

.user-chip strong {
  line-height: 1.1;
}

.user-chip em {
  font-style: normal;
  font-size: 12px;
}

.nav-btn.locked {
  opacity: 0.28;
  cursor: not-allowed;
}

.icon-btn,
.primary-btn,
.secondary-btn,
.pill-btn,
.segmented,
.text-btn {
  border-radius: var(--pill);
  min-height: var(--h-button);
  font-weight: 400;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--ease);
}

.icon-btn:hover,
.pill-btn:hover,
.secondary-btn:hover,
.segmented:hover {
  background: var(--hover-bg);
}

a.secondary-btn,
a.primary-btn {
  text-decoration: none;
}

.icon-btn {
  width: var(--h-icon-btn);
  min-height: var(--h-icon-btn);
  border-radius: var(--radius-icon);
  border-color: transparent;
  background: transparent;
  padding: 0;
  position: relative;
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.primary-btn {
  border-color: var(--black);
  background: var(--black);
  color: #fff;
  padding: 0 14px;
  font-weight: 500;
}

.secondary-btn {
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.pill-btn,
.segmented {
  padding: 0 12px;
}

.pill-btn.active,
.segmented.active {
  background: var(--mint-soft);
  border-color: #9ce5dc;
  color: #087266;
}

.text-btn {
  border: 0;
  padding: 0;
  min-height: auto;
  background: transparent;
  color: var(--blue);
  font-weight: 500;
}

.view {
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 28px;
}

.view.active {
  display: block;
}

.view-header {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.view-header h1 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 500;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.date-switcher {
  min-width: 280px;
  justify-content: center;
}

.calendar-page-grid,
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  min-height: calc(100vh - 148px);
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
  min-height: auto;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  margin-top: 12px;
}

.dashboard-schedule {
  margin-top: 0;
}

.timeline-list {
  display: grid;
  gap: 8px;
}

.timeline-list button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  min-height: 62px;
  padding: 10px;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  text-align: right;
  align-items: center;
}

.timeline-list time {
  grid-row: 1 / 3;
  color: var(--muted);
  font-weight: 600;
}

.timeline-list strong {
  font-size: 15px;
}

.timeline-list span {
  color: var(--muted);
}

.timeline-list em {
  grid-row: 1 / 3;
  font-style: normal;
  color: #087266;
  background: var(--mint-soft);
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.alert-stack {
  display: grid;
  gap: 8px;
}

.alert-stack button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.alert-stack span {
  color: var(--muted);
}

.setup-progress {
  height: 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.setup-progress span {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--mint);
}

.calendar-panel,
.insights-panel,
.report-builder,
.table-panel,
.client-profile,
.category-list,
.assignment-panel,
.team-member-panel,
.shift-panel,
.operations-panel,
.campaign-panel,
.campaign-performance-panel,
.growth-tools-panel,
.rule-panel,
.segments-panel,
.wallet-panel,
.packages-panel,
.commission-panel,
.link-builder-panel,
.launch-panel,
.settings-panel,
.phone-preview,
.chart-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.calendar-panel {
  min-width: 0;
  overflow: hidden;
}

.staff-header-row {
  /* عدد الأعمدة يأتي من عدد الفريق الفعلي لا من رقم ثابت */
  --staff-columns: 2;
  display: grid;
  grid-template-columns: 78px repeat(var(--staff-columns), 1fr);
  min-height: 94px;
  border-bottom: 1px solid var(--line);
}

.time-spacer {
  border-left: 1px solid var(--line);
}

.staff-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-left: 1px solid var(--line);
}

/* أعمدة الأيام في عرض الأسبوع */
.staff-head-day {
  cursor: pointer;
  flex-direction: column;
  gap: 2px;
  transition: var(--ease);
}

.staff-head-day:hover {
  background: var(--hover-bg);
}

.staff-head-day.is-closed {
  background: var(--surface-2);
}

.staff-head-day.is-closed strong,
.staff-head-day.is-closed span {
  color: var(--muted);
}

.staff-head-day.is-today strong {
  color: var(--mint);
}

.staff-head-day.is-today {
  box-shadow: inset 0 -2px 0 var(--mint);
}

/* عمود جلسات الأجهزة: بلا صورة، ويتميّز بصريًا عن أعمدة الفريق */
.staff-head-device {
  background: var(--surface-2, #f6f7f5);
}

.staff-head-device strong {
  color: var(--muted);
}

.staff-head img,
.team-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #c8f6f0;
}

.staff-head div,
.team-card div,
.service-row div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-grid-wrap {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  height: 690px;
}

.time-rail {
  display: grid;
  grid-template-rows: repeat(12, 1fr);
  border-left: 1px solid var(--line);
  background: var(--surface-2);
}

.time-rail span {
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

.calendar-grid {
  --staff-columns: 2;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--staff-columns), minmax(180px, 1fr));
  grid-template-rows: repeat(22, 1fr);
  position: relative;
  background:
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(227, 229, 234, 0.65) calc(50% - 0.5px), rgba(227, 229, 234, 0.65) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    repeating-linear-gradient(to bottom, #fff 0 31px, #eef0f3 32px);
}

.calendar-grid::before {
  content: "";
  position: absolute;
  inset: 0 50% 0 auto;
  width: 1px;
  background: var(--line-strong);
  pointer-events: none;
}

.off-hours {
  background:
    repeating-linear-gradient(135deg, rgba(20, 20, 23, 0.04) 0 4px, transparent 4px 9px),
    rgba(245, 246, 248, 0.72);
  z-index: 1;
  pointer-events: none;
}

.staff-one {
  grid-column: 1;
}

.staff-two {
  grid-column: 2;
}

.off-top {
  grid-row: 1 / 5;
}

.off-bottom {
  grid-row: 23 / 23;
}

.slot-hit {
  grid-column: var(--col);
  grid-row: var(--row) / span var(--span);
  border: 0;
  background: transparent;
  z-index: 2;
}

.slot-hit:hover {
  background: rgba(20, 184, 166, 0.08);
  outline: 1px dashed rgba(20, 184, 166, 0.45);
  outline-offset: -4px;
}

.appointment {
  grid-column: var(--col);
  grid-row: var(--row) / span var(--span);
  margin: 4px 6px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 3;
  min-width: 0;
  color: var(--ink);
}

.appointment strong,
.appointment span,
.appointment em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.appt-coral {
  background: var(--coral-soft);
  border-color: #ffb5a8;
}

.appt-mint {
  background: var(--mint-soft);
  border-color: #9ce5dc;
}

.appt-blue {
  background: var(--blue-soft);
  border-color: #aac5ff;
}

.appt-amber {
  background: var(--amber-soft);
  border-color: #ffd56a;
}

.now-line {
  grid-column: 1 / -1;
  grid-row: var(--row);
  height: 2px;
  background: var(--violet);
  z-index: 4;
  position: relative;
  align-self: start;
}

.now-line span {
  position: absolute;
  right: 8px;
  top: -14px;
  color: var(--violet);
  background: #f3f0ff;
  border: 1px solid #dad3ff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
}

.insights-panel {
  padding: 14px;
  min-width: 0;
}

.insights-panel.standalone {
  min-height: 100%;
}

.metric-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.metric-strip div,
.kpi-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-strip strong,
.kpi-card strong {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.panel-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.panel-section.flush {
  border-top: 0;
  margin-top: 16px;
  padding-top: 0;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2,
.report-builder h2,
.assignment-panel h2,
.operations-panel h2,
.campaign-panel h2,
.growth-tools-panel h2,
.rule-panel h2,
.segments-panel h2,
.wallet-panel h2,
.packages-panel h2,
.commission-panel h2,
.link-builder-panel h2,
.booking-channel-panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.waitlist-item,
.activity-feed li,
.builder-row,
.rule-row,
.segment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.waitlist-item {
  flex-direction: column;
  align-items: flex-start;
}

.activity-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-feed li {
  align-items: flex-start;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.checkout-panel,
.receipt-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.checkout-customer {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.checkout-customer div:not(.avatar-letter) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkout-customer span,
.invoice-line span,
.discount-row strong,
.loyalty-earned span {
  color: var(--muted);
}

.checkout-items {
  display: grid;
  gap: 8px;
}

.invoice-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
}

.invoice-line div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.invoice-line > span {
  color: var(--ink);
  font-weight: 600;
}

.discount-row {
  margin: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.discount-row > div {
  display: grid;
  gap: 9px;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.payment-methods button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 44px;
  font-weight: 500;
}

.payment-methods button.active {
  color: #087266;
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.receipt-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.receipt-panel h2 {
  margin: 0;
}

.receipt-row,
.receipt-total,
.loyalty-earned {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.receipt-row {
  color: var(--muted);
}

.receipt-total {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.receipt-total strong {
  font-size: 26px;
}

.loyalty-earned {
  background: var(--amber-soft);
  border: 1px solid #ffd56a;
  border-radius: var(--radius);
  padding: 10px;
}

.tax-panel {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 2px;
  display: grid;
  gap: 10px;
}

.tax-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.tax-summary span,
.tax-qr-wrap span {
  color: var(--muted);
}

.tax-summary strong {
  text-align: left;
  direction: ltr;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tax-qr-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.tax-qr-wrap div:last-child {
  display: grid;
  gap: 4px;
}

.tax-qr {
  width: 74px;
  height: 74px;
  border-radius: 6px;
  border: 6px solid #fff;
  background:
    linear-gradient(90deg, #111318 10px, transparent 10px 16px, #111318 16px 22px, transparent 22px 34px, #111318 34px 42px, transparent 42px),
    linear-gradient(#111318 8px, transparent 8px 14px, #111318 14px 20px, transparent 20px 31px, #111318 31px 38px, transparent 38px),
    repeating-linear-gradient(45deg, #111318 0 4px, #fff 4px 8px);
  background-blend-mode: multiply;
}

.sales-history {
  grid-column: 1 / -1;
}

.report-main {
  min-width: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.kpi-card em {
  color: #087266;
  font-style: normal;
  font-weight: 500;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 12px;
  margin-top: 12px;
}

.report-library-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}

.report-library-panel .table-toolbar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-library-panel .table-toolbar span,
.report-card small,
.report-folder-list span {
  color: var(--muted);
}

.select-pill {
  min-height: var(--h-input);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  padding: 0 14px;
  color: var(--ink);
  font-size: 15px;
}

.report-catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-height: 92px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  text-align: right;
}

.report-card.active {
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.report-card div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.report-card em {
  font-style: normal;
  font-size: 12px;
  color: #087266;
  font-weight: 600;
  white-space: nowrap;
}

.report-star {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.report-star.active {
  color: var(--amber);
}

.report-folder-list {
  display: grid;
  gap: 8px;
}

.report-folder-list button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-height: 44px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-align: right;
}

.report-folder-list button.active {
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.empty-mini {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  min-height: 72px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-2);
}

.chart-panel,
.table-panel,
.report-builder,
.client-profile,
.category-list,
.assignment-panel,
.team-member-panel,
.shift-panel,
.operations-panel,
.campaign-panel,
.campaign-performance-panel,
.growth-tools-panel,
.rule-panel,
.segments-panel,
.wallet-panel,
.packages-panel,
.commission-panel,
.link-builder-panel,
.launch-panel,
.settings-panel {
  padding: 14px;
}

.bar-chart {
  height: 200px;
  display: grid;
  /* عدد الأعمدة يتبع عدد أيام الفترة، فلا يصلح تثبيته على سبعة */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 10px 4px 0;
}

.bar-chart span {
  height: var(--h);
  /* بلا min-height: يوم بلا تحصيل يجب أن يظهر فارغًا لا كعمود قصير */
  background: linear-gradient(180deg, var(--mint), #0f766e);
  border-radius: 4px 4px 0 0;
  align-self: end;
}

.chart-empty {
  color: var(--muted);
  font-size: 13px;
}

.chart-legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.source-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.source-list i {
  grid-column: 1 / -1;
  height: 8px;
  background: var(--blue-soft);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.source-list i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: var(--blue);
}

.table-panel {
  margin-top: 12px;
  min-width: 0;
}

.table-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.table-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.data-table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  text-align: right;
  white-space: nowrap;
}

/* رأس الجدول في فريشا أسود وزن 700 بحجم النص نفسه — لا رمادي مصغّر */
.data-table th {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  height: 48px;
  background: var(--surface);
}

/* الصف عالٍ ليتسع لسطرين وصورة */
.data-table td {
  height: var(--h-row);
  font-size: 14px;
  font-weight: 400;
}

.data-table tr:hover td {
  background: var(--hover-bg);
}

.report-builder {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-list label,
.automation-list label,
.service-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.two-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.client-table tr {
  cursor: pointer;
}

.client-table tr.active td {
  background: var(--mint-soft);
}

.client-profile {
  margin-top: 0;
}

.avatar-letter {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 600;
  flex: 0 0 auto;
}

.profile-head {
  align-items: flex-start;
}

.profile-head h2 {
  margin: 0 0 5px;
}

.profile-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 18px 0 14px;
}

.profile-tabs button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 10px;
  white-space: nowrap;
}

.profile-tabs button.active {
  background: var(--black);
  color: #fff;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.profile-metrics div {
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.preference-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  align-items: center;
}

.preference-grid span {
  color: var(--muted);
}

.client-timeline-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.client-detail-list {
  display: grid;
  gap: 8px;
}

.client-detail-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  align-items: start;
}

.client-detail-item span {
  grid-row: 1 / 3;
  align-self: start;
  border: 1px solid #b6e7de;
  border-radius: 999px;
  color: #087266;
  background: var(--mint-soft);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.client-detail-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-detail-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.services-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 330px;
  gap: 16px;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-list button,
.settings-grid button,
.link-options button,
.quick-action-grid button,
.phone-content button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  text-align: right;
}

.category-list button {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-list button.active,
.link-options button.active {
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.service-matrix {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.staff-tags {
  flex-direction: row !important;
  flex-wrap: wrap;
}

.staff-tags span {
  background: var(--blue-soft);
  color: var(--blue);
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 500;
}

.assignment-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.matrix-mini {
  /* عدد الأعمدة = عدد الفريق + عمود اسم الخدمة */
  --matrix-columns: 3;
  display: grid;
  grid-template-columns: 1fr repeat(calc(var(--matrix-columns) - 1), 70px);
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.matrix-mini strong {
  font-size: 13px;
}

.matrix-mini i {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.matrix-mini i.on {
  background: var(--mint);
  border-color: var(--mint);
}
.matrix-mini i {
  cursor: pointer;
  transition: background 0.15s ease;
}
.matrix-mini i:hover {
  border-color: var(--ink);
}
.staff-tags .muted {
  opacity: 0.55;
}

.team-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 280px;
  gap: 16px;
}

.team-member-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.shift-grid {
  /* عدد الأعمدة = أيام الأسبوع + عمود الاسم */
  --shift-columns: 8;
  display: grid;
  grid-template-columns: 90px repeat(calc(var(--shift-columns) - 1), minmax(70px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.shift-grid strong,
.shift-grid span {
  min-height: 52px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.shift-grid strong {
  background: var(--surface-2);
}

.operations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.stock-panel {
  min-width: 0;
}

.ops-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ops-kpi-strip div {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.ops-kpi-strip span,
.supplier-list span,
.resource-card span,
.form-template span,
.response-list span {
  color: var(--muted);
}

.stock-table {
  min-width: 840px;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  font-weight: 600;
  font-size: 12px;
}

.status-pill.good {
  background: var(--mint-soft);
  color: #087266;
}

.status-pill.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.danger {
  background: var(--coral-soft);
  color: #b23b25;
}

.supplier-panel {
  align-self: start;
}

.supplier-list,
.resource-grid,
.form-template-list,
.response-list {
  display: grid;
  gap: 10px;
}

.supplier-list button,
.resource-card,
.form-template,
.response-list div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  text-align: right;
  display: grid;
  gap: 7px;
}

.resource-panel,
.forms-panel {
  grid-column: 1 / -1;
}

.resource-grid,
.form-template-list {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.resource-card.active,
.form-template.active {
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.resource-card em,
.form-template em,
.response-list em {
  color: #087266;
  font-style: normal;
  font-weight: 600;
}

.resource-map {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 90px repeat(3, minmax(120px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.resource-map > * {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 8px;
  text-align: center;
}

.resource-map strong,
.resource-map b {
  background: var(--surface-2);
}

.resource-map i {
  font-style: normal;
}

.resource-map .free {
  background: var(--mint-soft);
  color: #087266;
  font-weight: 600;
}

.resource-map .busy {
  background: var(--coral-soft);
  color: var(--coral);
  font-weight: 600;
}

.response-list {
  margin-top: 12px;
}

.response-list div {
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1fr) auto;
  align-items: center;
}

.marketing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.marketing-grid .table-panel {
  margin-top: 0;
}

.marketing-grid .wide {
  grid-column: 1 / -1;
}

.credit-badge {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
}

.automation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.automation-list label {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-weight: 500;
}

.form-grid input,
.form-grid select {
  min-height: var(--h-input);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}

.campaign-estimate {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.campaign-performance-list {
  display: grid;
  gap: 10px;
}

.campaign-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.campaign-card strong,
.campaign-card span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.campaign-card span {
  color: var(--muted);
}

.campaign-card em {
  color: #087266;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.growth-tools-panel {
  grid-column: 1 / -1;
}

.growth-tool-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.growth-tool {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-height: 118px;
  padding: 12px;
  text-align: right;
  display: grid;
  gap: 8px;
  align-content: start;
}

.growth-tool span {
  color: var(--muted);
  line-height: 1.6;
}

.growth-tool em {
  color: #087266;
  font-style: normal;
  font-weight: 600;
}

.loyalty-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 330px;
  gap: 16px;
}

.wallet-preview {
  min-height: 210px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  margin: 12px 0;
  background: var(--surface-2);
}

.wallet-preview svg {
  width: 48px;
  height: 48px;
  color: var(--mint);
}

.wallet-preview strong {
  font-size: 26px;
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.packages-panel,
.commission-panel {
  grid-column: 1 / -1;
}

.packages-kpis,
.commission-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.packages-kpis div,
.commission-summary div,
.package-meta span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.packages-kpis span,
.commission-summary span,
.package-meta span,
.commission-row span {
  color: var(--muted);
}

.package-program-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 10px;
}

.package-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 158px;
}

.package-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.package-card header strong {
  line-height: 1.45;
}

.package-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.program-progress {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.program-progress span {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--mint);
}

.package-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.package-meta span {
  font-size: 12px;
}

.package-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.commission-list {
  display: grid;
  gap: 10px;
}

.commission-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(90px, auto));
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.commission-row strong,
.commission-row span {
  min-width: 0;
}

.commission-row em {
  font-style: normal;
  font-weight: 600;
  color: #087266;
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
}

.link-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.link-options button {
  min-height: 54px;
  text-align: center;
  font-weight: 500;
}

.generated-link {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  background: var(--surface-2);
}

.generated-link strong {
  direction: ltr;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-preview {
  /* رمز حقيقي يُرسم كـSVG من السيرفر، لا شبكة مربعات للعرض */
  margin-top: 18px;
  width: 184px;
  height: 184px;
  display: grid;
  place-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.qr-preview svg {
  width: 100%;
  height: 100%;
}


.booking-channel-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.booking-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.channel-card {
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  text-align: right;
  display: grid;
  gap: 7px;
  align-content: start;
}

.channel-card.active {
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.channel-card span {
  color: var(--muted);
  line-height: 1.5;
}

.channel-card em {
  color: #087266;
  font-style: normal;
  font-weight: 600;
}

.phone-preview {
  width: 100%;
  max-width: 380px;
  border: 8px solid #111318;
  border-radius: 28px;
  overflow: hidden;
  background: #eef7f4;
  box-shadow: var(--shadow);
}

.phone-top {
  height: 52px;
  background: #111318;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.phone-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-content h2 {
  margin: 8px 0 4px;
  font-size: 17px;
}

.phone-content button {
  min-height: 52px;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.phone-content .book-now {
  background: var(--black);
  color: #fff;
  justify-content: center;
  font-weight: 600;
}

.time-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.time-pills span {
  border: 1px solid #b6e7de;
  color: #087266;
  background: var(--mint-soft);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-weight: 500;
}

.launch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.launch-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.launch-hero,
.launch-board,
.launch-side {
  min-width: 0;
}

.launch-hero,
.launch-board,
.launch-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.launch-hero {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: center;
}

.launch-hero > div:first-child {
  display: grid;
  gap: 8px;
}

.launch-hero span,
.launch-item-main span:not(.status-pill),
.launch-item-meta,
.next-action-list span,
.integration-list span,
.client-required-list span {
  color: var(--muted);
}

.launch-hero strong {
  font-size: 42px;
  line-height: 1;
}

.launch-progress {
  margin: 4px 0 0;
}

.launch-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.launch-summary-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.launch-summary-grid strong {
  font-size: 24px;
}

.launch-board {
  padding: 14px;
}

.launch-checklist {
  display: grid;
  gap: 10px;
}

.launch-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px auto;
  gap: 12px;
  align-items: center;
}

.launch-item-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.launch-item-main div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.launch-item-main strong,
.launch-item-main span:not(.status-pill) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launch-item-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.launch-item-meta strong {
  color: var(--ink);
}

.launch-item-meta em {
  font-style: normal;
}

.launch-item .secondary-btn:disabled {
  opacity: 0.58;
  cursor: default;
}

.launch-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.next-action-list,
.integration-list,
.client-required-list {
  display: grid;
  gap: 8px;
}

.next-action-list button,
.integration-list div,
.client-required-list span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  text-align: right;
}

.next-action-list button,
.integration-list div {
  display: grid;
  gap: 5px;
}

.integration-list em {
  width: max-content;
}

.backend-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.backend-mode {
  display: grid;
  gap: 5px;
}

.backend-mode span,
.backend-mode em,
.backend-audit span {
  color: var(--muted);
}

.backend-mode em {
  font-style: normal;
  font-size: 12px;
}

.backend-mode b {
  color: var(--ink);
}

.backend-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.backend-metrics div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  gap: 5px;
}

.backend-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.backend-metrics strong {
  font-size: 20px;
  line-height: 1.2;
}

.backend-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.backend-actions .secondary-btn {
  min-height: 38px;
  padding: 0 10px;
}

.backend-audit {
  display: grid;
  gap: 7px;
}

.backend-audit div:not(.empty-mini) {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px 10px;
  display: grid;
  gap: 4px;
}

.backend-audit strong {
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.settings-layout {
  display: grid;
  gap: 16px;
}

.settings-form {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.branch-role-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.branch-list {
  display: grid;
  gap: 10px;
}

.branch-list button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  text-align: right;
  display: grid;
  gap: 7px;
}

.branch-list button.active {
  border-color: #9ce5dc;
  background: var(--mint-soft);
}

.branch-list span {
  color: var(--muted);
}

.branch-list em {
  color: #087266;
  font-style: normal;
  font-weight: 600;
}

.role-matrix {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) repeat(3, minmax(74px, 0.65fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.role-matrix > * {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 8px;
  text-align: center;
}

.role-matrix strong,
.role-matrix span {
  background: var(--surface-2);
}

.role-matrix i {
  position: relative;
  font-style: normal;
}

.role-matrix i::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.role-matrix i.on::before {
  border-color: var(--mint);
  background: var(--mint);
}

.settings-grid button {
  min-height: 110px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-grid span {
  color: var(--muted);
}

.settings-grid em {
  align-self: flex-start;
  color: #087266;
  background: var(--mint-soft);
  border: 1px solid #b6e7de;
  border-radius: 999px;
  padding: 4px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 20;
}

.appointment-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(520px, calc(100vw - 24px));
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(-105%);
  transition: transform 190ms ease;
  z-index: 21;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

body.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.drawer-open .appointment-drawer {
  transform: translateX(0);
}

.drawer-head,
.drawer-client,
.drawer-section,
.drawer-total,
.drawer-actions {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.drawer-head h2 {
  margin: 2px 0 0;
}

.drawer-client {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.drawer-client div:not(.avatar-letter) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-client span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-form {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(2, 1fr);
}

.service-check {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface-2);
}

.service-check span {
  flex: 1;
  font-weight: 500;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-action-grid button {
  min-height: 40px;
  text-align: center;
}

.drawer-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  background: var(--surface-2);
}

.drawer-total span {
  color: var(--muted);
}

.drawer-actions {
  margin-top: auto;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 18px;
  background: var(--black);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: 180ms ease;
  z-index: 40;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .calendar-page-grid,
  .dashboard-layout,
  .report-layout,
  .two-pane,
  .services-layout,
  .team-layout,
  .operations-layout,
  .loyalty-grid,
  .booking-layout,
  .launch-layout,
  .launch-hero,
  .sales-layout,
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .insights-panel,
  .report-builder,
  .client-profile {
    order: 2;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .ops-kpi-strip {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .package-program-list,
  .packages-kpis,
  .commission-summary,
  .commission-row,
  .package-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  /* التنقّل ينتقل لأسفل الشاشة: في متناول الإبهام، ولا يقتطع أول أيقونة
     كما كان يحدث حين كان شريطًا علويًا يمرّر أفقيًا. */
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar { display: none; }

  /* الشعار ومؤشّر العنصر النشط لا معنى لهما في شريط سفلي */
  .sidebar .brand-mark,
  .nav-indicator {
    display: none;
  }

  .nav-stack {
    flex-direction: row;
    width: auto;
    gap: 2px;
  }

  .nav-btn {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
  }

  .nav-settings {
    margin-top: 0;
  }

  .workspace {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  /* الرأس كان ثلاثة صفوف مكدّسة تلتهم نصف الشاشة قبل أي محتوى */
  .topbar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand search actions";
    padding: 8px 12px;
    gap: 8px;
    min-height: 56px;
  }

  .business-block { grid-area: brand; }
  .topbar .search-box { grid-area: search; min-width: 0; }
  .top-actions {
    grid-area: actions;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
  }

  /* اسم النشاط وبيانات المستخدم تُختصر لأيقونة على الشاشة الضيقة */
  .business-block span,
  .user-chip strong,
  .user-chip em {
    display: none;
  }

  .user-chip {
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .top-actions .primary-btn span { display: none; }
  .top-actions .primary-btn { padding: 0 12px; }

  .view-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .view-header .toolbar-group {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .view-header .toolbar-group::-webkit-scrollbar { display: none; }

  .view {
    padding: 12px;
  }

  /* الرأس والشبكة كانا يمرّران أفقيًا كلٌّ على حدة، فتنفصل أسماء الفريق
     عن أعمدتها. التمرير الآن على الحاوية الواحدة فيتحركان معًا. */
  .calendar-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-grid-wrap,
  .staff-header-row {
    grid-template-columns: 56px repeat(var(--staff-columns, 2), minmax(190px, 1fr));
    overflow-x: visible;
    min-width: max-content;
  }

  .staff-header-row {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface);
  }

  .calendar-grid {
    min-width: 0;
  }

  .chart-row,
  .marketing-grid,
  .growth-tool-list,
  .booking-channel-grid,
  .report-catalog,
  .resource-grid,
  .form-template-list,
  .branch-role-layout,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .automation-list,
  .ops-kpi-strip,
  .settings-grid,
  .backend-actions,
  .link-options,
  .auth-form,
  .role-picker {
    grid-template-columns: 1fr;
  }

  .backend-metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .generated-link,
  .launch-item,
  .service-row,
  .team-card,
  .checkout-customer,
  .timeline-list button {
    grid-template-columns: 1fr;
  }

  .launch-summary-grid {
    grid-template-columns: 1fr;
  }

  .payment-methods {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-map,
  .response-list div,
  .role-matrix {
    grid-template-columns: 1fr;
  }

  .drawer-form {
    grid-template-columns: 1fr;
  }
}

/* تمييز بصري مؤقت عند فتح تقرير من المكتبة */
.report-flash {
  animation: reportFlash 0.9s ease;
}

@keyframes reportFlash {
  0% { box-shadow: 0 0 0 0 rgba(125, 123, 38, 0.45); }
  100% { box-shadow: 0 0 0 14px rgba(125, 123, 38, 0); }
}

/* ==========================================================================
   منيو الشريط الجانبي بأسلوب فريشا: تلميح عند الوقوف، لوحة مجموعات عند الضغط
   القياسات مأخوذة من partners.fresha.com
   ========================================================================== */

/* المستوى الأول: تلميح أسود صغير */
.nav-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  padding: 9px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 200;
}

.nav-btn[data-tip]:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* التلميح يختفي وقت فتح اللوحة */
body.nav-flyout-open .nav-btn[data-tip]::after {
  display: none;
}

/* المستوى الثاني: اللوحة المنزلقة */
.nav-flyout {
  position: fixed;
  top: 0;
  right: calc(var(--browser-safe-edge) + var(--sidebar));
  width: 264px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 26px 0;
  overflow-y: auto;
  z-index: 150;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms ease, visibility 200ms;
}

.nav-flyout.open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.nav-flyout-group + .nav-flyout-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.nav-flyout h3 {
  margin: 0 0 6px;
  padding: 0 22px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.nav-flyout button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  text-align: right;
}

.nav-flyout button:hover {
  background: var(--surface-2);
}

.nav-flyout button.active {
  background: var(--mint-soft);
  font-weight: 500;
}

/* النقطة الزرقاء: بند يحتاج انتباه */
.nav-flyout button[data-badge]::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  flex: none;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 140;
  display: none;
}

body.nav-flyout-open .nav-scrim {
  display: block;
}

.shift-grid span[data-shift-staff] {
  cursor: pointer;
  border-radius: var(--radius);
  padding: 6px 4px;
  text-align: center;
}
.shift-grid span[data-shift-staff]:hover {
  background: var(--surface-2);
}

/* ---------------------------------------------- قائمة الانتظار وقواعد التسعير */

/* الصف الآن: نص متراص على اليمين وزر إخراج على اليسار */
.waitlist-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.waitlist-item > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.waitlist-item strong,
.waitlist-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waitlist-offered {
  color: var(--brand, #6950f3);
  font-size: 12px;
  font-style: normal;
}

.pricing-rules-block {
  margin-top: 20px;
}

.pricing-rules-block .section-note,
.settings-panel .section-note {
  color: var(--muted);
  margin: 0 0 12px;
  max-width: 62ch;
}

/* صف القاعدة عمودان لا ثلاثة: الوصف ثم زر التعطيل */
#pricingRulesList .service-row {
  grid-template-columns: 1fr auto;
  margin-bottom: 8px;
}

#pricingRulesList .service-row.is-off {
  opacity: 0.55;
}

.rule-change {
  font-variant-numeric: tabular-nums;
  color: var(--brand, #6950f3);
}

/* الخدمة التي يشغل فيها الأخصائي جزءًا من المدة فقط */
.processing-hint {
  font-style: normal;
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

/* خدمة يدخلها العميل وحده — الجهاز هو كل المطلوب */
.solo-hint {
  font-style: normal;
  color: var(--brand, #6950f3);
  font-weight: 600;
}

/* ------------------------------------------------ الباقات المُباعة */

.package-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin-top: 6px;
  overflow: hidden;
  max-width: 240px;
}

.package-bar i {
  display: block;
  height: 100%;
  background: var(--brand, #6950f3);
}

/* باقة على وشك الانتهاء: العميل يحتاج تنبيهًا قبل أن تضيع جلساته */
#packagePurchaseList .service-row {
  grid-template-columns: 1fr auto;
  margin-bottom: 8px;
}

#packagePurchaseList .service-row.is-expiring {
  border-color: var(--warn, #ffc00a);
}

/* -------------------------------------------- المستخدمون والصلاحيات */

#userList .service-row {
  grid-template-columns: 1fr auto;
  margin-bottom: 8px;
}

.user-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.role-pill {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-weight: 600;
}

.user-off { color: var(--muted); font-style: normal; }
.user-warn { color: var(--warn, #b8860b); font-style: normal; }

.matrix-title {
  margin: 22px 0 10px;
  font-size: 15px;
}

/* عمود لكل دور + عمود للمورد */
.role-matrix-real {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) repeat(calc(var(--role-columns) - 1), 1fr);
  gap: 8px 6px;
  align-items: center;
  overflow-x: auto;
}

.role-matrix-real strong {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.role-matrix-real span { font-size: 13px; }

.role-matrix-real i,
.matrix-legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  margin: 0 auto;
}

/* ثلاث حالات لا اثنتان: التمييز بين «يقرأ» و«يعدّل» هو جوهر الصلاحيات */
.role-matrix-real i.on,
.matrix-legend i.on { background: var(--brand, #6950f3); border-color: transparent; }

.role-matrix-real i.read,
.matrix-legend i.read { background: color-mix(in srgb, var(--brand, #6950f3) 28%, transparent); }

.matrix-legend {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.matrix-legend i { vertical-align: -2px; margin: 0 4px; }

/* ------------------------------------------------- نافذة إنشاء المستخدم */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 60;
}

.app-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--card, #fff);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  z-index: 61;
  padding: 24px;
}

.app-modal[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h2 {
  font-size: 19px;
  margin: 0;
}

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

/* display الصريح يتغلّب على خاصية hidden، فيبقى النموذج ظاهرًا فوق النتيجة */
.modal-form[hidden],
.modal-actions[hidden] {
  display: none;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.modal-form input,
.modal-form select {
  padding: 0 16px;
  min-height: var(--h-input);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  font: inherit;
  font-weight: 500;
  color: var(--ink, #111);
  background: #fff;
}

.modal-form input:focus,
.modal-form select:focus {
  outline: 2px solid var(--mint, #14b8a6);
  outline-offset: 1px;
}

.modal-note {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.modal-error {
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}

.modal-error[hidden] {
  display: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 6px;
}

.modal-result[hidden] {
  display: none;
}

.modal-result h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

/* كلمة المرور الأولية تُعرض مرة واحدة، فيجب أن تكون واضحة وقابلة للنسخ */
.password-reveal {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2, #f6f7f5);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}

.password-reveal code {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  user-select: all;
}

/* ========================= الدعم والبلاغات ========================= */

.support-context {
  background: var(--surface-2, #F5F5F5);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted, #6B7683);
  margin: 4px 0 8px;
}
.support-context-title { font-weight: 600; color: var(--ink, #14181C); }
.support-context ul { margin: 6px 0 0; padding-inline-start: 18px; }
.support-context li { margin-bottom: 3px; }

.support-list { display: flex; flex-direction: column; gap: 12px; }

.support-item {
  border: 1px solid var(--line, #E2E6EA);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
}
.support-item.is-done { opacity: .62; }
.support-item h3 { margin: 8px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.support-item-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.support-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.support-time { font-size: 12px; color: var(--muted, #6B7683); white-space: nowrap; }
.support-msg {
  margin: 6px 0; font-size: 14px; line-height: 1.75; color: var(--ink-2, #3D4650);
  background: var(--surface-2, #F5F5F5); padding: 10px 12px; border-radius: 8px;
}
.support-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--muted, #6B7683); }
.support-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.support-actions button { font-size: 13px; padding: 7px 14px; }

.pill.danger { background: #FBEEEE; color: #8A3F3F; }
.pill.info   { background: #EAF1F8; color: #35597E; }
.pill.warn   { background: #FBF3E2; color: #8A6A2F; }
.pill.ghost  { background: var(--surface-2, #F5F5F5); color: var(--muted, #6B7683); }

.nav-dot {
  position: absolute; top: 8px; inset-inline-end: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: #C0553F;
}
.nav-btn { position: relative; }

@media (max-width: 768px) {
  .support-item-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .support-actions button { flex: 1 1 auto; }
}

/* ================== الاسترداد والمساعدة داخل الشاشات ================== */

.link-btn {
  background: none; border: none; color: var(--muted, #6B7683);
  font-size: 13px; cursor: pointer; padding: 8px; text-decoration: underline;
  font-family: inherit; display: block; margin: 6px auto 0;
}
.link-btn:hover { color: var(--ink, #14181C); }

.recover-box {
  border: 1px solid var(--line, #E2E6EA); border-radius: 12px;
  padding: 16px; margin-top: 12px; background: var(--surface-2, #F7F8F8);
}
.recover-note { font-size: 12.5px; line-height: 1.8; color: var(--muted, #6B7683); margin: 0 0 12px; }
.recover-box label { display: block; margin-bottom: 10px; font-size: 13px; }
.recover-box input { width: 100%; margin-top: 4px; }
.recover-result { margin-top: 12px; padding: 12px; border-radius: 8px; font-size: 13px; line-height: 1.7; }
.recover-result.is-good { background: #EEF3E7; color: #4A5A33; }
.recover-result.is-bad  { background: #FBEEEE; color: #8A3F3F; }
.recover-pass {
  display: block; direction: ltr; font-size: 18px; letter-spacing: 1px;
  padding: 10px; margin: 8px 0; background: #fff; border-radius: 6px; text-align: center;
}
.recover-hint { font-size: 12px; margin: 0; }

.recovery-state { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.recovery-meta { font-size: 12px; color: var(--muted, #6B7683); }
.recovery-code-box { margin-top: 14px; }
.recovery-warn { font-size: 12.5px; color: #8A6A2F; margin: 0 0 8px; font-weight: 600; }
.recovery-code {
  display: block; direction: ltr; text-align: center; font-size: 20px; letter-spacing: 3px;
  padding: 16px; border: 2px dashed var(--line, #C9CFD5); border-radius: 10px; background: #fff;
}
.recovery-actions { display: flex; gap: 8px; margin-top: 10px; }
.pill.ok { background: #EEF1E6; color: #6B7A4F; }
.pill.no { background: #FBEEEE; color: #8A3F3F; }

.help-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line, #E2E6EA);
  background: #fff; color: var(--muted, #6B7683); font-size: 13px; font-weight: 700;
  cursor: pointer; margin-inline-start: 8px; line-height: 1; flex: none;
}
.help-btn:hover { background: var(--surface-2, #F2F4F5); color: var(--ink, #14181C); }

.help-popover {
  position: fixed; inset-block-start: 74px; inset-inline-start: 24px; z-index: 90;
  width: min(390px, calc(100vw - 32px));
  background: #fff; border: 1px solid var(--line, #E2E6EA); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(20, 24, 28, .16); padding: 18px 20px;
}
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.help-head strong { font-size: 15px; }
.help-what { font-size: 13.5px; line-height: 1.85; color: var(--ink-2, #3D4650); margin: 10px 0; }
.help-how { margin: 0; padding-inline-start: 18px; }
.help-how li { font-size: 13px; line-height: 1.8; margin-bottom: 7px; color: var(--ink-2, #3D4650); }
.help-foot {
  font-size: 12px; color: var(--muted, #6B7683); margin: 12px 0 0;
  padding-top: 10px; border-top: 1px solid var(--line, #EEF0F2);
}
