/* ==========================================================================
   APEX — Dashboard
   Light, RTL, no framework. APEX red for actions, gold for small accents.
   ========================================================================== */

:root {
  --bg: #F5F4F1;
  --surface: #FFFFFF;
  --surface-2: #FAF9F7;
  --line: #ECE9E4;
  --line-2: #DDD8D0;
  --text: #17150F;
  --muted: #6F6A62;
  --faint: #A29C92;

  --red: #D0112B;
  --red-dark: #A70D22;
  --red-soft: #FDEDEF;
  --gold: #A9812F;
  --gold-soft: #FBF5E7;
  --gold-line: #E8D7AE;

  --success: #1D7A45;
  --success-soft: #E7F5EC;
  --warning: #A86400;
  --warning-soft: #FFF3DD;
  --info: #22579F;
  --info-soft: #EAF1FB;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 21, 15, .05), 0 6px 20px rgba(23, 21, 15, .04);
  --shadow-lg: 0 20px 60px rgba(23, 21, 15, .18);
  --text-2: #3E3A33;
  --red-hover: #A70D22;
  --header-bg: rgba(245, 244, 241, .88);
  --neutral-pill: #F0EEEA;
  --tabs-bg: #EBE8E3;
  --tabs-active: #FFFFFF;
  --tabs-count: rgba(0, 0, 0, .06);
  --row-hover: #FCFBF9;
  --track: #F0EDE8;
  --pack-img-end: #F4EEE2;
  --warn-text: #6E4300;
  --toast-bg: #1B1916;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236F6A62' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: light;
  --sidebar: 262px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0B0A09;
  --surface: #151311;
  --surface-2: #1C1A17;
  --line: #2A2622;
  --line-2: #3A352F;
  --text: #F2EEE8;
  --text-2: #D8D2C9;
  --muted: #A39C92;
  --faint: #6F6860;

  --red: #E0192F;
  --red-hover: #F02A40;
  --red-dark: #FF7482;
  --red-soft: rgba(224, 25, 47, .15);
  --gold: #D4B062;
  --gold-soft: rgba(201, 163, 78, .12);
  --gold-line: rgba(201, 163, 78, .38);

  --success: #5BD08E;
  --success-soft: rgba(46, 160, 90, .16);
  --warning: #F2B34C;
  --warning-soft: rgba(242, 179, 76, .14);
  --info: #86B4F5;
  --info-soft: rgba(90, 140, 230, .16);

  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .65);
  --header-bg: rgba(11, 10, 9, .86);
  --neutral-pill: #26221E;
  --tabs-bg: #1C1A17;
  --tabs-active: #2C2824;
  --tabs-count: rgba(255, 255, 255, .08);
  --row-hover: #1A1815;
  --track: #26221E;
  --pack-img-end: #1A1712;
  --warn-text: #F7D9A2;
  --toast-bg: #2A2622;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A39C92' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.6;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
body.has-layer { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; flex-shrink: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red); }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--red); }
.spacer { flex: 1; }
.stack { display: grid; gap: 18px; align-content: start; }
.link { color: var(--red); font-weight: 500; font-size: 13.5px; }
.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ layout */

.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 28px 48px; width: 100%; max-width: 1360px; margin-inline: auto; outline: none; }

/* sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--surface); border-inline-start: 0; border-inline-end: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.brand__emblem { width: 40px; height: 36px; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(208, 17, 43, .25)); }
.brand__text { display: grid; gap: 2px; }
.brand__word { width: 96px; height: 13px; display: block; }
.brand__text small { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

.nav { padding: 10px 12px 18px; display: grid; gap: 2px; }
.nav__group { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 16px 12px 6px; letter-spacing: .03em; }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm); color: var(--text-2); font-size: 14.5px; transition: background .15s, color .15s;
}
.nav__link .i { width: 19px; height: 19px; color: var(--faint); transition: color .15s; }
.nav__link:hover { background: var(--surface-2); color: var(--text); }
.nav__link:hover .i { color: var(--text); }
.nav__link.is-active { background: var(--red-soft); color: var(--red-dark); font-weight: 600; }
.nav__link.is-active .i { color: var(--red); }
.nav__link.is-active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red);
}
.nav__count {
  margin-inline-start: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center;
}
.sidebar__app {
  margin: auto 12px 16px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--gold-line); background: var(--gold-soft); color: var(--gold); font-weight: 500; font-size: 13.5px;
}
.sidebar__app:hover { border-style: solid; }
.sidebar__lan { margin: -8px 12px 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.sidebar__lan b { font-size: 13.5px; color: var(--text); user-select: all; }
.sidebar__lan small { font-size: 11.5px; color: var(--faint); }

/* header */
.header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 28px;
  background: var(--header-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.header__title { min-width: 0; }
.header__title h1 { font-size: 20px; font-weight: 700; line-height: 1.3; }
.header__title p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.header .menu-btn { display: none; }
.api-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 4px rgba(0, 0, 0, .04); }
.api-dot.is-ok { background: #22A05A; box-shadow: 0 0 0 4px rgba(34, 160, 90, .15); }
.api-dot.is-down { background: var(--red); box-shadow: 0 0 0 4px rgba(208, 17, 43, .15); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.user-chip span { display: grid; line-height: 1.25; }
.user-chip b { font-size: 13.5px; font-weight: 600; }
.user-chip small { font-size: 11.5px; color: var(--muted); }

.backdrop { display: none; }

/* ------------------------------------------------------------------ basics */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card__head h2 { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card__head h2 .i { color: var(--red); }
.card__pad { padding: 16px 20px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.grid-2--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--red); background: var(--red); color: #fff;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible, .select:focus-visible { outline: 2px solid rgba(208, 17, 43, .35); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .i { width: 18px; height: 18px; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--faint); }
.btn--danger { background: var(--red); }
.btn--danger-text { color: var(--red); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn--xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite;
}

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.icon-btn--danger:hover { background: var(--red-soft); color: var(--red); border-color: transparent; }
.icon-btn--light { color: #fff; background: rgba(255, 255, 255, .12); }

.input, .select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 44px; line-height: 1.6; }
.input:focus, .select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 17, 43, .1); outline: none; }
.select { appearance: none; padding-inline-start: 34px; cursor: pointer;
  background: var(--surface) var(--select-arrow) no-repeat left 10px center / 16px; }
.select:disabled { opacity: .7; cursor: default; }
.input--date { width: auto; }
input[type="date"], input[type="time"] { direction: ltr; text-align: right; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-pill); color: var(--muted);
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--danger { background: var(--red-soft); color: var(--red-dark); }
.badge--gold { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-line); }

.select--status { height: 32px; width: auto; min-width: 140px; font-size: 13px; font-weight: 600; border-radius: 999px; padding-inline-end: 12px; }
.select--status[data-tone="warning"] { background-color: var(--warning-soft); color: var(--warning); border-color: transparent; }
.select--status[data-tone="info"] { background-color: var(--info-soft); color: var(--info); border-color: transparent; }
.select--status[data-tone="success"] { background-color: var(--success-soft); color: var(--success); border-color: transparent; }
.select--status[data-tone="danger"] { background-color: var(--red-soft); color: var(--red-dark); border-color: transparent; }
.select--status[data-tone="muted"] { background-color: var(--neutral-pill); color: var(--muted); border-color: transparent; }

.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); direction: ltr; font-weight: 600; }

/* ----------------------------------------------------------------- toolbar */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar__start, .toolbar__end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 14px; }
.filters .select { width: auto; min-width: 150px; height: 38px; }
.filters .input--date { height: 38px; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--tabs-bg); flex-wrap: wrap; }
.tabs__item {
  height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px;
}
.tabs__item:hover { color: var(--text); }
.tabs__item.is-active { background: var(--tabs-active); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.tabs__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--tabs-count); font-size: 11.5px; display: grid; place-items: center; }
.tabs__item.is-active .tabs__count { background: var(--red-soft); color: var(--red-dark); }

