/* ==========================================================================
   Design system
   --------------------------------------------------------------------------
   The layouts inject four brand colors and the font (from config/brand.php)
   as --brand-* variables on <html>. Every other token is derived from them
   here, and every component below uses tokens only. Re-branding never
   requires editing this file.

   Written with logical properties (margin-inline-start, inset-inline-end…)
   so the same CSS works for RTL and LTR.
   ========================================================================== */

:root {
  /* ---- Brand inputs (overridden by the layout) ---- */
  --brand-primary: #3d1e12;
  --brand-secondary: #ece3de;
  --brand-accent: #a97660;
  --brand-background: #faf8f7;
  --brand-font: "IBM Plex Sans Arabic";

  /* ---- Core tokens ---- */
  --color-primary: var(--brand-primary);
  --color-primary-hover: color-mix(in srgb, var(--brand-primary) 86%, white);
  --color-primary-contrast: #ffffff;

  --color-secondary: var(--brand-secondary);
  --color-secondary-hover: color-mix(in srgb, var(--brand-secondary) 82%, var(--brand-primary));

  --color-accent: var(--brand-accent);
  --color-accent-strong: color-mix(in srgb, var(--brand-accent) 78%, var(--brand-primary)); /* accent as readable text */
  --color-accent-soft: color-mix(in srgb, var(--brand-accent) 12%, white);

  --color-background: var(--brand-background);
  --color-surface: #ffffff;
  --color-surface-muted: color-mix(in srgb, var(--brand-secondary) 38%, white);
  --color-border: color-mix(in srgb, var(--brand-secondary) 88%, var(--brand-primary));
  --color-border-strong: color-mix(in srgb, var(--brand-secondary) 65%, var(--brand-primary));

  --color-text: var(--brand-primary);
  --color-text-secondary: color-mix(in srgb, var(--brand-primary) 66%, white);
  --color-text-muted: color-mix(in srgb, var(--brand-primary) 52%, white);

  /* ---- Functional (status) colors: warm-leaning, used for states only ---- */
  --color-success: #2e7a56;
  --color-success-soft: #e6f2ec;
  --color-warning: #9a6512;
  --color-warning-soft: #fbf0dc;
  --color-danger: #b0403a;
  --color-danger-soft: #f8e5e3;
  --color-info: #33698a;
  --color-info-soft: #e3eef4;
  --color-neutral: var(--color-text-secondary);
  --color-neutral-soft: color-mix(in srgb, var(--brand-secondary) 55%, white);

  /* ---- Sidebar ---- */
  --sidebar-bg: var(--brand-primary);
  --sidebar-text: color-mix(in srgb, var(--brand-background) 78%, var(--brand-primary));
  --sidebar-text-active: #ffffff;
  --sidebar-item-hover: color-mix(in srgb, white 8%, transparent);
  --sidebar-item-active: color-mix(in srgb, var(--brand-accent) 30%, var(--brand-primary));
  --sidebar-width: 256px;
  --sidebar-width-collapsed: 76px;

  /* ---- Shape, depth, rhythm ---- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--brand-primary) 6%, transparent);
  --shadow: 0 1px 2px color-mix(in srgb, var(--brand-primary) 5%, transparent), 0 4px 16px color-mix(in srgb, var(--brand-primary) 6%, transparent);
  --shadow-lg: 0 12px 40px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 35%, transparent);

  --font-sans: var(--brand-font), system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;

  --control-height: 42px;
  --control-height-sm: 34px;
  --topbar-height: 64px;
  --page-padding: 28px;

  color-scheme: light;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[x-cloak] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

::selection { background: color-mix(in srgb, var(--brand-accent) 30%, transparent); }

/* Numbers, phones, amounts: always Latin digits, aligned, readable left-to-right. */
.num { font-variant-numeric: tabular-nums lining-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* ==========================================================================
   App shell: sidebar + topbar + content
   ========================================================================== */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0;
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  height: 100vh;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: width .2s ease, flex-basis .2s ease;
  z-index: 40;
}

.sidebar__brand {
  display: flex; align-items: center; justify-content: center;
  height: 88px; padding: 16px 20px;
  border-block-end: 1px solid color-mix(in srgb, white 9%, transparent);
}
.sidebar__brand img { height: 52px; width: auto; }
.sidebar__brand-mark { display: none; }
.sidebar__brand-text { font-size: var(--text-lg); font-weight: 600; color: var(--sidebar-text-active); }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }

