/* ============================================================
   Tijartk ERP — Refined UI System
   Corporate palette · easy on the eyes · professional
   (Adapted for Django from the Tijaro reference design)
   ============================================================ */

:root {
  /* palette (overridden by [data-palette]) — default = teal/green brand */
  --accent:        #14b8a6;
  --accent-strong: #0d9488;
  --accent-ink:    #0f766e;
  --accent-12:     rgba(20, 184, 166, .14);
  --accent-20:     rgba(20, 184, 166, .22);
  --sidebar:       #0f1729;
  --sidebar-2:     #0a1020;

  /* neutrals */
  --bg:            #f4f6f9;
  --surface:       #ffffff;
  --surface-2:     #fafbfd;
  --border:        #e7eaef;
  --border-soft:   #eef1f5;
  --text:          #0f172a;
  --text-muted:    #5a6675;
  --text-soft:     #93a0b0;

  /* status (Apple-ish) */
  --success:       #10b981;
  --success-ink:   #047857;
  --danger:        #ff3b30;
  --danger-ink:    #b91c1c;
  --warning:       #f59e0b;
  --warning-ink:   #b45309;
  --info:          #007aff;

  /* geometry / density */
  --radius:        16px;
  --radius-sm:     11px;
  --radius-xs:     9px;
  --content-pad:   32px;
  --grid-gap:      20px;
  --card-pad:      22px;
  --stat-pad:      20px;
  --sidebar-w:     264px;
  --header-h:      72px;

  --shadow-sm:     0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow:        0 4px 16px rgba(15, 23, 42, .06), 0 12px 32px rgba(15, 23, 42, .05);
  --shadow-lg:     0 24px 60px rgba(15, 23, 42, .18);
  --ring:          0 0 0 4px var(--accent-12);

  --font:          "Inter", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-palette="blue"] {
  --accent: #2563eb; --accent-strong: #1d4ed8; --accent-ink: #1e40af;
  --accent-12: rgba(37,99,235,.12); --accent-20: rgba(37,99,235,.20);
  --sidebar: #0f1729; --sidebar-2: #0a1020; --info: #2563eb;
}
[data-palette="emerald"] {
  --accent: #10b981; --accent-strong: #059669; --accent-ink: #047857;
  --accent-12: rgba(16,185,129,.13); --accent-20: rgba(16,185,129,.22);
  --sidebar: #0e1f1a; --sidebar-2: #0a1813;
}
[data-palette="teal"] {
  --accent: #14b8a6; --accent-strong: #0d9488; --accent-ink: #0f766e;
  --accent-12: rgba(20,184,166,.14); --accent-20: rgba(20,184,166,.22);
  --sidebar: #0b2422; --sidebar-2: #081a18;
}
[data-palette="indigo"] {
  --accent: #6366f1; --accent-strong: #4f46e5; --accent-ink: #4338ca;
  --accent-12: rgba(99,102,241,.14); --accent-20: rgba(99,102,241,.22);
  --sidebar: #14152b; --sidebar-2: #0d0e20; --info: #6366f1;
}

[data-density="roomy"]   { --content-pad: 40px; --grid-gap: 24px; --card-pad: 26px; --stat-pad: 24px; }
[data-density="compact"] { --content-pad: 22px; --grid-gap: 14px; --card-pad: 16px; --stat-pad: 15px; --header-h: 64px; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -.1px;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent-20); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd5df; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #aab4c2; background-clip: padding-box; }