.search { position: relative; display: block; }
.search .i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { width: 280px; height: 40px; padding-inline-start: 40px; }

/* ------------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--row-hover); }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-focus td, .is-focus { background: var(--gold-soft) !important; }
.table td.num { font-variant-numeric: tabular-nums; }
.table td.actions { text-align: end; white-space: nowrap; width: 1%; }
.table td.icon-col { width: 1%; }

.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person { display: grid; gap: 1px; min-width: 0; }
.person b { font-weight: 600; }
.person span, .person .phone { font-size: 12.5px; color: var(--muted); }
.person--link:hover b { color: var(--red); text-decoration: underline; }
.phone { direction: ltr; unicode-bidi: isolate; }
.phone:hover { color: var(--red); }
.when { display: grid; line-height: 1.35; }
.when span { font-size: 12.5px; color: var(--muted); }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 420px; font-size: 13px; color: var(--muted); }
.note-line { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin-top: 4px; max-width: 360px; }
.note-line .i { width: 14px; height: 14px; margin-top: 3px; }
.note-line--staff { color: var(--info); }
.items { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; font-size: 13.5px; }
.type-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.stars { color: var(--gold); letter-spacing: 1px; }
.stars i { font-style: normal; color: var(--line-2); }

.thumb {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--faint);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb--sm { width: 38px; height: 38px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #2A2724, #0E0D0B); color: #F1D9A0; font-weight: 600; font-size: 16px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: 13.5px; }
.avatar--lg { width: 64px; height: 64px; font-size: 26px; }
.avatar--xl { width: 72px; height: 72px; font-size: 28px; }

.stock {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums;
}
.stock .i { color: var(--faint); }
.stock:hover { border-color: var(--line-2); }
.stock.is-low { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.stock.is-out { background: var(--red-soft); color: var(--red-dark); border-color: transparent; }

.empty { display: grid; justify-items: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--muted); }
.empty > .i { width: 38px; height: 38px; color: var(--line-2); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--red); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; display: inline-flex; align-items: center; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.facts > span { display: inline-flex; align-items: center; gap: 5px; }
.facts .i { width: 15px; height: 15px; }

.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); font-size: 13.5px; }
.callout--warn { background: var(--warning-soft); color: var(--warn-text); border-color: transparent; padding: 16px 18px; }
.callout--warn .i { color: var(--warning); margin-top: 2px; }
.callout p { margin-top: 2px; }

/* ------------------------------------------------------------------ stats */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  position: relative; display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
a.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(23, 21, 15, .08); }
.stat__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); margin-bottom: 8px; }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { font-size: 26px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: 12px; color: var(--faint); }
.stat--red .stat__icon { background: var(--red-soft); color: var(--red); }
.stat--red .stat__value { color: var(--red); }
.stat--gold .stat__icon { background: var(--gold-soft); color: var(--gold); }

/* --------------------------------------------------------------- overview */

.timeline { list-style: none; margin: 0; padding: 6px 0; }
.timeline__item { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.timeline__item:last-child { border-bottom: 0; }
.timeline__item.is-off { opacity: .5; }
.timeline__time { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; text-align: end; color: var(--red-dark); }
.timeline__body { display: grid; min-width: 0; }
.timeline__body b { font-weight: 600; }
.timeline__body span { font-size: 13px; }
.timeline__end { display: flex; align-items: center; gap: 8px; }

.mini-list { list-style: none; margin: 0; padding: 6px 8px; }
.mini-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); }
.mini-list a:hover { background: var(--surface-2); }
.mini-list a > span:not(.thumb) { display: grid; flex: 1; min-width: 0; }
.mini-list small { font-size: 12.5px; }
.mini-list .i { color: var(--faint); }