.sidebar__section {
  margin: 14px 12px 6px;
  font-size: var(--text-xs); font-weight: 500; letter-spacing: .02em;
  color: color-mix(in srgb, var(--sidebar-text) 60%, transparent);
}

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding-inline: 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base); font-weight: 500;
  color: var(--sidebar-text);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--sidebar-item-hover); color: var(--sidebar-text-active); }
.nav-item.is-active { background: var(--sidebar-item-active); color: var(--sidebar-text-active); }
.nav-item.is-active svg { opacity: 1; color: color-mix(in srgb, var(--brand-accent) 55%, white); }
.nav-item.is-active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px;
  width: 4px; border-start-end-radius: 4px; border-end-end-radius: 4px;
  background: var(--brand-accent);
}
.nav-item.is-disabled { opacity: .45; cursor: default; }
.nav-item.is-disabled:hover { background: transparent; color: var(--sidebar-text); }
.nav-item__soon { margin-inline-start: auto; font-size: 10px; font-weight: 500; padding: 1px 7px; border-radius: var(--radius-full); background: color-mix(in srgb, white 10%, transparent); }
.nav-item__badge { margin-inline-start: auto; min-width: 22px; height: 20px; padding-inline: 6px; border-radius: var(--radius-full); background: var(--brand-accent); color: #fff; font-size: var(--text-xs); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }

.sidebar__footer { padding: 12px; border-block-start: 1px solid color-mix(in srgb, white 9%, transparent); }

/* Collapsed sidebar (desktop): icons only, labels as tooltips */
.app.is-collapsed .sidebar { flex-basis: var(--sidebar-width-collapsed); width: var(--sidebar-width-collapsed); }
.app.is-collapsed .sidebar__brand { padding: 12px; }
.app.is-collapsed .sidebar__brand-full { display: none; }
.app.is-collapsed .sidebar__brand-mark { display: block; }
.app.is-collapsed .sidebar__section { visibility: hidden; height: 0; margin: 8px 0; border-block-start: 1px solid color-mix(in srgb, white 9%, transparent); }
.app.is-collapsed .nav-item { justify-content: center; padding-inline: 0; }
.app.is-collapsed .nav-item__label,
.app.is-collapsed .nav-item__soon { display: none; }
.app.is-collapsed .nav-item__badge { position: absolute; top: 3px; inset-inline-end: 6px; min-width: 18px; height: 16px; font-size: 10px; padding-inline: 4px; }
.app.is-collapsed .sidebar__collapse svg { transform: scaleX(-1); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-height);
  display: flex; align-items: center; gap: 16px;
  padding-inline: var(--page-padding);
  background: color-mix(in srgb, var(--color-background) 88%, transparent);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--color-border);
}
.topbar__title { font-size: var(--text-lg); font-weight: 600; }
.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn.topbar__menu-btn { display: none; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text-secondary);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--color-secondary); color: var(--color-text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn__badge {
  position: absolute; top: 4px; inset-inline-end: 3px;
  min-width: 18px; height: 18px; padding-inline: 5px;
  border-radius: var(--radius-full); border: 2px solid var(--color-background);
  background: var(--color-danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 14px; text-align: center;
}

.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: var(--radius-full); border: 0; background: transparent; }
.user-chip:hover { background: var(--color-secondary); }
.user-chip__text { text-align: start; line-height: 1.25; }
.user-chip__name { font-weight: 600; font-size: var(--text-sm); }
.user-chip__role { font-size: var(--text-xs); color: var(--color-text-muted); }

.avatar {
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-accent-strong);
  font-weight: 600; font-size: var(--text-sm);
}

