/*!
 * Fakhr Pro Design System
 * ======================
 * نظام تصميم موحد احترافي قابل للتخصيص الكامل (White-label)
 * كل شيء يتحكم به من خلال متغيرات CSS تُحقن من PHP
 *
 * البنية:
 *  - تعريف المتغيرات (:root)
 *  - الطباعة الأساسية
 *  - المكونات (buttons, cards, inputs, tables, badges, nav)
 *  - النظام الشبكي Responsive
 *  - الثيم الداكن (dark mode تلقائي)
 *  - الحركات والانتقالات
 *  - Print styles
 */

/* ============================================================
   1) متغيرات النظام (تُسحب من إعدادات المحل في قاعدة البيانات)
   ============================================================ */
:root {
  /* ألوان الهوية (قابلة للتخصيص من الإعدادات) */
  --brand: #5e3b23;
  --brand-2: #a66e3f;
  --brand-dark: #3f2817;
  --brand-soft: #faf7f2;
  --accent: #c08040;

  /* ألوان الحالات */
  --success: #067647;
  --success-bg: #dcfae6;
  --warning: #b54708;
  --warning-bg: #fef3c7;
  --danger: #b42318;
  --danger-bg: #fee4e2;
  --info: #175cd3;
  --info-bg: #dbeafe;

  /* ألوان محايدة */
  --bg: #f6f1eb;
  --bg-2: #faf7f2;
  --card: #ffffff;
  --line: #e8ddd3;
  --line-2: #eadfd5;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-soft: #8b7a6b;

  /* أحجام الخطوط */
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;

  /* نصف الأقطار */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* الظلال */
  --shadow-xs: 0 1px 2px rgba(17,24,39,.04);
  --shadow-sm: 0 4px 10px rgba(17,24,39,.05);
  --shadow: 0 10px 24px rgba(17,24,39,.06);
  --shadow-lg: 0 18px 40px rgba(17,24,39,.10);
  --shadow-brand: 0 10px 28px rgba(94,59,35,.16);

  /* المسافات */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Transitions */
  --tr-fast: .15s cubic-bezier(.4,0,.2,1);
  --tr: .22s cubic-bezier(.4,0,.2,1);
  --tr-slow: .4s cubic-bezier(.4,0,.2,1);

  /* Z-index */
  --z-dropdown: 40;
  --z-sticky: 50;
  --z-modal: 100;
  --z-toast: 200;
}

/* ============================================================
   2) Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Cairo', 'Tajawal', Tahoma, Arial, sans-serif;
  font-size: var(--fs-base);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-2); text-decoration: none; transition: color var(--tr-fast); }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--sp-3); line-height: 1.3; color: var(--brand-dark); }
h1 { font-size: var(--fs-3xl); font-weight: 800; }
h2 { font-size: var(--fs-2xl); font-weight: 800; }
h3 { font-size: var(--fs-xl); font-weight: 700; }
p { margin: 0 0 var(--sp-3); }
small, .text-sm { font-size: var(--fs-sm); }
.muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* ============================================================
   3) Topbar (رأس الصفحة الثابت)
   ============================================================ */
.topbar {
  position: sticky; top: 0;
  z-index: var(--z-sticky);
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--brand-2));
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  justify-content: space-between;
  box-shadow: var(--shadow-brand);
  backdrop-filter: saturate(160%);
}
.topbar .brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.topbar .brand img {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: #fff; padding: 4px;
  object-fit: contain;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.topbar .brand h1 {
  color: #fff; margin: 0;
  font-size: var(--fs-lg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .brand p { margin: 2px 0 0; font-size: var(--fs-sm); opacity: .92; }

.topbar .user-menu { position: relative; }
.topbar .user-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--tr-fast);
}
.topbar .user-chip:hover { background: rgba(255,255,255,.22); }
.topbar .user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
}

/* ============================================================
   4) Container & Layout
   ============================================================ */
