/* Elite Management System - Theme */
:root {
  --primary: #C7BB28;
  --primary-dark: #a59c1f;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #152647;
  --sidebar-text: #cbd5e1;
  --sidebar-active: rgba(255, 255, 255, .08);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, .08);
  --radius: 3px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app { display: flex; min-height: 100vh; position: relative; }
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: margin-left .25s ease, width .25s ease;
}
.app.sidebar-collapsed .sidebar { margin-left: -240px; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 90;
}
.sidebar-backdrop.show { display: block; }
.sidebar .brand {
  padding: 0 16px;
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sidebar .brand img { width: 32px; height: 32px; border-radius: var(--radius); object-fit: cover; background: #fff; }
.sidebar .brand .name { color: #1f2937; font-weight: 700; font-size: 15px; }
.sidebar nav { padding: 8px 0; flex: 1; }
.sidebar .nav-section { border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar .nav-section:first-of-type { border-top: none; }
.sidebar .nav-group {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.sidebar .nav-group:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.sidebar .nav-group > span { display: flex; align-items: center; gap: 10px; }
.sidebar .nav-group .chev { transition: transform .2s; font-size: 11px; }
.sidebar .nav-section.collapsed .chev { transform: rotate(-90deg); }
.sidebar .nav-items {
  overflow: hidden;
  max-height: 1000px;
  transition: max-height .25s ease;
  padding-bottom: 6px;
}
.sidebar .nav-section.collapsed .nav-items { max-height: 0; padding-bottom: 0; }
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 28px;
  color: var(--sidebar-text);
  font-size: 13px;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar > nav > .nav-link { padding-left: 16px; }
.sidebar .nav-link i { width: 18px; font-size: 15px; }
.sidebar .nav-link:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; border-left-color: #C7BB28; font-weight: 600; }
.sidebar .user-box {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
  color: var(--sidebar-text);
}
.sidebar .user-box small { color: rgba(203, 213, 225, .65); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .page-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions .text-muted { color: var(--text-muted) !important; }
.topbar-actions .badge { background: var(--surface-alt); color: var(--text); }
.topbar-actions .topbar-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 15px;
  transition: background .15s, color .15s, border-color .15s;
}
.topbar-actions .topbar-icon:hover {
  background: #152647;
  color: #fff;
  border-color: #152647;
  text-decoration: none;
}
.btn-theme {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.btn-theme:hover { background: var(--border); text-decoration: none; }
.mobile-toggle { display: none; background: none; border: none; font-size: 22px; color: var(--text); cursor: pointer; }
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  width: 32px; height: 32px;
  font-size: 22px;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.sidebar-toggle:hover { color: #000; background: transparent; }
.content { padding: 22px; flex: 1; min-width: 0; }
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 10px 16px;
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.app-footer a { color: var(--text); font-weight: 700; text-decoration: none; }
.app-footer a:hover { color: #C7BB28; text-decoration: none; }

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--text); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards (3px radius requirement) */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-header { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.card-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-body { padding: 16px; }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: calc(2cm + 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  line-height: 1.4;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-info { background: var(--info); border-color: var(--info); color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 10px 18px; font-size: 15px; }
.w-100 { width: 100%; }

/* primary button readability on the gold colour */
.btn-primary { color: #1f2937; }
.btn-primary:hover { color: #1f2937; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table tbody tr:hover { background: var(--surface-alt); }
.table tbody tr:last-child td { border-bottom: none; }
.table thead th.text-end,
.table tbody td.text-end { text-align: right; }
.table thead th.text-center,
.table tbody td.text-center { text-align: center; }
.text-end { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Forms */
.form-control, .form-select, input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=datetime-local], input[type=tel], textarea, select {
  width: 100%;
  padding: 8px 11px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(199, 187, 40, .25);
}
.form-check-input { width: auto; margin-right: 6px; }
label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--text); }
.mb-3 { margin-bottom: 14px; }
.mt-3 { margin-top: 14px; }
.mb-2 { margin-bottom: 8px; }

/* Grid */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row > [class^="col-"] { padding: 0 8px; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
@media (max-width: 768px) {
  .col-3, .col-4, .col-6, .col-8 { flex: 0 0 100%; max-width: 100%; }
}

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-primary { background: var(--primary); }
.badge-success { background: var(--success); }
.badge-danger { background: var(--danger); }
.badge-warning { background: var(--warning); color: #1f2937; }
.badge-info { background: var(--info); }
.badge-secondary { background: var(--secondary); }

/* Alerts */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1px solid transparent;
  font-size: 13px;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-danger, .alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info { background: #cffafe; color: #155e75; border-color: #a5f3fc; }

/* Login page */
body.login-page {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .72), rgba(15, 23, 42, .55)),
    url('../img/1.jpg') center/cover no-repeat fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
}
.login-card .logo { text-align: center; margin-bottom: 14px; }
.login-card .logo img { max-width: 86px; max-height: 86px; border-radius: var(--radius); }
.login-card h1 { text-align: center; font-size: 21px; margin: 0 0 6px; color: var(--text); }
.login-card .btn { justify-content: center; }
.login-card .btn .btn-label { display: inline-flex; align-items: center; gap: 6px; }
.login-card .tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 22px;
}

/* Tablet & mobile sidebar */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    margin-left: -240px;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, .15);
  }
  .app.sidebar-open .sidebar { margin-left: 0; }
  .app.sidebar-collapsed .sidebar { margin-left: -240px; }
  .main { width: 100%; }
  .topbar { padding: 10px 14px; }
  .content { padding: 16px; }
  .topbar-actions .text-muted { display: none; }
}

@media (max-width: 576px) {
  .page-header h1 { font-size: 18px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card .value { font-size: 18px; }
  .topbar .page-title { font-size: 14px; }
  .topbar-actions .btn-theme span,
  .topbar-actions form .btn span { display: none; }
  .login-card { padding: 24px 18px; }
  .btn { padding: 6px 10px; font-size: 12px; }
}

/* Idle logout warning modal */
.idle-warning {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.idle-warning[hidden] { display: none; }
.idle-warning-card {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.idle-warning-card h3 { margin: 0 0 10px; font-size: 18px; color: var(--warning); }
.idle-warning-card p { margin: 0 0 18px; color: var(--text-muted); font-size: 13px; }
.idle-warning-card #idle-countdown { font-weight: 700; color: var(--danger); }

/* ── Receipt (80mm thermal-style, screen + print) ───────────── */
.receipt {
  width: 300px;
  margin: 18px auto;
  padding: 18px 16px 14px;
  background: #fff;
  color: #111;
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.receipt .r-header { text-align: center; padding-bottom: 8px; border-bottom: 1px solid #111; }
.receipt .biz-logo { display: block; margin: 0 auto 6px; max-width: 58px; max-height: 58px; width: auto; height: auto; }
.receipt .biz-name { font-size: 16px; font-weight: 800; letter-spacing: .3px; line-height: 1.2; }
.receipt .biz-meta { font-size: 11px; line-height: 1.35; margin-top: 2px; color: #333; }
.receipt .biz-meta div { word-wrap: break-word; }

.receipt .r-doctype {
  text-align: center;
  margin: 10px auto;
  padding: 4px 10px;
  display: inline-block;
  width: 100%;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 12px;
  background: #111;
  color: #fff;
  border-radius: 2px;
}

.receipt .r-meta { font-size: 11px; margin: 8px 0; }
.receipt .r-meta .row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 2px 0; border-bottom: 1px dotted #cbd5e1;
}
.receipt .r-meta .row:last-child { border-bottom: none; }
.receipt .r-meta .lbl { color: #475569; font-weight: 600; }
.receipt .r-meta .val { color: #111; text-align: right; font-variant-numeric: tabular-nums; }

.receipt .r-items { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.receipt .r-items thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #111;
  padding: 4px 2px;
  color: #111;
}
.receipt .r-items thead th.right { text-align: right; }
.receipt .r-items tbody td { padding: 4px 2px; border-bottom: 1px dashed #cbd5e1; vertical-align: top; }
.receipt .r-items tbody tr:last-child td { border-bottom: none; }
.receipt .r-items .right { text-align: right; }
.receipt .r-items .name { font-weight: 600; }

.receipt .r-totals { margin-top: 8px; border-top: 1px solid #111; padding-top: 6px; font-variant-numeric: tabular-nums; }
.receipt .r-totals .row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 2px 0;
}
.receipt .r-totals .row .lbl { color: #475569; }
.receipt .r-totals .row .val { font-weight: 600; }
.receipt .r-totals .grand {
  margin-top: 4px;
  padding: 8px 10px;
  background: #f1f5f9;
  border: 1px solid #111;
  border-radius: 3px;
  font-size: 14px;
}
.receipt .r-totals .grand .lbl { font-weight: 800; color: #111; letter-spacing: 1px; }
.receipt .r-totals .grand .val { font-weight: 800; color: #111; font-size: 16px; }

.receipt .r-thanks {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #111;
  text-align: center;
}
.receipt .r-thanks .msg { font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.receipt .r-thanks .sub { font-size: 10.5px; color: #475569; margin-top: 4px; font-style: italic; }
.receipt .r-thanks .ts { font-size: 10px; color: #64748b; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* Legacy helper classes still used in older templates */
.receipt .center { text-align: center; }
.receipt .right { text-align: right; }
.receipt .bold { font-weight: 700; }
.receipt hr { border: none; border-top: 1px dashed #94a3b8; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt table td { padding: 1px 2px; vertical-align: top; }
.receipt .footer { text-align: center; font-size: 10.5px; margin-top: 8px; color: #475569; font-style: italic; }

@media print {
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt {
    position: absolute; left: 0; top: 0;
    box-shadow: none; margin: 0; border: none; border-radius: 0;
    width: 80mm;
  }
  .no-print { display: none !important; }
}

/* -- Orders hub (Vitus /clinical style) ----------------------- */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.orders-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.orders-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.orders-card.accent-primary { border-left-color: var(--primary); }
.orders-card.accent-success { border-left-color: var(--success); }
.orders-card.accent-info    { border-left-color: var(--info); }
.orders-card.accent-warning { border-left-color: var(--warning); }
.orders-card.accent-danger  { border-left-color: var(--danger); }

.orders-card-head { display: flex; align-items: center; gap: 12px; }
.orders-card-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.orders-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  color: var(--primary);
  border-radius: var(--radius);
  font-size: 22px;
}
.orders-card.accent-success .orders-icon { color: var(--success); }
.orders-card.accent-info    .orders-icon { color: var(--info); }
.orders-card.accent-warning .orders-icon { color: var(--warning); }
.orders-card.accent-danger  .orders-icon { color: var(--danger); }

.orders-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.orders-card-manage {
  display: flex; gap: 8px; flex-wrap: wrap;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.orders-manage-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: var(--radius);
}
.orders-manage-link:hover { color: var(--primary); border-color: var(--primary); }

/* -- Permissions grid ----------------------------------------- */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 16px;
}
.perm-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.perm-row:hover { border-color: var(--primary); }
.perm-row .perm-toggle {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.perm-row .perm-label { font-size: 13px; color: var(--text); }
.perm-row .perm-code {
  grid-column: 2;
  font-size: 11px;
  color: var(--text-muted);
}
.perm-group .card-header h3 { font-size: 15px; margin: 0; }

/* -- Colourful dashboard stat cards (only when accent class set) -- */
.stat-card[class*="accent-"] { position: relative; overflow: hidden; color: #fff; border: none; }
.stat-card[class*="accent-"] .label { color: rgba(255, 255, 255, .85); }
.stat-card[class*="accent-"] .value { color: #fff; }
.stat-card[class*="accent-"] .sub { color: rgba(255, 255, 255, .8); font-size: 11px; margin-top: 4px; }
.stat-card[class*="accent-"] .icon {
  position: absolute;
  right: 14px; bottom: 10px;
  font-size: 46px;
  opacity: .25;
  color: #fff;
}
.stat-card.accent-primary { background: linear-gradient(135deg, #C7BB28, #a59c1f); }
.stat-card.accent-primary .label,
.stat-card.accent-primary .value { color: #1f2937; }
.stat-card.accent-primary .label { color: rgba(31, 41, 55, .75); }
.stat-card.accent-primary .icon  { color: #1f2937; opacity: .25; }
.stat-card.accent-success { background: linear-gradient(135deg, #10b981, #047857); }
.stat-card.accent-danger  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.stat-card.accent-warning { background: linear-gradient(135deg, #f59e0b, #b45309); }
.stat-card.accent-info    { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.stat-card.accent-purple  { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-card.accent-pink    { background: linear-gradient(135deg, #ec4899, #be185d); }
.stat-card.accent-teal    { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.stat-card.accent-slate   { background: linear-gradient(135deg, #475569, #1e293b); }

/* -- Button spinner ------------------------------------------ */
.btn[disabled], .btn.is-loading { opacity: .85; cursor: progress; }
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 6px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: elite-spin .7s linear infinite;
  vertical-align: -2px;
}
.btn-primary .btn-spinner {
  border-color: rgba(31, 41, 55, .25);
  border-top-color: #1f2937;
}
@keyframes elite-spin { to { transform: rotate(360deg); } }

/* topbar tweaks after removing theme switcher */
.topbar-actions .text-muted .badge-primary { color: #1f2937; }

/* -- Dashboard insight cards (Top Products + Business Value) -- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 320px;
}
.insight-card .insight-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.insight-card .insight-head h3 { margin: 0 0 2px 0; font-size: 17px; font-weight: 600; }
.insight-card .insight-pill {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-alt); color: var(--text-muted);
}
.insight-card.insight-products { border-top: 4px solid #C7BB28; }
.insight-card.insight-value    { border-top: 4px solid #10b981; }

/* Top products list */
.top-products { list-style: none; padding: 0; margin: 0; }
.top-products li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.top-products li:last-child { border-bottom: none; }
.tp-rank {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #C7BB28, #a59c1f);
  color: #1f2937; font-weight: 700; border-radius: 5px;
  font-size: 13px;
}
.top-products li:nth-child(2) .tp-rank { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.top-products li:nth-child(3) .tp-rank { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.top-products li:nth-child(n+4) .tp-rank { background: var(--surface-alt); color: var(--text-muted); }
.tp-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.tp-bar { height: 6px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.tp-bar span { display: block; height: 100%; background: linear-gradient(90deg, #C7BB28, #a59c1f); border-radius: 999px; }
.tp-meta { text-align: right; min-width: 110px; }
.tp-revenue { font-weight: 700; font-size: 14px; color: var(--text); }
.tp-qty { font-size: 11px; color: var(--text-muted); }

/* Business value */
.bv-total {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff; border-radius: 5px;
  padding: 18px 20px; margin-bottom: 14px;
}
.bv-label { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: .5px; }
.bv-amount { font-size: 28px; font-weight: 700; margin-top: 4px; }
.bv-rows { display: flex; flex-direction: column; gap: 10px; }
.bv-row {
  display: grid; grid-template-columns: 42px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 5px;
}
.bv-icon {
  width: 42px; height: 42px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.bv-icon.bg-amber { background: linear-gradient(135deg, #f59e0b, #b45309); }
.bv-icon.bg-green { background: linear-gradient(135deg, #10b981, #047857); }
.bv-row-label { font-weight: 600; font-size: 14px; }
.bv-row-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.bv-row-amount { font-weight: 700; font-size: 15px; }

/* -- Orders hub � bigger, colourful module cards --------------- */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.orders-card {
  background: var(--surface);
  border: none;
  border-radius: 5px;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 280px;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
  border-left: none !important;
}
.orders-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.orders-card .orders-card-head {
  padding: 22px 22px 18px;
  color: #fff;
  display: flex; align-items: center; gap: 14px;
}
.orders-card .orders-card-head h3 { margin: 0; font-size: 20px; font-weight: 700; color: #fff; }
.orders-card .orders-card-head .text-muted { color: rgba(255, 255, 255, .85) !important; font-size: 12px; }
.orders-card .orders-card-head .text-muted strong { color: #fff; font-size: 14px; }
.orders-card .orders-icon {
  width: 60px; height: 60px;
  background: rgba(255, 255, 255, .22);
  color: #fff !important;
  border-radius: 5px;
  font-size: 28px;
  flex-shrink: 0;
}
.orders-card .orders-card-actions {
  padding: 0 22px 14px;
  margin-top: -4px;
}
.orders-card .orders-card-actions .btn {
  background: rgba(255, 255, 255, .92);
  color: #1f2937;
  border: none;
  font-weight: 600;
}
.orders-card .orders-card-actions .btn:hover { background: #fff; }
.orders-card .orders-card-actions .btn.btn-primary {
  background: rgba(0, 0, 0, .25);
  color: #fff;
}
.orders-card .orders-card-actions .btn.btn-primary:hover { background: rgba(0, 0, 0, .4); }
.orders-card .orders-card-manage {
  margin-top: auto;
  background: var(--surface);
  padding: 12px 22px;
  border-top: none;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.orders-card .orders-manage-link {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 5px;
  text-decoration: none;
}
.orders-card .orders-manage-link:hover { color: var(--primary); border-color: var(--primary); }

/* Each module gets its own vibrant background */
.orders-card.accent-primary    { background: linear-gradient(135deg, #C7BB28, #a59c1f); }
.orders-card.accent-success    { background: linear-gradient(135deg, #10b981, #047857); }
.orders-card.accent-info       { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.orders-card.accent-warning    { background: linear-gradient(135deg, #f59e0b, #b45309); }
.orders-card.accent-danger     { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.orders-card.accent-purple     { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

/* Round corners standard */
:root { --radius: 5px; }

/* -- Topbar: business name + live clock ------------------------- */
.topbar { gap: 12px; }
.topbar-center {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
}
.topbar-business {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; color: var(--text);
  font-size: 22px;
  letter-spacing: .5px;
  padding: 4px 16px; border-radius: 5px;
  background: transparent;
  border: none;
  white-space: nowrap;
  text-transform: uppercase;
}
.topbar-business i { color: #C7BB28; }
.topbar-back {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 4px 10px;
}
.topbar-back:hover { background: var(--primary); color: #1f2937; border-color: var(--primary); }
.page-back {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.page-back:hover { background: var(--primary); color: #1f2937; border-color: var(--primary); text-decoration: none; }
.topbar-clock {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.topbar-clock i { font-size: 14px; }
.topbar-clock-sep { opacity: .4; }
.topbar-clock #tb-time {
  font-weight: 700; color: var(--text);
  letter-spacing: .5px;
}
@media (max-width: 992px) {
  .topbar-center { display: none; }
}

/* -- Change-due calculator panel ------------------------------- */
.change-calc-card { border-top: 4px solid #C7BB28; }
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.cc-cell {
  padding: 14px 16px; border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  text-align: center;
}
.cc-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: 6px;
}
.cc-value { font-size: 22px; font-weight: 700; color: var(--text); }
.cc-total   { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); }
.cc-paid    { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.cc-change  { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.cc-change .cc-value span { font-size: 24px; }
.cc-balance { background: linear-gradient(135deg, #fee2e2, #fecaca); }
.cc-balance .cc-value span { font-size: 24px; }

/* -- Dashboard welcome banner -------------------------------- */
.welcome-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 28px 22px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #D1CF5E 0%, #C7BB28 100%);
  color: #1f2937;
  box-shadow: 0 4px 14px rgba(199, 187, 40, .25);
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  pointer-events: none;
}
.welcome-banner::after {
  content: "";
  position: absolute;
  bottom: -60px; left: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .06);
  pointer-events: none;
}
.welcome-banner-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: #1f2937;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  z-index: 1;
}
.welcome-banner-text { z-index: 1; }
.welcome-banner-text h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #1f2937;
}
.welcome-banner-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(31, 41, 55, .75);
  display: inline-flex; align-items: center; gap: 6px;
}
@media (max-width: 600px) {
  .welcome-banner-text h1 { font-size: 22px; }
}

/* -- Dashboard date-range filter ------------------------------ */
.dash-filter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.dash-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dash-presets .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.dash-presets .chip:hover { background: var(--border); text-decoration: none; }
.dash-presets .chip.active {
  background: #C7BB28;
  border-color: #C7BB28;
  color: #1f2937;
}
.dash-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dash-range label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.dash-range input[type="date"] {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
@media (max-width: 700px) {
  .dash-filter-form { flex-direction: column; align-items: stretch; }
  .dash-range { justify-content: flex-start; }
}

/* added below by tool */

/* ── Empty-state welcome (user with no module perms) ──────────── */
.welcome-empty {
  max-width: 560px;
  margin: 60px auto;
  padding: 36px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.welcome-empty .we-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9;
  color: #152647;
  border-radius: 50%;
  font-size: 32px;
}
.welcome-empty h2 { font-size: 22px; margin: 0 0 8px; color: var(--text); }
.welcome-empty p { font-size: 14px; margin: 0; line-height: 1.55; }

/* ── Profile page ─────────────────────────────────────────────── */
.profile-page { max-width: 760px; margin: 18px auto; }
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.profile-cover {
  height: 110px;
  background: linear-gradient(135deg, #152647 0%, #1f3a6b 100%);
}
.profile-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 0 24px 18px;
  margin-top: -50px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.15);
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar .avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #152647;
  color: #fff;
  font-size: 42px;
  font-weight: 700;
}
.profile-id { flex: 1 1 240px; padding-bottom: 6px; }
.profile-id h1 { margin: 0; font-size: 22px; color: var(--text); }
.profile-role { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: #f1f5f9;
  color: #152647;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.role-badge.super { background: #fef3c7; color: #92400e; }
.role-badge.inactive { background: #fee2e2; color: #991b1b; }
.profile-actions { padding-bottom: 6px; }
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 24px 24px;
}
.info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.info-row:nth-last-child(-n+2) { border-bottom: none; }
.info-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #152647;
  border-radius: 50%;
  font-size: 16px;
  flex-shrink: 0;
}
.info-main { min-width: 0; }
.info-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.info-value { font-size: 14px; color: var(--text); font-weight: 500; word-break: break-word; }
@media (max-width: 600px) {
  .profile-grid { grid-template-columns: 1fr; }
  .info-row:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .info-row:last-child { border-bottom: none; }
  .profile-head { justify-content: center; text-align: center; }
  .profile-id { text-align: center; }
  .profile-role { justify-content: center; }
}