.content { flex: 1; padding: var(--page-padding); }
.content__inner { max-width: 1400px; margin-inline: auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-block-end: 24px; }
.page-header__title { font-size: var(--text-xl); font-weight: 600; }
.page-header__subtitle { margin-block-start: 4px; color: var(--color-text-secondary); }
.page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--brand-primary) 40%, transparent); z-index: 35; }

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap, 16px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.col-span-full { grid-column: 1 / -1; }
.ms-auto { margin-inline-start: auto; }
.divider { height: 1px; background: var(--color-border); border: 0; margin: 4px 0; }

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-block-end: 1px solid var(--color-border); }
.card__title { font-size: var(--text-md); font-weight: 600; }
.card__subtitle { font-size: var(--text-sm); color: var(--color-text-secondary); margin-block-start: 2px; }
.card__body { padding: 22px; }
.card__body--flush { padding: 0; }
.card__footer { padding: 14px 22px; border-block-start: 1px solid var(--color-border); background: var(--color-surface-muted); border-end-start-radius: var(--radius-lg); border-end-end-radius: var(--radius-lg); }

/* Stat card (dashboard numbers) */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat__label { font-size: var(--text-sm); color: var(--color-text-secondary); font-weight: 500; }
.stat__icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--color-accent-soft); color: var(--color-accent-strong); }
.stat__icon svg { width: 18px; height: 18px; }
.stat__value { font-size: var(--text-2xl); font-weight: 600; line-height: 1.2; }
.stat__unit { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); margin-inline-start: 4px; }
.stat__hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.stat--warning .stat__icon { background: var(--color-warning-soft); color: var(--color-warning); }
.stat--danger .stat__icon { background: var(--color-danger-soft); color: var(--color-danger); }
.stat--danger .stat__value { color: var(--color-danger); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-height); padding-inline: 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: var(--text-base); font-weight: 600; line-height: 1;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.btn--primary:hover:not(:disabled) { background: var(--color-primary-hover); }

.btn--accent { background: var(--color-accent); color: #fff; }
.btn--accent:hover:not(:disabled) { background: var(--color-accent-strong); }

.btn--secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
.btn--secondary:hover:not(:disabled) { background: var(--color-secondary); }

.btn--ghost { background: transparent; color: var(--color-text-secondary); }
.btn--ghost:hover:not(:disabled) { background: var(--color-secondary); color: var(--color-text); }

.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--color-danger) 85%, black); }

.btn--success { background: var(--color-success); color: #fff; }
.btn--success:hover:not(:disabled) { background: color-mix(in srgb, var(--color-success) 85%, black); }

.btn--sm { height: var(--control-height-sm); padding-inline: 12px; font-size: var(--text-sm); }
.btn--sm svg { width: 16px; height: 16px; }
.btn--icon { width: var(--control-height); padding: 0; }
.btn--sm.btn--icon { width: var(--control-height-sm); }
.btn--block { width: 100%; }

.btn .spinner { display: none; } /* shown by wire:loading while the action runs */

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.field__required { color: var(--color-danger); margin-inline-start: 2px; }
.field__hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.field__error { font-size: var(--text-xs); color: var(--color-danger); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  height: var(--control-height);
  padding-inline: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--color-text-muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--brand-accent) 60%, var(--color-border-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--color-surface-muted); color: var(--color-text-muted); cursor: not-allowed; }
.input.has-error, .select.has-error, .textarea.has-error { border-color: var(--color-danger); }
.input.has-error:focus, .select.has-error:focus, .textarea.has-error:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 22%, transparent); }

.input--ltr { direction: ltr; text-align: end; }
.input--ltr::placeholder { text-align: end; }

.textarea { height: auto; min-height: 92px; padding-block: 10px; resize: vertical; line-height: 1.6; }

.select {
  appearance: none; -webkit-appearance: none;
  padding-inline-end: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23826a60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: left 12px center;
}
[dir="ltr"] .select { background-position: right 12px center; }