.container {
  max-width: 1360px;
  margin: 22px auto;
  padding: 0 var(--sp-4);
}
.container-narrow { max-width: 900px; }

/* الشبكة */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sp-4); }
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-12 { grid-column: span 12; }
@media (max-width: 980px) {
  .col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10 { grid-column: 1 / -1; }
}

/* Flex utils */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

/* ============================================================
   5) Navigation (القائمة الجانبية/العلوية)
   ============================================================ */
.nav {
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3);
  background: rgba(255,255,255,.7);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav a {
  background: #fff;
  padding: 10px 15px;
  border-radius: var(--radius);
  text-decoration: none;
  color: #2d1f16;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: all var(--tr);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.nav a::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-2); opacity: 0;
  transition: opacity var(--tr-fast);
}
.nav a:hover {
  background: var(--brand-soft);
  border-color: var(--brand-2);
  color: var(--brand);
  transform: translateY(-1px);
}
.nav a.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}
.nav a.active::before { opacity: 1; background: #fff; }

.nav .nav-items { display: flex; gap: var(--sp-2); flex-wrap: wrap; flex: 1; }
@media (max-width: 768px) {
  .nav { padding: var(--sp-2); }
  .nav .nav-items { display: none; width: 100%; flex-direction: column; padding: 8px 0 0; }
  .nav.nav-open .nav-items { display: flex; }
  .nav .nav-items a { width: 100%; justify-content: flex-start; }
}

/* ============================================================
   6) Cards
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow);
  margin-bottom: var(--sp-4);
  border: 1px solid var(--line);
  transition: box-shadow var(--tr);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card.soft { background: var(--bg-2); }
.card.hero {
  background: linear-gradient(135deg, #fff, var(--brand-soft));
  border-color: var(--line-2);
}
.card.brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border: none;
}
.card.brand h1, .card.brand h2, .card.brand h3 { color: #fff; }

.page-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-4); flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.page-head h2 { margin: 0; }

/* ============================================================
   7) Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 18px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1.2;
  transition: all var(--tr);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn.primary    { background: var(--brand); }
.btn.secondary  { background: var(--brand-2); }
.btn.success    { background: var(--success); }
.btn.danger     { background: var(--danger); }
.btn.warning    { background: var(--warning); }
.btn.info       { background: var(--info); }
.btn.light      { background: #f3f4f6; color: #111827; border: 1px solid var(--line); }
.btn.light:hover { background: #fff; border-color: var(--brand-2); }
.btn.ghost      { background: transparent; color: var(--brand); border: 1px solid var(--brand-2); box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); }

.btn.sm { padding: 7px 12px; font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn.lg { padding: 14px 22px; font-size: var(--fs-md); border-radius: var(--radius); }
.btn.xl { padding: 20px 28px; font-size: var(--fs-lg); border-radius: var(--radius-lg); }
.btn.block { width: 100%; display: flex; }

.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-group .btn:last-child { border-radius: var(--radius) 0 0 var(--radius); }

/* ============================================================
   8) Form elements
   ============================================================ */
.label {
  display: block;
  font-size: var(--fs-sm);
  margin-bottom: 6px;
  color: #374151;
  font-weight: 700;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7dce2;
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: var(--fs-base);
  outline: none;
  transition: all var(--tr-fast);
  color: var(--text);
}
.textarea { min-height: 92px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(166,110,63,.12);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: #f9fafb; color: #9ca3af; cursor: not-allowed;
}
.input.error { border-color: var(--danger); }

.form-group { margin-bottom: var(--sp-4); }
.input-group { display: flex; gap: var(--sp-2); align-items: stretch; }
.input-group .input { flex: 1; }

/* Checkbox و Radio */
.check {
  display: inline-flex; align-items: center;
  gap: 8px; cursor: pointer;
  user-select: none;
}
.check input[type="checkbox"],
.check input[type="radio"] {
  width: 18px; height: 18px; accent-color: var(--brand);
}

/* Switch */
.switch {
  position: relative; display: inline-block;
  width: 48px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 13px;
  transition: background var(--tr-fast); cursor: pointer;
}
.switch .slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform var(--tr-fast);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* ============================================================
   9) Alerts
   ============================================================ */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
  border-right: 4px solid;
  font-weight: 600;
  display: flex; align-items: center; gap: var(--sp-2);
}
.alert.error, .alert.danger {
  background: var(--danger-bg); color: #912018;
  border-right-color: var(--danger);
}
.alert.success {
  background: var(--success-bg); color: #085d3a;
  border-right-color: var(--success);
}
.alert.warning {
  background: var(--warning-bg); color: #7a2e0e;
  border-right-color: var(--warning);
}
.alert.info {
  background: var(--info-bg); color: #1e3a8a;
  border-right-color: var(--info);
}