/* ============================================================
   App shell
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; right: auto;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  display: flex; flex-direction: column;
  z-index: 50;
  border-right: 1px solid rgba(255,255,255,.05);
}

.sidebar__brand, .brand {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--header-h); padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar__close {
  display: none; margin-inline-start: auto; width: 38px; height: 38px;
  place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px; color: rgba(255,255,255,.78); background: rgba(255,255,255,.06);
}
.sidebar__close:hover { color: #fff; background: rgba(255,255,255,.11); }
.sidebar__close svg { width: 18px; height: 18px; }
.sidebar__logo, .brand__logo {
  width: 64px; height: 64px; display: grid; place-items: center;
  flex-shrink: 0;
}
.sidebar__logo img, .brand__logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar__title, .brand__title { color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.sidebar__subtitle, .brand__sub { color: rgba(255,255,255,.5); font-size: 11.5px; margin-top: 1px; }

.sidebar__nav, .nav { flex: 1; overflow-y: auto; padding: 16px 12px 8px; }
.sidebar__nav::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }
.nav-group + .nav-group, .nav__group + .nav__group { margin-top: 20px; }
.nav-group__label, .nav__label {
  color: rgba(255,255,255,.38); font-size: 10.5px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; padding: 0 12px 9px;
}
.nav-link, .nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 9.5px 12px; border-radius: var(--radius-xs);
  color: rgba(255,255,255,.7); font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s; margin-bottom: 2px; position: relative;
}
.nav-link svg, .nav__link svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .9; }
.nav-link:hover, .nav__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active, .nav__link.is-active {
  background: var(--accent-20); color: #fff; font-weight: 600;
}
.nav-link.is-active::before, .nav__link.is-active::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px; background: var(--accent);
}
.nav-link.is-active svg, .nav__link.is-active svg { opacity: 1; }
.nav__badge {
  margin-inline-start: auto; font-size: 11px; font-weight: 700;
  background: var(--accent); color: #fff; padding: 1px 8px; border-radius: 999px;
}

.sidebar__footer, .side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.user-card, .usercard {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-xs);
}
.user-card:hover, .usercard:hover { background: rgba(255,255,255,.06); }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
}
.user-card__name, .usercard__name { color: #fff; font-size: 13px; font-weight: 600; }
.user-card__role, .usercard__role { color: rgba(255,255,255,.5); font-size: 11px; }
.logout {
  display: flex; align-items: center; gap: 11px; margin-top: 4px;
  padding: 9px 12px; border-radius: var(--radius-xs);
  color: #fb7185; font-size: 13px; font-weight: 600; transition: background .15s;
}
.logout svg { width: 18px; height: 18px; }
.logout:hover { background: rgba(251,113,133,.1); }

/* ---------- Main column ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--header-h);
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 var(--content-pad);
  position: sticky; top: 0; z-index: 40;
}
.menu-btn, .header__menu { display: none; width: 42px; height: 42px; border-radius: 12px; place-items: center; color: var(--text-muted); }
.menu-btn:hover, .header__menu:hover { background: var(--bg); }
.menu-btn svg, .header__menu svg { width: 22px; height: 22px; }
.sidebar-toggle {
  border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: background .18s, border-color .18s, box-shadow .18s;
}
.sidebar-toggle:hover { border-color: var(--accent); box-shadow: 0 7px 18px var(--accent-12); }
.sidebar-toggle span {
  width: 18px; height: 2px; display: block; margin: 3px auto;
  border-radius: 99px; background: currentColor; transition: transform .22s, opacity .18s;
}
.sidebar-toggle.is-active span:first-child { transform: translateY(5px) rotate(45deg); }
.sidebar-toggle.is-active span:nth-child(2) { opacity: 0; }
.sidebar-toggle.is-active span:last-child { transform: translateY(-5px) rotate(-45deg); }

.search { flex: 1; max-width: 440px; position: relative; }
.search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-soft); }
.search input {
  width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 11px;
  padding: 0 14px 0 42px; background: #fff; font-size: 13.5px; outline: none;
  transition: border .15s, box-shadow .15s;
}
html[dir="rtl"] .search input { padding: 0 42px 0 14px; }
.search input::placeholder { color: var(--text-soft); }
.search input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.search kbd {
  position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%);
  font: 600 11px var(--font); color: var(--text-soft);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px;
}

.header__spacer { flex: 1; }

/* language switcher (header dropdown) */
.lang-switch { position: relative; }
.lang-switch__btn {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px;
  border-radius: 11px; color: var(--text-muted); font-weight: 600; font-size: 13px;
  border: 1px solid var(--border); background: #fff;
}
.lang-switch__btn:hover { background: var(--bg); color: var(--text); }
.lang-switch__btn svg { width: 14px; height: 14px; }
.lang-switch__menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; min-width: 160px; display: none; z-index: 60;
}
.lang-switch.is-open .lang-switch__menu { display: block; }
.lang-switch__menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--text); text-align: start;
}
.lang-switch__menu button:hover { background: var(--bg); }
.lang-switch__menu button.is-active { color: var(--accent); font-weight: 700; }
.lang-flag { font-size: 16px; line-height: 1; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text-muted); position: relative; transition: background .15s, color .15s;
  border: 1px solid transparent;
}
.icon-btn:hover { background: #fff; border-color: var(--border); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }

.content { padding: var(--content-pad); }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.7px; }
.page-head p { color: var(--text-muted); font-size: 14px; margin-top: 3px; }
.page-head .crumb { color: var(--text-soft); font-size: 12.5px; font-weight: 600; letter-spacing: .2px; margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 11px; font-size: 13.5px; font-weight: 600;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px var(--accent-20); }
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--bg); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.94); }
.btn--sm { height: 36px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- Cards & stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__head { padding: var(--card-pad) var(--card-pad) calc(var(--card-pad) - 4px); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: none; }
.card__head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; gap: 8px; }
.card__head .sub { color: var(--text-soft); font-size: 12.5px; font-weight: 500; }
.card__body { padding: 0 var(--card-pad) var(--card-pad); }
.link-more { color: var(--accent); font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.link-more svg { width: 14px; height: 14px; }

.grid { display: grid; gap: var(--grid-gap); }
.grid--stats { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: 1.45fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.mb, .mb-4 { margin-bottom: var(--grid-gap); }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--stat-pad); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat__top { display: flex; align-items: center; justify-content: space-between; }
.stat__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-12); color: var(--accent); }
.stat__icon svg { width: 20px; height: 20px; }
.stat__delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; }
.stat__delta svg { width: 13px; height: 13px; }
.stat__delta--up { background: rgba(16,185,129,.12); color: var(--success-ink); }
.stat__delta--down { background: rgba(239,68,68,.1); color: var(--danger-ink); }
.stat__label { color: var(--text-muted); font-size: 13px; font-weight: 500; margin-top: 16px; }
.stat__value { font-size: 26px; font-weight: 800; letter-spacing: -.8px; margin-top: 4px; }
.stat__value .cur { font-size: 14px; font-weight: 600; color: var(--text-soft); letter-spacing: 0; }
.stat__foot { font-size: 12.5px; color: var(--text-soft); font-weight: 500; margin-top: 6px; }
.stat__trend { font-size: 12.5px; color: var(--text-soft); font-weight: 500; margin-top: 6px; }