.input-group { position: relative; }
.input-group__icon { position: absolute; inset-block: 0; inset-inline-start: 12px; display: flex; align-items: center; color: var(--color-text-muted); pointer-events: none; }
.input-group__icon svg { width: 18px; height: 18px; }
.input-group .input { padding-inline-start: 40px; }
/* An LTR input (phone, email) keeps the icon on the RTL start side: pad by physical side. */
[dir="rtl"] .input-group .input--ltr { padding-inline-start: 12px; padding-right: 40px; }
.input-group__end { position: absolute; inset-block: 0; inset-inline-end: 8px; display: flex; align-items: center; }

.input[type="date"], .input[type="datetime-local"], .input[type="time"] { direction: ltr; text-align: end; }
.input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }

.checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--text-base); }
.checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); cursor: pointer; }

/* Switch (on/off) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 40px; height: 22px; border-radius: var(--radius-full); background: var(--color-border-strong); transition: background .15s ease; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .15s ease; }
.switch input:checked + .switch__track { background: var(--color-success); }
.switch input:checked + .switch__track::after { inset-inline-start: 21px; }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }

/* Segmented choice (large tap targets for frequent picks) */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding-inline: 14px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  background: var(--color-surface); font-weight: 500; cursor: pointer;
  transition: all .15s ease;
}
.segmented span:hover { border-color: var(--color-accent); }
.segmented input:checked + span { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.segmented input:focus-visible + span { box-shadow: var(--focus-ring); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-block-start: 4px; }

/* ==========================================================================
   Table
   ========================================================================== */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-base); }
.table th {
  position: sticky; top: 0;
  padding: 12px 16px;
  background: var(--color-surface-muted);
  border-block-end: 1px solid var(--color-border);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-secondary);
  text-align: start; white-space: nowrap;
}
.table td { padding: 13px 16px; border-block-end: 1px solid var(--color-border); vertical-align: middle; }
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-secondary) 28%, white); }
.table tbody tr:last-child td { border-block-end: 0; }
.table .cell-num { text-align: end; }
.table .cell-actions { text-align: end; white-space: nowrap; width: 1%; }
.table .cell-strong { font-weight: 600; }
.table__empty { padding: 48px 16px !important; text-align: center; color: var(--color-text-muted); }
.table tr.is-muted td { color: var(--color-text-muted); }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--color-text-secondary); }
.empty-state > svg { width: 40px; height: 40px; color: var(--color-accent); opacity: .7; }
.empty-state__title { font-weight: 600; color: var(--color-text); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-block-end: 1px solid var(--color-border); }
.toolbar .input-group { flex: 1 1 260px; max-width: 360px; }
.toolbar .select { width: auto; min-width: 150px; }

/* ==========================================================================
   Badge (status) — never color-only: always text, plus a dot
   ========================================================================== */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding-inline: 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
  background: var(--color-neutral-soft); color: var(--color-neutral);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge--plain::before { display: none; }
.badge--success { background: var(--color-success-soft); color: var(--color-success); }
.badge--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge--danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge--info { background: var(--color-info-soft); color: var(--color-info); }
.badge--accent { background: var(--color-accent-soft); color: var(--color-accent-strong); }
.badge--primary { background: var(--color-primary); color: #fff; }

/* ==========================================================================
   Alert
   ========================================================================== */

.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: var(--text-base);
}
.alert svg { width: 20px; height: 20px; flex: none; margin-block-start: 1px; }
.alert__title { font-weight: 600; }
.alert__body { flex: 1; }
.alert--info { background: var(--color-info-soft); color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 20%, transparent); }
.alert--success { background: var(--color-success-soft); color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 20%, transparent); }
.alert--warning { background: var(--color-warning-soft); color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 22%, transparent); }
.alert--danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 20%, transparent); }

/* Toast (flash messages) */
.toasts { position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 48px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--color-primary); color: #fff; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast svg { width: 20px; height: 20px; flex: none; color: color-mix(in srgb, var(--color-success) 40%, white); }
.toast--error svg { color: color-mix(in srgb, var(--color-danger) 35%, white); }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal__overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--brand-primary) 45%, transparent); }
.modal__panel {
  position: relative; width: 100%; max-width: 560px;
  background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal__panel--lg { max-width: 760px; }
.modal__panel--sm { max-width: 420px; }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-block-end: 1px solid var(--color-border); }
.modal__title { font-size: var(--text-lg); font-weight: 600; }
.modal__body { padding: 22px; }
.modal__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-block-start: 1px solid var(--color-border); background: var(--color-surface-muted); border-end-start-radius: var(--radius-lg); border-end-end-radius: var(--radius-lg); }