.quick { display: grid; grid-template-columns: 1fr 1fr; padding: 8px; gap: 6px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); font-weight: 500; font-size: 13.5px; }
.quick a:hover { background: var(--red-soft); color: var(--red-dark); }
.quick .i { color: var(--red); }

/* ---------------------------------------------------------- tattoo & cards */

.requests { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; }
.request { display: grid; grid-template-columns: 170px 1fr; overflow: hidden; }
.request--new { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow); }
.request.is-focus { box-shadow: 0 0 0 3px var(--red), var(--shadow); }
.request__media { background: var(--surface-2); border-inline-end: 1px solid var(--line); }
.request__img { width: 100%; height: 100%; min-height: 200px; border: 0; padding: 0; display: block; background: none; }
.request__img img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.request__img--empty { display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--faint); font-size: 12px; }
.request__img--empty .i { width: 32px; height: 32px; }
.request__body { padding: 16px 18px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.request__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.request__head > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.request__style { font-size: 15.5px; }
.request__desc { font-size: 14px; line-height: 1.7; }
.request__price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--muted); }
.request__price b { font-size: 16px; color: var(--text); }
.request__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.work { overflow: hidden; display: grid; }
.work.is-muted, .pack.is-muted, .member.is-muted { opacity: .65; }
.work__img { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; background: linear-gradient(160deg, #1B1917, #0B0A09); color: #6A625A; overflow: hidden; }
.work__img img { width: 100%; height: 100%; object-fit: cover; }
.work__img .i { width: 36px; height: 36px; }
.work__body { padding: 12px 14px 4px; display: grid; gap: 3px; }
.work__body small { font-size: 12.5px; }
.work__actions { display: flex; justify-content: flex-end; gap: 4px; padding: 6px 8px 8px; }

.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pack { display: grid; overflow: hidden; }
.pack__img { width: 100%; height: 130px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold-soft), var(--pack-img-end)); color: var(--gold); overflow: hidden; }
.pack__img img { width: 100%; height: 100%; object-fit: cover; }
.pack__img .i { width: 34px; height: 34px; }
.pack__body { padding: 14px 16px 6px; display: grid; gap: 8px; }
.pack__head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pack__head b { font-size: 16px; }
.pack__services { margin: 0; padding-inline-start: 18px; font-size: 13.5px; color: var(--muted); }
.pack__price { display: flex; align-items: baseline; gap: 8px; }
.pack__price b { font-size: 18px; color: var(--red-dark); }
.pack__price s { color: var(--faint); font-size: 13px; }
.pack__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.pack__actions { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 12px 12px; }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.member { padding: 18px; display: grid; gap: 14px; }
.member__top { display: flex; gap: 14px; align-items: center; }
.member__top > div { display: grid; gap: 2px; justify-items: start; }
.member__top b { font-size: 16.5px; }
.member__actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }

.bars { display: grid; gap: 10px; }
.bars__row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.bars__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars__track { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bars__track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #E0303F, var(--red)); }
.bars__value { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 70px; text-align: end; }

.facts-list { margin: 0; display: grid; gap: 10px; }
.facts-list div { display: flex; justify-content: space-between; gap: 12px; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; font-weight: 500; }
.links { display: grid; gap: 8px; }

/* ----------------------------------------------------------------- layers */

.layer { position: fixed; inset: 0; z-index: 100; background: rgba(23, 21, 15, 0); transition: background .2s; }
.layer.is-open { background: rgba(23, 21, 15, .42); }
.layer--modal { display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal {
  width: min(100%, 580px); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s;
}
.layer.is-open .modal { transform: none; opacity: 1; }
.modal--sm { width: min(100%, 420px); }
.modal--lg { width: min(100%, 780px); }
.modal__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.modal__head h3 { font-size: 17px; font-weight: 700; }
.modal__head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.modal__body { padding: 18px 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; }

.confirm { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 26px 24px 18px; }
.confirm__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--warning-soft); color: var(--warning); margin-bottom: 4px; }
.confirm__icon.is-danger { background: var(--red-soft); color: var(--red); }
.confirm h3 { font-size: 17px; }
.confirm p { color: var(--muted); font-size: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form-section { font-weight: 600; font-size: 13px; color: var(--gold); padding-top: 6px; }
.form-hint { font-size: 13px; color: var(--muted); margin-top: -4px; }
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red-dark); font-size: 13.5px; font-weight: 500; margin-bottom: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field__label .req { color: var(--red); font-style: normal; }
.field__help { font-size: 12px; color: var(--faint); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; padding: 2px; }
.check { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.check small { grid-column: 2; font-size: 11.5px; color: var(--faint); }
.check:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.check input { accent-color: var(--red); width: 16px; height: 16px; margin: 0; }
.check--inline { display: inline-grid; padding: 4px 8px; font-size: 12.5px; }
.image-field { display: flex; gap: 14px; align-items: center; }
.image-field__preview { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--faint); flex-shrink: 0; }
.image-field__preview img { width: 100%; height: 100%; object-fit: cover; }
.image-field__actions { display: grid; gap: 6px; justify-items: start; }
.slot-box .slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-variant-numeric: tabular-nums; }
.slot:hover { border-color: var(--red); }
.slot.is-active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