/* mini secondary stats — green left-accent */
.stat--mini { padding: 16px var(--stat-pad); border-inline-start: 3px solid var(--accent); }
.stat--mini .stat__label { margin-top: 0; }
.stat--mini .stat__value { font-size: 21px; }

.stat--hero { background: linear-gradient(140deg, var(--accent) 0%, var(--accent-strong) 100%); border: none; color: #fff; }
.stat--hero .stat__icon { background: rgba(255,255,255,.18); color: #fff; }
.stat--hero .stat__label, .stat--hero .stat__value { color: #fff; }
.stat--hero .stat__foot, .stat--hero .stat__trend { color: rgba(255,255,255,.8); }
.stat--hero .stat__delta { background: rgba(255,255,255,.22); color: #fff; }
.stat--hero::after {
  content: ""; position: absolute; inset-inline-end: -30px; bottom: -40px;
  width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.08);
}

.val-success { color: var(--success-ink); }
.val-danger { color: var(--danger-ink); }
.val-accent { color: var(--accent); }

/* ---------- Chart ---------- */
.chart-wrap { position: relative; height: 240px; }
.chart-legend { display: flex; gap: 16px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-empty {
  min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
}
.chart-empty__emoji { font-size: 38px; line-height: 1; }
.chart-empty__text { color: var(--text-soft); font-size: 14px; font-weight: 500; }

/* ---------- Table ---------- */
.tbl-wrap, .table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  text-align: start; padding: 11px var(--card-pad); color: var(--text-soft); font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.data tbody td { padding: 13px var(--card-pad); border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
.text-right { text-align: end; }
.cell-strong { font-weight: 700; }
.cell-muted { color: var(--text-muted); }
.cell-prod { display: flex; align-items: center; gap: 11px; }
.cell-prod .thumb { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-12); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: rgba(16,185,129,.12); color: var(--success-ink); }
.badge--warning { background: rgba(245,158,11,.13); color: var(--warning-ink); }
.badge--danger { background: rgba(239,68,68,.1); color: var(--danger-ink); }
.badge--info { background: var(--accent-12); color: var(--accent-ink); }
.badge--neutral { background: #eef1f5; color: var(--text-muted); }

.bar { height: 7px; border-radius: 999px; background: var(--bg); overflow: hidden; min-width: 90px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }

.lowrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.lowrow:last-child { border-bottom: none; }
.lowrow .thumb { width: 38px; height: 38px; border-radius: 10px; background: rgba(245,158,11,.13); color: var(--warning-ink); display: grid; place-items: center; flex-shrink: 0; }
.lowrow .thumb svg { width: 18px; height: 18px; }
.lowrow__name { font-weight: 600; font-size: 13.5px; }
.lowrow__meta { color: var(--text-soft); font-size: 12px; margin-top: 1px; }

/* ============================================================
   Forms (shared field styling)
   ============================================================ */
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 0; min-width: 0; }
.field--full, .field.field--full { grid-column: 1 / -1; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
/* text-like inputs only — NOT checkboxes/radios */
.field input:not([type="checkbox"]):not([type="radio"]),
.field select, .field textarea,
.input, input.erp-field, select.erp-field, textarea.erp-field {
  height: 44px; border: 1px solid var(--border); border-radius: 11px; padding: 0 14px;
  font-size: 14px; outline: none; background: #fff; width: 100%;
  transition: border .15s, box-shadow .15s;
}
.field textarea, textarea.erp-field { height: auto; min-height: 64px; padding: 9px 12px; resize: vertical; line-height: 1.4; font-size: 13.5px; }
/* Notes textareas are kept compact across the platform */
textarea[name="notes"], textarea[name$="-notes"], textarea#id_notes {
  min-height: 56px; max-height: 120px; font-size: 13.5px;
}

/* --- Sale/purchase line rows: trash button + totals panel --- */
.row-del { background:none; border:none; cursor:pointer; color:#dc2626; padding:6px; border-radius:8px;
  display:inline-grid; place-items:center; transition:background .15s; }
.row-del:hover { background:#fee2e2; }
.disc-cell input, .qty-cell input, .price-cell input { width:100%; }
.sale-totals { margin-top:18px; margin-inline-start:auto; max-width:420px;
  border:1px solid var(--border); border-radius:12px; padding:6px 14px; }
.sale-totals__row { display:flex; align-items:center; justify-content:space-between;
  gap:14px; padding:9px 2px; border-bottom:1px solid var(--bg); }
.sale-totals__row:last-child { border-bottom:none; }
.sale-totals__row .gd-input input { width:130px; height:38px; text-align:end; }
.sale-totals__row--final { font-size:17px; font-weight:800; padding-top:12px; }
.sale-totals__row--final #grandTotal { color:var(--accent-strong); }

/* --- Inline icon spacing: keep SVG/emoji icons off the text --- */
h1 > svg, h2 > svg, h3 > svg, label > svg,
.page-head h1 > svg, .card__head h2 > svg {
  vertical-align: -3px; margin-inline-end: 7px;
}
/* headings that begin with an emoji glyph get breathing room via word-spacing */
.card__head h2, .page-head h1 { word-spacing: 2px; }
.field select, select.erp-field { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2393a0b0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
html[dir="rtl"] .field select, html[dir="rtl"] select.erp-field { background-position: left 14px center; padding-right: 14px; padding-left: 38px; }
.field input::placeholder, .input::placeholder { color: var(--text-soft); }
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .erp-field:focus { border-color: var(--accent); box-shadow: var(--ring); }

/* Pretty, SMALL checkboxes (used everywhere incl. formset DELETE) */
input[type="checkbox"], input[type="radio"], .erp-check {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex: 0 0 18px; margin: 0; cursor: pointer;
  border: 1.5px solid var(--border); background: #fff; vertical-align: middle;
  transition: background .15s, border-color .15s;
}
input[type="checkbox"], .erp-check { border-radius: 6px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked, .erp-check:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/13px no-repeat;
  border-color: var(--accent);
}
input[type="radio"]:checked { border: 5px solid var(--accent); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { box-shadow: var(--ring); }
/* the pay-choice radios are visually hidden, keep them so */
.pay-opt input[type="radio"] { appearance: auto; -webkit-appearance: auto; }

.hint, .help-text { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 2px; }
.muted-link { color: var(--accent); font-weight: 600; font-size: 13px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing:.5px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 10px; }

.input-wrap { position: relative; }
.input-wrap .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-soft); pointer-events: none; }
.input-wrap .input { padding-inline-start: 42px; }
.input-wrap .eye { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-soft); }
.input-wrap .eye:hover { background: var(--bg); color: var(--text); }
.input-wrap .eye svg { width: 18px; height: 18px; }
.with-suffix { display: grid; grid-template-columns: 1fr auto; }
.suffix { display: grid; place-items: center; padding: 0 14px; border: 1px solid var(--border); border-inline-start: none; border-radius: 0 11px 11px 0; background: var(--surface-2); color: var(--text-muted); font-weight: 700; font-size: 13px; }
.with-suffix .input { border-radius: 11px 0 0 11px; }

/* inline formset tables */
table.lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.lines th { text-align: start; padding: 8px 8px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
table.lines td { padding: 6px 8px; vertical-align: middle; }
table.lines input:not([type="checkbox"]):not([type="radio"]), table.lines select {
  height: 40px; width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 0 10px; font-family: inherit; font-size: 13.5px; outline: none; background: #fff;
}
table.lines input:focus, table.lines select:focus { border-color: var(--accent); box-shadow: var(--ring); }
table.lines tfoot td { padding-top: 12px; font-weight: 700; }
table.lines input[type="checkbox"] { margin: 0 auto; display: block; }

/* ---------- Polished form pages ---------- */
.form-wrap { max-width: 760px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.form-card + .form-card { margin-top: 20px; }
.form-card__head {
  padding: 18px 24px; border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2); display: flex; align-items: center; gap: 12px;
}
.form-card__head .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-12); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.form-card__head .ic svg { width: 19px; height: 19px; }
.form-card__head h2 { font-size: 15.5px; font-weight: 700; }
.form-card__head p { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; }
.form-card__body { padding: 24px; }
.form-actions {
  position: sticky; bottom: 0; margin-top: 22px;
  background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border); padding: 14px 0; display: flex; gap: 10px;
}
.checkfield { flex-direction: row !important; align-items: center; gap: 10px; padding: 10px 0; }
.checkfield label { cursor: pointer; }

/* waitlist quick-add row */
.wl-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wl-add .erp-field { height: 40px; flex: 1; min-width: 120px; }

/* ---------- Inline Price Drop editor ---------- */
.pd-row { cursor: pointer; }
.pd-row:hover { background: var(--surface-2); }
.pd-toggle-cell { text-align: center; }
.pd-caret { display: inline-grid; place-items: center; color: var(--text-soft); transition: transform .2s; }
html[dir="rtl"] .pd-caret { transform: rotate(180deg); }
.pd-row.is-open .pd-caret { transform: rotate(90deg); color: var(--accent); }
html[dir="rtl"] .pd-row.is-open .pd-caret { transform: rotate(90deg); }
.pd-row.is-open { background: var(--surface-2); }
.pd-panel { padding: 18px 22px 22px; animation: pdslide .25s ease; }
@keyframes pdslide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pd-loading { color: var(--text-soft); font-size: 13px; padding: 16px 0; }

.pd-impact {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 16px;
}
.pd-impact__lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-soft); font-weight: 700; }
.pd-impact__v { font-size: 19px; font-weight: 800; margin-top: 2px; }

.pd-var { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.pd-var__head { padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); font-weight: 700; font-size: 13.5px; }
.pd-var__meta { display: block; font-weight: 500; font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.pd-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.pd-tbl th { text-align: start; padding: 8px 16px; color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.pd-tbl td { padding: 8px 16px; border-top: 1px solid var(--border-soft); }
.pd-tbl .r { text-align: end; }
.pd-input { height: 38px; width: 150px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; text-align: end; outline: none; font-size: 13.5px; }
.pd-input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.pd-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.pd-saving { color: var(--text-soft); font-size: 13px; }

/* payment choice cards (sale form) */
.pay-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .pay-choice { grid-template-columns: 1fr; } }
.pay-opt { cursor: pointer; }
.pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pay-opt__box {
  display: block; padding: 16px 18px; border: 2px solid var(--border); border-radius: 14px;
  transition: border-color .15s, background .15s, box-shadow .15s; background: #fff;
}
.pay-opt:hover .pay-opt__box { border-color: var(--accent); }
.pay-opt input:checked + .pay-opt__box { border-color: var(--accent); background: var(--accent-12); box-shadow: var(--ring); }
.pay-opt input:disabled + .pay-opt__box { opacity: .45; cursor: not-allowed; }
.pay-opt__ic { font-size: 22px; line-height: 1; }
.pay-opt__t { display: block; font-weight: 700; font-size: 15px; margin-top: 8px; }
.pay-opt__d { display: block; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

/* balance chips on customer pages */
.bal-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.bal-chip--owe-us { background: rgba(255,59,48,.1); color: var(--danger-ink); }
.bal-chip--we-owe { background: rgba(245,158,11,.13); color: var(--warning-ink); }
.bal-chip--settled { background: rgba(16,185,129,.12); color: var(--success-ink); }

/* small utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-3 { margin-top: 14px; }

/* legacy alert (used inline on auth pages) */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 500; margin-bottom: 12px; border: 1px solid transparent; }
.alert--success { background: rgba(16,185,129,.1); color: var(--success-ink); border-color: rgba(16,185,129,.2); }
.alert--error   { background: rgba(255,59,48,.08); color: var(--danger-ink); border-color: rgba(255,59,48,.2); }
.alert--warning { background: rgba(245,158,11,.1); color: var(--warning-ink); border-color: rgba(245,158,11,.2); }
.alert--info    { background: var(--accent-12); color: var(--accent-ink); border-color: var(--accent-20); }

/* ============================================================
   Auth (login / register) — split brand + panel
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth__brand {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(160deg, var(--sidebar) 0%, var(--sidebar-2) 70%);
  padding: 56px 60px; display: flex; flex-direction: column;
}
.auth__brand::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(620px 380px at 80% -8%, var(--accent-20), transparent 60%),
    radial-gradient(560px 420px at -10% 108%, var(--accent-12), transparent 55%);
}
.auth__brand > * { position: relative; }
.auth-logo { display: flex; align-items: center; gap: 13px; }
.auth-logo__mark { width: 48px; height: 48px; display: grid; place-items: center; }
.auth-logo__mark img { width: 100%; height: 100%; object-fit: contain; }
.auth-logo__name { font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
.auth-logo__tag { font-size: 12px; color: rgba(255,255,255,.55); }

.auth__hero { margin-top: auto; }
.auth__hero h2 { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.12; max-width: 15ch; }
.auth__hero p { color: rgba(255,255,255,.66); font-size: 15px; margin-top: 16px; max-width: 42ch; line-height: 1.6; }
.auth-feats { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.auth-feat { display: flex; align-items: center; gap: 13px; font-size: 14px; color: rgba(255,255,255,.9); }
.auth-feat__ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex-shrink: 0; }
.auth-feat__ic svg { width: 17px; height: 17px; color: #fff; }
.auth-stats { margin-top: 40px; display: flex; gap: 34px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.12); }
.auth-stat__v { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.auth-stat__l { font-size: 12.5px; color: rgba(255,255,255,.55); margin-top: 2px; }

.auth__panel { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.auth-card { width: 100%; max-width: 408px; }
.auth-card--wide { max-width: 468px; }
.auth-mini-logo { display: none; }
.auth-card h1 { font-size: 27px; font-weight: 800; letter-spacing: -.6px; }
.auth-card .lede { color: var(--text-muted); font-size: 14.5px; margin: 6px 0 28px; }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 22px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.auth-link { color: var(--accent); font-weight: 600; font-size: 13px; }
.auth-link:hover { color: var(--accent-strong); }

.btn-auth {
  width: 100%; height: 48px; border-radius: 12px; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 24px var(--accent-20); transition: background .15s, transform .05s;
}
.btn-auth:hover { background: var(--accent-strong); }
.btn-auth:active { transform: translateY(1px); }
.btn-auth svg { width: 18px; height: 18px; }

.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.lang-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text-muted);
  font-size: 13px; font-weight: 600; transition: all .15s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill .flag { font-size: 15px; }
.auth-foot { text-align: center; color: var(--text-muted); font-size: 14px; margin-top: 26px; }
.auth-foot a { color: var(--accent); font-weight: 700; }

/* ============================================================
   Apple-style alerts / toasts (top-center, blurred, slide-in)
   ============================================================ */
.toast-stack {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px;
  width: 360px; max-width: calc(100vw - 32px); padding: 14px 16px;
  border-radius: 14px; background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 8px 30px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  animation: toastIn .42s cubic-bezier(.21,1.02,.73,1) both;
}
.toast.toast--leaving { animation: toastOut .3s ease forwards; }
.toast__icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.toast__icon svg { width: 17px; height: 17px; }
.toast__body { flex: 1; min-width: 0; padding-top: 1px; }
.toast__title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.25; letter-spacing: -.1px; }
.toast__msg { font-size: 13px; font-weight: 500; color: var(--text-muted); line-height: 1.35; margin-top: 2px; word-wrap: break-word; }
.toast__close { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-soft); transition: background .15s, color .15s; }
.toast__close:hover { background: rgba(0,0,0,.06); color: var(--text); }
.toast__close svg { width: 14px; height: 14px; }
.toast--success { box-shadow: 0 8px 30px rgba(16,185,129,.18), 0 2px 6px rgba(0,0,0,.06); }
.toast--success .toast__icon { background: var(--success); }
.toast--error { box-shadow: 0 8px 30px rgba(255,59,48,.18), 0 2px 6px rgba(0,0,0,.06); }
.toast--error .toast__icon { background: var(--danger); }
.toast--warning .toast__icon { background: var(--warning); }
.toast--info .toast__icon { background: var(--info); }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(-24px) scale(.96); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-16px) scale(.97); } }
.fade-in { animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   RTL (Arabic)
   ============================================================ */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid rgba(255,255,255,.05); }