/* Toast (إشعار يظهر في الزاوية) */
.toast-container {
  position: fixed; top: 88px; left: 20px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  border-right: 4px solid var(--brand-2);
  min-width: 280px;
  animation: slideIn .3s ease-out;
}
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   10) Tables
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: var(--fs-sm);
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}
.table th {
  background: var(--bg-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--brand-dark);
  font-weight: 700;
  position: sticky; top: 0;
  white-space: nowrap;
}
.table tbody tr:hover { background: var(--brand-soft); }
.table tbody tr.selected { background: rgba(166,110,63,.08); }
.table .actions { display: flex; gap: 4px; justify-content: flex-start; flex-wrap: wrap; }

/* ============================================================
   11) Badges & Pills
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #f3f4f6;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.4;
}
.badge.success  { background: var(--success-bg); color: #085d3a; }
.badge.danger   { background: var(--danger-bg); color: #912018; }
.badge.warning  { background: var(--warning-bg); color: #7a2e0e; }
.badge.info     { background: var(--info-bg); color: #1e3a8a; }
.badge.brand    { background: var(--brand-soft); color: var(--brand); }

.pill {
  display: inline-block;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* Status dots */
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-left: 4px;
}
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(6,118,71,.18); animation: pulse 2s infinite; }
.status-dot.offline { background: #9ca3af; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(6,118,71,.4);} 50%{ box-shadow: 0 0 0 6px rgba(6,118,71,0);} }

/* ============================================================
   12) KPI & Stats
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.stat, .kpi-card {
  background: #fff;
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: transform var(--tr);
}
.stat:hover, .kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat::before, .kpi-card::before {
  content: ''; position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at top right, rgba(166,110,63,.08), transparent 70%);
}
.stat .label, .kpi-card .kpi-label {
  font-size: var(--fs-sm); color: var(--text-soft);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.stat .value, .kpi-card .kpi-value {
  font-size: var(--fs-3xl); font-weight: 800;
  color: var(--brand); line-height: 1;
}
.stat .trend { margin-top: 10px; font-size: var(--fs-xs); font-weight: 700; }
.stat .trend.up { color: var(--success); }
.stat .trend.down { color: var(--danger); }
.stat .icon {
  position: absolute; top: 16px; left: 16px;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }

/* ============================================================
   13) Modals
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--tr);
  padding: var(--sp-4);
}
.modal-backdrop.active { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(.95);
  transition: transform var(--tr);
}
.modal-backdrop.active .modal { transform: scale(1); }
.modal-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal-foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex; gap: var(--sp-2); justify-content: flex-start;
  background: var(--bg-2);
}
.modal-close {
  background: transparent; border: 0; font-size: 24px;
  color: var(--text-muted); cursor: pointer; line-height: 1;
}

/* ============================================================
   14) Responsive helpers
   ============================================================ */
@media (max-width: 640px) {
  .container { margin: 14px auto; padding: 0 10px; }
  .card { padding: var(--sp-4); border-radius: var(--radius); }
  .topbar { padding: 10px 14px; }
  .topbar .brand h1 { font-size: var(--fs-md); }
  h1 { font-size: var(--fs-xl); }
  h2 { font-size: var(--fs-lg); }
  .btn { padding: 10px 14px; }
  .nav { padding: 8px; border-radius: var(--radius); }
  .nav a { padding: 8px 12px; font-size: var(--fs-xs); }
  .table { font-size: var(--fs-xs); }
  .table th, .table td { padding: 8px; }
}

.hide-mobile { }
.hide-desktop { display: none !important; }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .hide-desktop { display: initial !important; }
}