.layer--drawer { display: flex; justify-content: flex-end; }
.drawer {
  width: min(100%, 620px); height: 100%; background: var(--bg); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
[dir="rtl"] .layer--drawer { justify-content: flex-end; }
.layer.is-open .drawer { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: 16px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

.profile { display: grid; gap: 16px; }
.profile__top { display: flex; gap: 16px; align-items: center; }
.profile__top h2 { font-size: 21px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.phone--big { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--text); margin: 2px 0; }
.phone--big .i { color: var(--red); }
.profile__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.profile__stats div { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.profile__stats b { font-size: 15.5px; font-variant-numeric: tabular-nums; }
.profile__stats span { font-size: 12px; color: var(--muted); }
.profile__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile__history .card { box-shadow: none; }
.notes-save { margin-top: -8px; }
.row-link { display: flex; gap: 10px; align-items: center; }
.row-link > span { display: grid; }

.layer--lightbox { display: grid; place-items: center; padding: 30px; }
.layer--lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow-lg); }
.layer--lightbox .icon-btn { position: absolute; top: 18px; inset-inline-start: 18px; }
.layer--lightbox.is-open { background: rgba(10, 9, 8, .85); }

.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 200; display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 12px; background: var(--toast-bg); color: #fff; border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .25s, opacity .25s;
}
.toast--visible { transform: translate(-50%, 0); opacity: 1; }
.toast--success .i { color: #6BD39A; }
.toast--error { background: var(--red-dark); }

/* ------------------------------------------------------------------ login */

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(208, 17, 43, .08), transparent 70%),
    radial-gradient(40% 40% at 90% 100%, rgba(169, 129, 47, .08), transparent 70%), var(--bg);
}
.login__card { width: min(100%, 400px); display: grid; gap: 14px; padding: 34px 30px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); }
.login__brand { display: grid; justify-items: center; gap: 12px; margin-bottom: 6px; }
.login__emblem { width: 76px; height: 68px; filter: drop-shadow(0 6px 16px rgba(208, 17, 43, .3)); }
.login__word { width: 150px; height: 20px; }
.login__card h1 { font-size: 20px; text-align: center; }
.login__card > p { text-align: center; margin-top: -8px; font-size: 13.5px; }
.login .form-error { margin: 0; }
.login .btn { height: 46px; margin-top: 4px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .grid-2, .grid-2--even { grid-template-columns: 1fr; }
  .requests { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; width: min(86vw, 290px);
    transform: translateX(100%); transition: transform .25s; box-shadow: var(--shadow-lg);
  }
  .menu-open .sidebar { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(23, 21, 15, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .menu-open .backdrop { opacity: 1; pointer-events: auto; }
  .header .menu-btn { display: inline-grid; }
  .header { padding: 10px 16px; }
  .content { padding: 18px 16px 40px; }
  .user-chip span { display: none; }
  .user-chip { padding: 4px; }
}

@media (max-width: 720px) {
  .header__title p { display: none; }
  .header__title h1 { font-size: 17px; }
  .search .input { width: 100%; }
  .toolbar__start, .toolbar__end, .search { width: 100%; }
  .toolbar__end .btn { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat__value { font-size: 21px; }

  /* Tables turn into stacked cards. */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
  .table td[data-label=""]::before { content: none; }
  .table td.actions { width: 100%; justify-content: flex-end; }
  .clip, .note-line { max-width: 60vw; }

  .request { grid-template-columns: 1fr; }
  .request__img { min-height: 180px; max-height: 260px; }
  .timeline__item { grid-template-columns: 64px 1fr; }
  .timeline__end { grid-column: 1 / -1; justify-content: flex-end; }
  .profile__stats { grid-template-columns: 1fr 1fr; }
  .bars__row { grid-template-columns: 90px 1fr auto; }
  .modal__body { padding: 16px; }
  .layer--modal { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal__foot { border-radius: 0; }
}

/* ------------------------------------------------------------- dark extras */

[data-theme="dark"] .avatar { box-shadow: inset 0 0 0 1px var(--gold-line); }
[data-theme="dark"] .brand__emblem, [data-theme="dark"] .login__emblem { filter: drop-shadow(0 0 12px rgba(255, 30, 45, .45)); }
[data-theme="dark"] .sidebar { background: #0F0E0C; }
[data-theme="dark"] .select--status[data-tone] { border-color: transparent; }
[data-theme="dark"] .stat--gold .stat__value { color: var(--gold); }
.theme-btn .i { width: 19px; height: 19px; }

/* ------------------------------------------------------------- cashier */

.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.pos__catalog { min-width: 0; display: grid; gap: 12px; }
.pos__bar .tabs { width: 100%; }
.pos__tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pos__today { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.pos__today .i { vertical-align: -3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.tiles > .empty { grid-column: 1 / -1; }
.tiles--form { grid-template-columns: 1fr; }
.tile {
  position: relative; display: grid; gap: 4px; align-content: start; min-height: 104px; padding: 14px; text-align: start;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.tile:hover { border-color: var(--red); transform: translateY(-1px); }
.tile:active { transform: scale(.98); }
.tile:disabled { opacity: .45; cursor: not-allowed; transform: none; border-color: var(--line); }
.tile b { font-size: 14.5px; line-height: 1.4; }
.tile small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.tile__price { margin-top: auto; font-weight: 700; color: var(--red-dark); }
.tile__in { position: absolute; top: 8px; inset-inline-end: 8px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); }
.custom-line { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }

.bill { position: sticky; top: 88px; padding: 16px; display: grid; gap: 12px; max-height: calc(100vh - 104px); overflow-y: auto; }
.bill__head { display: flex; justify-content: space-between; align-items: center; }
.bill__head h2 { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.bill__head h2 .i { color: var(--red); }
.bill__lines { display: grid; gap: 2px; border-block: 1px solid var(--line); padding: 6px 0; min-height: 70px; }
.bill__empty { padding: 18px 0; text-align: center; font-size: 13px; }
.bill-line { display: grid; grid-template-columns: 1fr auto 70px 30px; gap: 8px; align-items: center; padding: 6px 0; }
.bill-line__name { display: grid; min-width: 0; }
.bill-line__name b { font-weight: 600; font-size: 13.5px; }
.bill-line__name small { font-size: 11.5px; color: var(--muted); }
.bill-line__total { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.bill-line .icon-btn { width: 30px; height: 30px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; }
.qty button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); }
.qty button:hover { color: var(--text); }
.qty span { min-width: 20px; text-align: center; font-weight: 600; font-size: 13px; }
.bill__sums { display: grid; gap: 8px; font-size: 14px; }
.bill__sums > div { display: flex; justify-content: space-between; }
.bill__discount { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); }
.bill__discount .input { width: 130px; height: 36px; }
.bill__total { padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 17px; }
.bill__total b { color: var(--red-dark); font-size: 20px; }
.input--big { height: 50px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cash-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.cash-quick button { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cash-quick button:hover { border-color: var(--red); }
.bill__change { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--success); }
.bill__change b { font-size: 20px; }
.bill__change.is-short { background: var(--red-soft); color: var(--red-dark); }
.btn--pay { height: 52px; font-size: 16px; }
.receipt-sum { display: grid; gap: 8px; margin-bottom: 14px; }
.receipt-sum > div { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.receipt-sum .is-change { background: var(--success-soft); color: var(--success); }
.receipt-sum .is-change b { font-size: 22px; }
.sales-log { display: grid; gap: 10px; }
.sale { padding: 12px 14px; display: grid; gap: 6px; }
.sale.is-void { opacity: .6; }
.sale__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sale__total { margin-inline-start: auto; }
.sale__actions { display: flex; gap: 6px; }

/* --------------------------------------------------------------- barista */

.cafe-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cafe-order { padding: 16px; display: grid; gap: 10px; border-top: 4px solid var(--line-2); }
.cafe-order--pending { border-top-color: var(--warning); }
.cafe-order--preparing { border-top-color: var(--info); }
.cafe-order--ready { border-top-color: var(--success); box-shadow: 0 0 0 3px var(--success-soft), var(--shadow); }
.cafe-order__head { display: flex; align-items: center; gap: 10px; }
.cafe-order__num { font-size: 22px; font-variant-numeric: tabular-nums; }
.cafe-order__head .muted { margin-inline-start: auto; }
.items--big { font-size: 15px; gap: 4px; }
.cafe-order__foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.cafe-order__actions { display: flex; gap: 8px; align-items: center; }
.cafe-order__actions .btn:first-child { flex: 1; }

/* ---------------------------------------------------------- inventory */

.stats--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.profile__stats--3 { grid-template-columns: repeat(3, 1fr); }
.inv-lines { display: grid; gap: 8px; }
.inv-line { display: grid; grid-template-columns: minmax(0, 2.4fr) 90px 120px 100px 36px; gap: 8px; align-items: center; }
.inv-line .select, .inv-line .input { height: 40px; }
.inv-line__total { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-lines__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.inv-lines__foot b { font-size: 17px; color: var(--red-dark); }
.form-hint b { color: var(--text); }

@media (max-width: 1180px) {
  .pos { grid-template-columns: 1fr; }
  .bill { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .inv-line { grid-template-columns: 1fr 1fr; }
  .inv-line .select { grid-column: 1 / -1; }
  .custom-line { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
}

/* link-looking buttons (e.g. «تفريغ» in the bill) */
button.link { background: none; border: 0; padding: 0; cursor: pointer; }

/* ------------------------------------------------ the chairs right now */
.chair-list { list-style: none; margin: 0; padding: 6px 8px; }
.chair-row { --tone: var(--success); display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); }
.chair-row + .chair-row { border-top: 1px solid var(--line); }
.chair-row--busy { --tone: var(--red); }
.chair-row--soon { --tone: var(--warning); }
.chair-row--off { --tone: var(--line-2); }
.chair-row--off .chair-row__info { opacity: .7; }
.chair-row__ring { position: relative; width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--tone) calc(var(--p, 0) * 1%), var(--line) 0); }
.chair-row__ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.chair-row__info { display: grid; min-width: 0; }
.chair-row__info small { font-size: 12.5px; }

/* ------------------------------------------------------- before / after */
.look-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.look-pair .work__img { aspect-ratio: 3 / 4; }
.look-pair__tag { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11.5px; }
.look-pair__tag--after { right: auto; left: 8px; }