html[dir="rtl"] .main { margin-left: 0; margin-right: var(--sidebar-w); }
html[dir="rtl"] .auth { direction: rtl; }
/* keep wide content from overflowing the fixed sidebar */
.content { max-width: 100%; overflow-x: hidden; }
.chart-wrap { width: 100%; }
.chart-wrap canvas { max-width: 100% !important; }

/* ============================================================
   Responsive
   ============================================================ */
.backdrop {
  position: fixed; inset: 0; background: rgba(3,15,12,.58); z-index: 45;
  opacity: 0; visibility: hidden; backdrop-filter: blur(3px);
  transition: opacity .28s, visibility .28s;
}
.backdrop.is-open { opacity: 1; visibility: visible; }

@media (max-width: 1040px) {
  .sidebar {
    width: min(310px, 88vw); transform: translateX(-105%);
    transition: transform .34s cubic-bezier(.2,.8,.2,1);
    box-shadow: 25px 0 70px rgba(3,15,12,.3);
  }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.is-open { transform: translateX(0) !important; }
  .sidebar__close { display: grid; }
  .main { margin-left: 0; margin-right: 0; }
  html[dir="rtl"] .main { margin-right: 0; }
  .menu-btn, .header__menu { display: grid; }
  .grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth-mini-logo { display: flex; justify-content: center; margin-bottom: 22px; }
  .auth-mini-logo .auth-logo__mark { width: 56px; height: 56px; }
}
@media (max-width: 1240px) { .grid--stats, .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .grid--stats { grid-template-columns: 1fr; }
  .field--row { grid-template-columns: 1fr; }
  :root { --content-pad: 18px; }
  .search kbd { display: none; }
}