/* ==========================================================================
   Dropdown menu
   ========================================================================== */

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 45;
  min-width: 200px; padding: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dropdown__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; font-size: var(--text-base); text-align: start; color: var(--color-text); }
.dropdown__item:hover { background: var(--color-secondary); }
.dropdown__item svg { width: 18px; height: 18px; color: var(--color-text-secondary); }
.dropdown__item--danger { color: var(--color-danger); }
.dropdown__item--danger svg { color: var(--color-danger); }
.dropdown__header { padding: 8px 12px 10px; border-block-end: 1px solid var(--color-border); margin-block-end: 6px; }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-block-start: 1px solid var(--color-border); }
.pagination__info { font-size: var(--text-sm); color: var(--color-text-secondary); }
.pagination__pages { display: flex; gap: 4px; }
.pagination__btn {
  min-width: 34px; height: 34px; padding-inline: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); font-size: var(--text-sm); font-weight: 500;
}
.pagination__btn:hover:not(:disabled):not(.is-active) { background: var(--color-secondary); }
.pagination__btn.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination__btn:disabled { opacity: .45; cursor: not-allowed; }
.pagination__btn svg { width: 16px; height: 16px; }
.pagination__gap { padding-inline: 4px; color: var(--color-text-muted); align-self: center; }

/* ==========================================================================
   Auth (login) screen
   ========================================================================== */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth__form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--color-surface); }
.auth__form { width: 100%; max-width: 380px; }
.auth__logo { height: 92px; width: auto; margin-inline: auto; margin-block-end: 28px; color: var(--color-accent); }
.auth__brand-text { text-align: center; font-size: var(--text-2xl); font-weight: 600; margin-block-end: 28px; }
.auth__title { font-size: var(--text-xl); font-weight: 600; text-align: center; }
.auth__subtitle { margin-block: 6px 28px; text-align: center; color: var(--color-text-secondary); }
.auth__art {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end;
  padding: 48px;
  background-color: var(--color-secondary);
  background-repeat: repeat;
  background-size: 178px auto;
}
.auth__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--brand-primary) 82%, transparent) 0%, color-mix(in srgb, var(--brand-primary) 10%, transparent) 55%, transparent 100%); }
.auth__quote { position: relative; z-index: 1; color: #fff; max-width: 420px; }
.auth__quote-title { font-size: 2rem; font-weight: 600; line-height: 1.35; }
.auth__quote-text { margin-block-start: 10px; opacity: .85; font-size: var(--text-md); }
.auth__footer { margin-block-start: 32px; text-align: center; font-size: var(--text-xs); color: var(--color-text-muted); }

/* ==========================================================================
   Design-system preview page
   ========================================================================== */

.swatch { display: flex; flex-direction: column; gap: 8px; }
.swatch__color { height: 64px; border-radius: var(--radius); border: 1px solid var(--color-border); }
.swatch__name { font-weight: 600; font-size: var(--text-sm); }
.swatch__var { font-size: var(--text-xs); color: var(--color-text-muted); direction: ltr; text-align: end; }
.demo-label { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); margin-block-end: 10px; letter-spacing: .02em; }

/* ==========================================================================
   Responsive: tablet & phone
   ========================================================================== */

@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  :root { --page-padding: 20px; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .app.is-mobile-open .sidebar { transform: none; }
  .app.is-collapsed .sidebar { width: var(--sidebar-width); }
  .sidebar__collapse { display: none; }
  .icon-btn.topbar__menu-btn { display: inline-flex; }
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
}