/* ============================================================
   15) Utilities
   ============================================================ */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.p-0 { padding: 0; } .p-2 { padding: var(--sp-2); } .p-3 { padding: var(--sp-3); }
.p-4 { padding: var(--sp-4); } .p-5 { padding: var(--sp-5); }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: var(--radius-full); }
.shadow { box-shadow: var(--shadow); }
.border { border: 1px solid var(--line); }
.bg-white { background: #fff; }
.bg-soft { background: var(--bg-2); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(166,110,63,.25);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb, #f3f4f6, #e5e7eb);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   16) Print styles
   ============================================================ */
@media print {
  .topbar, .nav, .btn, .no-print, .toast-container { display: none !important; }
  body { background: #fff !important; color: #000; }
  .container { max-width: none; margin: 0; padding: 0; }
  .card { box-shadow: none; border: 0 !important; padding: 0 !important; margin: 0 !important; }
  .table th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; }
  .page-break { page-break-before: always; }
}

/* ============================================================
   17) موروث من النسخة القديمة (لتوافق الصفحات)
   ============================================================ */
.line-item {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  background: var(--bg-2);
  margin-bottom: var(--sp-3);
  transition: all var(--tr-fast);
}
.line-item:hover { border-color: var(--brand-2); background: #fff; }

.search-suggestions {
  position: absolute; inset-inline: 0; top: 100%;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  max-height: 260px; overflow: auto;
}
.search-suggestions button {
  display: block; width: 100%;
  padding: 12px 14px; border: 0; background: #fff;
  text-align: right; cursor: pointer; font-family: inherit;
  border-bottom: 1px solid var(--line);
}
.search-suggestions button:last-child { border-bottom: none; }
.search-suggestions button:hover { background: var(--brand-soft); }

.queue-big {
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--brand);
}

.toolbar { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.section-title { margin: 0 0 var(--sp-3); font-size: var(--fs-lg); color: var(--brand-dark); }
.section-divider { height: 1px; background: var(--line); margin: var(--sp-4) 0; }

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-3);
}

.stack-mobile { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
@media (max-width: 640px) { .stack-mobile { flex-direction: column; } }

.item-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
}
.item-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: all var(--tr);
}
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-2); }
.item-thumb {
  width: 100%; aspect-ratio: 1/1;
  border-radius: var(--radius);
  object-fit: cover; background: #f6f6f6;
}
.item-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.item-meta .meta-box { background: var(--bg-2); border-radius: var(--radius-sm); padding: 10px; }

.invoice-shell {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: var(--sp-4);
}
@media (max-width: 980px) { .invoice-shell { grid-template-columns: 1fr; } }
.sticky-card { position: sticky; top: 92px; }

.hero {
  background: linear-gradient(135deg, #fff, var(--brand-soft));
  border: 1px solid var(--line-2);
}

/* Queue specific leftovers */
.queue-hero {
  background: linear-gradient(135deg, #fff, var(--brand-soft));
  border: 1px solid var(--line-2);
}
.queue-panel {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.queue-list { display: grid; gap: 10px; }
.queue-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3);
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.queue-panels { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--sp-4); }
@media (max-width: 900px) { .queue-panels { grid-template-columns: 1fr; } }

.responsive-actions { display: flex; gap: 8px; flex-wrap: wrap; }