/* ============================================================
   AUTH POLISH — animated orbs, glass card, entrance motion
   ============================================================ */
.auth__brand { isolation: isolate; }
.auth__brand::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5;
}
.auth__brand .orb {
  position: absolute; border-radius: 50%; filter: blur(28px); opacity: .55; z-index: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  animation: authFloat 9s ease-in-out infinite;
}
.auth__brand .orb.o1 { width: 280px; height: 280px; top: -40px; inset-inline-end: -50px; }
.auth__brand .orb.o2 { width: 220px; height: 220px; bottom: 40px; inset-inline-start: -60px; animation-delay: 2.5s; opacity: .4; }
@keyframes authFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-22px) scale(1.06); } }

.auth-card {
  animation: authRise .6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes authRise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.auth-card .input, .auth-card--wide input, .auth-card--wide select {
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-card .input:focus, .auth-card--wide input:focus, .auth-card--wide select:focus {
  box-shadow: 0 0 0 4px var(--accent-12); border-color: var(--accent); outline: none;
}
.btn-auth { transition: transform .15s, box-shadow .2s, background .2s; }
.btn-auth:hover { transform: translateY(-2px); }

/* mobile: hide brand orbs gracefully */
@media (max-width: 900px) { .auth__brand .orb { display: none; } }

/* ---------- Inline "create new" for lookup dropdowns ---------- */
.qa-row { display: flex; gap: 8px; align-items: stretch; }
.qa-row > select { flex: 1; min-width: 0; }
.qa-btn { flex: 0 0 auto; width: 46px; border: 1.5px dashed var(--border); border-radius: 11px;
  background: var(--surface); color: var(--accent); cursor: pointer; display: grid; place-items: center;
  transition: background .15s, border-color .15s, color .15s; }
.qa-btn:hover { background: var(--accent-12); border-color: var(--accent); border-style: solid; }
.qa-btn svg { width: 18px; height: 18px; }
.qa-panel { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.qa-panel input { flex: 1; min-width: 0; }
.qa-panel .btn { flex: 0 0 auto; height: 38px; }

/* ============================================================
   PRO POLISH LAYER — subtle, professional entrance + hovers.
   All entrance animations live inside prefers-reduced-motion:
   no-preference, so reduced-motion users always see static,
   fully-visible content (never stuck at opacity:0).
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* smoother page content entrance (fade + gentle rise) */
  .content.fade-in { animation: pageRise .42s cubic-bezier(.22,.8,.2,1) both; }
  @keyframes pageRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

  /* staggered rise for the main building blocks */
  .content .stat,
  .content .card,
  .content .feat { animation: blockRise .5s cubic-bezier(.22,.8,.2,1) both; }
  @keyframes blockRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .content .stat:nth-child(1){animation-delay:.02s}
  .content .stat:nth-child(2){animation-delay:.07s}
  .content .stat:nth-child(3){animation-delay:.12s}
  .content .stat:nth-child(4){animation-delay:.17s}
  .content .stat:nth-child(5){animation-delay:.22s}
  .content .stat:nth-child(6){animation-delay:.27s}

  /* table rows cascade in (first ~12 rows; rest just appear) */
  .content table.data tbody tr { animation: rowRise .4s ease both; }
  .content table.data tbody tr:nth-child(1){animation-delay:.03s}
  .content table.data tbody tr:nth-child(2){animation-delay:.06s}
  .content table.data tbody tr:nth-child(3){animation-delay:.09s}
  .content table.data tbody tr:nth-child(4){animation-delay:.12s}
  .content table.data tbody tr:nth-child(5){animation-delay:.15s}
  .content table.data tbody tr:nth-child(6){animation-delay:.18s}
  .content table.data tbody tr:nth-child(7){animation-delay:.21s}
  .content table.data tbody tr:nth-child(8){animation-delay:.24s}
  .content table.data tbody tr:nth-child(n+9){animation-delay:.27s}
  @keyframes rowRise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
}

/* refined card & row hovers (cheap, GPU-friendly, safe everywhere) */
.content .card { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.content .card:hover { box-shadow: 0 14px 34px rgba(15,23,42,.09); }
.content .stat { transition: box-shadow .2s ease, transform .2s ease; }
.content .stat:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,23,42,.08); }
table.data tbody tr { position: relative; }
table.data tbody tr:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] table.data tbody tr:hover { box-shadow: inset -3px 0 0 var(--accent); }

/* buttons: consistent, lively-but-subtle feedback */
.btn { transition: background .15s, box-shadow .15s, transform .08s, border-color .15s, filter .15s; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }
.btn--primary:not(:disabled):hover { box-shadow: 0 8px 20px var(--accent-20); }

/* status badges: a touch more polish */
.badge { transition: filter .15s; }

/* page header heading reads a bit stronger */
.page-head h1 { letter-spacing: -.4px; }