@media (max-width: 720px) {
  :root { --page-padding: 16px; --topbar-height: 58px; }
  .grid--2, .grid--3, .grid--4, .form-grid { grid-template-columns: 1fr; }
  .user-chip__text { display: none; }
  .page-header__title { font-size: var(--text-lg); }
  .card__header, .card__body { padding: 16px; }
  .modal { padding-top: 16px; }
  .toolbar .input-group { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Tabs (sub-pages) and filter chips
   ========================================================================== */

.tabs { display: flex; gap: 4px; border-block-end: 1px solid var(--color-border); margin-block-end: 20px; }
.tabs__item {
  position: relative; padding: 10px 16px; font-weight: 500; color: var(--color-text-secondary);
  border-start-start-radius: var(--radius-sm); border-start-end-radius: var(--radius-sm);
}
.tabs__item:hover { color: var(--color-text); background: var(--color-secondary); }
.tabs__item.is-active { color: var(--color-text); font-weight: 600; }
.tabs__item.is-active::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--color-accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-block-end: 1px solid var(--color-border); }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding-inline: 14px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  background: var(--color-surface); font-size: var(--text-sm); font-weight: 500; color: var(--color-text);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--color-accent); }
.chip.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.chip__count { font-size: var(--text-xs); padding: 0 7px; border-radius: var(--radius-full); background: var(--color-secondary); color: var(--color-text-secondary); }
.chip.is-active .chip__count { background: color-mix(in srgb, white 18%, transparent); color: #fff; }
.chip.is-inactive { color: var(--color-text-muted); border-style: dashed; }

.table tr.table__group td {
  padding-block: 10px; background: color-mix(in srgb, var(--brand-secondary) 22%, white);
  font-weight: 600; font-size: var(--text-sm); color: var(--color-accent-strong);
}
.table tr.table__group:hover { background: transparent; }
.cell-sub { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }

.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.check-card:hover { border-color: var(--color-accent); }
.check-card input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.check-card:has(input:checked) { border-color: var(--color-primary); background: var(--color-accent-soft); }

.input-suffix { position: relative; }
/* The number is LTR inside an RTL page: digits sit next to the label (right), the unit on the left. */
.input-suffix .input { padding-left: 56px; padding-right: 12px; text-align: right; }
.input-suffix__text { position: absolute; inset-block: 0; left: 12px; display: flex; align-items: center; color: var(--color-text-muted); font-size: var(--text-sm); pointer-events: none; }

/* ==========================================================================
   Date picker
   ========================================================================== */

.datepicker { position: relative; }
.datepicker__input { display: flex; align-items: center; gap: 10px; text-align: start; cursor: pointer; }
.datepicker__input svg { width: 18px; height: 18px; color: var(--color-text-muted); flex: none; }
.datepicker__placeholder { color: var(--color-text-muted); }
.datepicker__quick { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 8px; }
.datepicker__quick .chip { height: 30px; padding-inline: 12px; font-size: var(--text-xs); }
.datepicker__panel {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 55;
  width: 300px; padding: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.datepicker__panel.is-up { top: auto; bottom: calc(100% + 6px); }
.datepicker__head { display: flex; align-items: center; justify-content: space-between; margin-block-end: 6px; }
.datepicker__head .icon-btn { width: 32px; height: 32px; }
.datepicker__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepicker__weekday { text-align: center; font-size: var(--text-xs); color: var(--color-text-muted); padding-block: 4px; }
.datepicker__day { height: 34px; border: 0; border-radius: var(--radius-sm); background: transparent; font-size: var(--text-sm); }
.datepicker__day:hover:not(:disabled) { background: var(--color-secondary); }
.datepicker__day.is-outside { color: var(--color-text-muted); opacity: .55; }
.datepicker__day.is-today { box-shadow: inset 0 0 0 1px var(--color-accent); font-weight: 600; }
.datepicker__day.is-selected { background: var(--color-primary); color: #fff; font-weight: 600; }
.datepicker__day:disabled { opacity: .3; cursor: not-allowed; }
.datepicker__time { display: grid; grid-template-columns: auto 1fr 80px; align-items: center; gap: 8px; margin-block-start: 10px; padding-block-start: 10px; border-block-start: 1px solid var(--color-border); }
.datepicker__time .select { height: 36px; }
.datepicker__foot { display: flex; justify-content: space-between; margin-block-start: 10px; }
.num-mixed { font-variant-numeric: tabular-nums; }

/* Customer card (phone lookup result) */
.customer-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--color-info) 25%, transparent); border-radius: var(--radius); background: var(--color-info-soft); }
.customer-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.customer-card__meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: var(--text-sm); color: var(--color-text-secondary); }
.customer-card__alert { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 500; color: var(--color-warning); }
.customer-card__alert svg { width: 16px; height: 16px; }
@media (max-width: 720px) { .topbar__call { display: none; } }
.table .num { white-space: nowrap; }

/* Date + time: plain date, time in a soft pill (see components/datetime) */
.dt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; vertical-align: middle; }
.dt__date { color: var(--color-text-secondary); }
.dt__time { padding: 1px 8px; border-radius: var(--radius-full); background: var(--color-accent-soft); color: var(--color-accent-strong); font-weight: 600; font-size: 0.92em; }
.dt--sm { font-size: var(--text-xs); gap: 4px; }
.dt--sm .dt__time { padding: 0 6px; }

/* Booking / sale form: main column + sticky summary */
.booking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.booking-summary { position: sticky; top: calc(var(--topbar-height) + 20px); }
.summary-list { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.summary-list > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.summary-list dt { color: var(--color-text-secondary); font-size: var(--text-sm); }
.summary-list dd { margin: 0; font-weight: 500; text-align: end; }
.summary-list__total { padding-block-start: 12px; border-block-start: 1px dashed var(--color-border-strong); }
.summary-list__total dd { font-size: var(--text-xl); font-weight: 700; }
.summary-list__discount dd { color: var(--color-success); }
@media (max-width: 1024px) { .booking-layout { grid-template-columns: 1fr; } .booking-summary { position: static; } }
.day-nav { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); background: var(--color-surface); }
.day-nav .icon-btn { width: 30px; height: 30px; border-radius: 50%; }
.day-nav__label { display: inline-flex; gap: 8px; padding-inline: 6px; font-size: var(--text-sm); white-space: nowrap; }
/* Row menus (dropdowns) must not be clipped on desktop; small screens scroll the table sideways. */
@media (min-width: 1101px) { .table-wrap { overflow: visible; } }
.sale-item { position: relative; display: flex; gap: 14px; padding: 14px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface-muted); }
.sale-item__num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary); color: #fff; font-size: var(--text-sm); font-weight: 600; margin-block-start: 26px; }
.sale-item__fields { flex: 1; min-width: 0; display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr; gap: 12px; }
.sale-item__remove { position: absolute; top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; }
@media (max-width: 1280px) { .sale-item__fields { grid-template-columns: 1fr 1fr; } .sale-item__service { grid-column: 1 / -1; } }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1280px) { .dashboard-grid { grid-template-columns: 1fr; } }
a.card.stat { transition: border-color .15s ease, box-shadow .15s ease; }
a.card.stat:hover { border-color: var(--color-accent); box-shadow: var(--shadow); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist svg { width: 20px; height: 20px; flex: none; color: var(--color-warning); margin-block-start: 2px; }
.checklist li.is-done svg { color: var(--color-success); }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--color-border-strong); border-radius: var(--radius); background: var(--color-surface-muted); cursor: pointer; text-align: center; transition: border-color .15s ease; }
.dropzone:hover { border-color: var(--color-accent); }
.dropzone > svg { width: 32px; height: 32px; color: var(--color-accent); }
.import-list { margin: 6px 0 0; padding-inline-start: 18px; max-height: 220px; overflow-y: auto; font-size: var(--text-sm); }
.btn--ghost.btn--danger-text { color: var(--color-danger); }
.btn--ghost.btn--danger-text:hover:not(:disabled) { background: var(--color-danger-soft); color: var(--color-danger); }
/* Roles: permission matrix and usage meter */
.perm-matrix { border: 1px solid var(--color-border); border-radius: var(--radius); overflow-x: auto; }
.perm-matrix table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 620px; }
.perm-matrix th, .perm-matrix td { padding: 9px 12px; border-block-end: 1px solid var(--color-border); text-align: start; vertical-align: middle; }
.perm-matrix thead th { background: var(--color-surface-muted); color: var(--color-text-secondary); font-weight: 600; font-size: var(--text-xs); white-space: nowrap; }
.perm-matrix tbody th { font-weight: 600; white-space: nowrap; }
.perm-matrix tbody tr:last-child > * { border-block-end: 0; }
.perm-matrix tbody tr.is-on { background: color-mix(in srgb, var(--color-accent-soft) 55%, transparent); }
.perm-matrix__col { width: 64px; text-align: center !important; }
.perm-matrix input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); cursor: pointer; vertical-align: middle; }
.perm-matrix__extra { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.perm-matrix__extra .checkbox { gap: 6px; white-space: nowrap; }
.role-meter { display: inline-flex; align-items: center; gap: 8px; }
.role-meter__bar { width: 90px; height: 6px; border-radius: var(--radius-full); background: var(--color-border); overflow: hidden; }
.role-meter__bar > span { display: block; height: 100%; background: var(--color-accent); border-radius: inherit; }
/* Packages */
.toolbar--bare { padding: 0 0 16px; border: 0; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.package-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.package-card.is-muted { opacity: .65; }
.package-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.package-card__name { margin: 0; font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); }
.package-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.package-card__amount { font-size: 1.5rem; font-weight: 700; }
.package-card__actions { display: flex; gap: 4px; justify-content: flex-end; padding-block-start: 10px; border-block-start: 1px solid var(--color-border); margin-block-start: auto; }
.package-contents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: pkg; font-size: var(--text-sm); }
.package-contents li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-block-end: 1px dashed var(--color-border); counter-increment: pkg; }
.package-contents li:last-child { border-block-end: 0; }
.package-contents li::before { content: counter(pkg); flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-strong); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.slot { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface-muted); }
.slot__num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--color-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-sm); font-weight: 600; margin-block-start: 6px; }
.slot__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.slot__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.slot__fields > :only-child { grid-column: 1 / -1; }
.slot__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.slot__chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: var(--radius-full); background: var(--color-surface); border: 1px solid var(--color-border-strong); font-size: var(--text-sm); }
.slot__chip button { display: inline-flex; border: 0; background: none; padding: 2px; border-radius: 50%; color: var(--color-text-muted); cursor: pointer; }
.slot__chip button:hover { background: var(--color-danger-soft); color: var(--color-danger); }
.slot__chip svg { width: 14px; height: 14px; }
.slot__tools { display: flex; flex-direction: column; gap: 2px; }
.slot__tools .icon-btn { width: 28px; height: 28px; }
.slot__tools .icon-btn:disabled { opacity: .3; cursor: default; }
.package-pricing { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--color-accent-soft); }
@media (max-width: 640px) { .slot__fields, .package-pricing { grid-template-columns: 1fr; } .package-grid { grid-template-columns: 1fr; } }
/* Package parts inside booking / sale forms and lists */
.parts { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--color-surface); border: 1px dashed var(--color-border-strong); }
.parts__row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.parts__name { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); min-width: 0; }
.parts__name::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); }
.parts__row .select { height: 36px; font-size: var(--text-sm); }
.parts-list { margin: 4px 0 0; padding: 0; list-style: none; font-size: var(--text-xs); color: var(--color-text-secondary); display: flex; flex-direction: column; gap: 2px; }
.parts-list li::before { content: '· '; color: var(--color-accent); font-weight: 700; }
@media (max-width: 640px) { .parts__row { grid-template-columns: 1fr; } }
.table tr.row-part td { padding-block: 6px; font-size: var(--text-sm); color: var(--color-text-secondary); border-block-start: 0; }
.table tr.row-part td:first-child { padding-inline-start: 28px; }
/* Partners */
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: start; }
.link-btn:hover { color: var(--color-accent-strong); text-decoration: underline; }
.partner-howto { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--color-accent-soft); border-inline-start: 3px solid var(--color-accent); font-size: var(--text-sm); }
.partner-note { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--color-border-strong); background: var(--color-surface); font-size: var(--text-sm); }
.customer-card__partner { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-block-start: 6px; font-size: var(--text-xs); }
