/* ============================================================
 *  Dishtro Admin Panel — main.css
 *  File: /admin/assets/css/main.css
 *
 *  Theme reference: StarAdmin
 *  Primary:    #F29F67 (orange)
 *  Dark:       #1E1E2C
 *  Blue:       #3B8FF3
 *  Teal:       #34B1AA
 *  Yellow:     #E0B50F
 * ============================================================ */

/* ---------- 1. CSS variables ---------- */
:root {
  /* Brand */
  --primary:        #F29F67;
  --primary-soft:   #FFF1E6;
  --primary-dark:   #E68A4C;
  --dark:           #1E1E2C;
  --dark-soft:      #2A2A3C;

  /* Status colours */
  --blue:           #3B8FF3;
  --blue-soft:      #E6F1FE;
  --teal:           #34B1AA;
  --teal-soft:      #E1F5F3;
  --yellow:         #E0B50F;
  --yellow-soft:    #FBF5DC;
  --red:            #F5494F;
  --red-soft:       #FEE7E8;
  --green:          #2EBA85;
  --green-soft:     #E4F6EE;

  /* Surfaces */
  --bg:             #F4F5F7;
  --surface:        #FFFFFF;
  --border:         #E7E9EE;
  --border-strong:  #D5D8DF;

  /* Text */
  --text:           #1E1E2C;
  --text-mute:      #6E7383;
  --text-soft:      #9AA0B0;

  /* Sizing */
  --sidebar-w:      250px;
  --header-h:       79px;

  /* Misc */
  --shadow-sm:      0 1px 2px rgba(30, 30, 44, .04);
  --shadow:         0 2px 8px rgba(30, 30, 44, .06);
  --shadow-lg:      0 8px 28px rgba(30, 30, 44, .12);
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      18px;
}

/* ---------- 2. Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; color: var(--text); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* hide scrollbars but keep scrolling */
.scroll-hide::-webkit-scrollbar { width: 0; height: 0; }
.scroll-hide { scrollbar-width: none; }

/* ============================================================
 *  3. Layout shell: sidebar + main
 * ============================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  transition: transform .25s ease;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
  /* Hide scrollbar visually but keep scrolling functional */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge legacy */
}
.sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                /* Chrome / Safari / new Edge */
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand .logo {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(242, 159, 103, .35);
}
.sidebar-brand .brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
  line-height: 1;
}
.sidebar-brand .brand-name span { color: var(--primary); }
.sidebar-brand .brand-sub {
  font-size: 10px;
  color: var(--text-soft);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
}

.sidebar-section {
  padding: 20px 22px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: var(--text-soft);
  text-transform: uppercase;
}

.sidebar-menu {
  padding: 6px 12px 24px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  font-weight: 500;
  font-size: 14px;
  transition: background .15s, color .15s;
  position: relative;
}
.sidebar-link svg,
.sidebar-link .ico {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke-width: 2;
}
.sidebar-link:hover {
  background: var(--bg);
  color: var(--text);
}
.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px -4px rgba(242, 159, 103, .55);
}
.sidebar-link.active::before { display: none; }
.sidebar-link.active svg { color: #fff; }
.sidebar-link.active .badge { background: rgba(255,255,255,.25); color: #fff; }
.sidebar-link .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1;
}

/* ---------- Sidebar footer: user card + logout ---------- */
.sidebar-foot {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 12px;
  flex-shrink: 0;
}
.sidebar-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}
.sidebar-user:hover {
  background: var(--primary-soft);
  border-color: rgba(242, 159, 103, .3);
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(242, 159, 103, .3);
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .info small {
  font-size: 11px;
  color: var(--text-mute);
  display: block;
  margin-top: 1px;
}
.sidebar-logout {
  width: 44px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-mute);
  transition: all .15s;
}
.sidebar-logout:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(245, 73, 79, .3);
}

/* ---------- Mobile sidebar overlay ---------- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 44, .45);
  z-index: 45;
  opacity: 0;
  transition: opacity .25s;
}
.sidebar-backdrop.open { display: block; opacity: 1; }

/* ---------- Main area ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---------- Top header ---------- */
.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  align-items: center; justify-content: center;
  color: var(--text);
}
.topbar .menu-toggle:hover { background: var(--bg); }

.topbar-title {
  flex: 1;
  min-width: 0;
}
.topbar-title h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.2px;
}
.topbar-title h1 b { font-weight: 700; }
.topbar-title small {
  display: block;
  color: var(--text-mute);
  font-size: 13px;
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-mute);
  position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot {
  position: absolute;
  top: 9px; right: 11px;
  width: 8px; height: 8px;
  background: var(--red);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.topbar .avatar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  transition: background .15s;
}
.topbar .avatar-btn:hover { background: var(--bg); }
.topbar .avatar-btn .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}
.topbar .avatar-btn .who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.topbar .avatar-btn .who strong { font-size: 13px; }
.topbar .avatar-btn .who small { font-size: 11px; color: var(--text-mute); }
.topbar .avatar-btn .chev {
  width: 14px; height: 14px;
  color: var(--text-soft);
  margin-left: 2px;
}

/* ---------- Topbar live-stat pills ---------- */
.topbar-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  min-width: 0;
}
.ts-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-mute);
  white-space: nowrap;
  transition: all .15s;
  height: 38px;
}
.ts-pill:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 3px 10px rgba(242, 159, 103, .14);
}
.ts-pill .ts-ico {
  width: 14px; height: 14px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.ts-pill:hover .ts-ico { color: var(--primary-dark); }
.ts-pill strong {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.ts-pill .ts-label {
  font-size: 11.5px;
  color: var(--text-mute);
  font-weight: 500;
}
.ts-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 186, 133, .55);
  animation: livepulse 1.6s infinite;
  flex-shrink: 0;
}

/* ---------- Date pill ---------- */
.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.topbar-date svg { color: var(--text-mute); flex-shrink: 0; }

/* ---------- Count badge on icon-btn ---------- */
.icon-btn .count {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 17px; height: 17px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
  padding: 0 4px;
  line-height: 1;
}

/* ---------- Page header (inside content) ---------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.2;
}
.page-header h1 b { font-weight: 800; color: var(--primary-dark); }
.page-header small {
  display: block;
  color: var(--text-mute);
  font-size: 13.5px;
  margin-top: 5px;
}
.page-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ---------- Content area ---------- */
.content {
  flex: 1;
  padding: 28px;
  width: 100%;
  max-width: 1600px;
}

/* ============================================================
 *  4. Cards
 * ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card.card-dark {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.card.card-dark .card-title { color: #fff; }
.card.card-dark .card-sub { color: rgba(255,255,255,.6); }
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-header > div:first-child { min-width: 0; flex: 1; }
.card-title {
  font-size: 16px;
  font-weight: 600;
}
.card-sub {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 2px;
}
.card-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
 *  5. Stat cards (the row of metric tiles)
 * ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-mute);
  font-weight: 500;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.1;
  margin-top: 2px;
}
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.stat-change.up   { color: var(--teal); }
.stat-change.down { color: var(--red); }

/* ============================================================
 *  6. Buttons
 * ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, color .15s, border .15s, transform .05s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-dark {
  background: var(--dark);
  color: #fff;
}
.btn-dark:hover { background: var(--dark-soft); }

.btn-outline {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--text-mute);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============================================================
 *  7. Forms
 * ============================================================ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(242, 159, 103, .18);
}
.textarea { min-height: 90px; resize: vertical; }
.field-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
}

/* input with icon prefix (used on login) */
.input-icon {
  position: relative;
}
.input-icon svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-soft);
}
.input-icon .input { padding-left: 42px; }
.input-icon .toggle-pass {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--text-mute);
  display: grid; place-items: center;
}
.input-icon .toggle-pass:hover { background: var(--bg); }

/* ============================================================
 *  8. Tables
 * ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th, .table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table th {
  background: var(--bg);
  color: var(--text-mute);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(244, 245, 247, .55); }

/* ============================================================
 *  9. Badges / pills
 * ============================================================ */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.bp-blue   { background: var(--blue-soft);   color: var(--blue); }
.bp-teal   { background: var(--teal-soft);   color: var(--teal); }
.bp-green  { background: var(--green-soft);  color: var(--green); }
.bp-yellow { background: var(--yellow-soft); color: #B79309; }
.bp-orange { background: var(--primary-soft);color: var(--primary-dark); }
.bp-red    { background: var(--red-soft);    color: var(--red); }
.bp-grey   { background: var(--bg);          color: var(--text-mute); }

/* ============================================================
 * 10. Helpers / utilities
 * ============================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-mute  { color: var(--text-mute); }
.text-soft  { color: var(--text-soft); }
.text-sm    { font-size: 12.5px; }
.text-lg    { font-size: 16px; }
.text-xl    { font-size: 20px; font-weight: 700; }
.text-bold  { font-weight: 600; }
.text-right { text-align: right; }
.text-center{ text-align: center; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

/* ============================================================
 * 11. Skeleton (for AJAX loaders)
 * ============================================================ */
.skel {
  background: linear-gradient(90deg, #EEF0F4 0%, #F7F8FA 50%, #EEF0F4 100%);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.content-block   { display: none; }
.skeleton-block  { display: block; }
body.loaded .content-block  { display: block; }
body.loaded .skeleton-block { display: none; }

/* ============================================================
 * 12. Toasts
 * ============================================================ */
.toast-host {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-width: 380px;
  pointer-events: auto;
  animation: tin .2s ease-out;
}
.toast.ok    { background: var(--green); }
.toast.err   { background: var(--red); }
.toast.warn  { background: #B79309; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================================
 * 13. Modal / sheet (no native popups — per project rule)
 * ============================================================ */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 30, 44, .55);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  display: grid;
  place-items: center;
  padding: 20px;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform .2s ease;
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet h3 { font-size: 18px; margin-bottom: 6px; }
.sheet p  { color: var(--text-mute); font-size: 14px; }
.sheet-actions {
  display: flex; gap: 10px;
  margin-top: 22px;
}
.sheet-actions .btn { flex: 1; }

/* ============================================================
 * 14. KPI cards (with icon + trend pill)
 * ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: box-shadow .15s, transform .15s;
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.kpi-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.kpi-label {
  font-size: 12.5px;
  color: var(--text-mute);
  font-weight: 500;
}
.kpi-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-icon.k-orange { background: var(--primary-soft); color: var(--primary-dark); }
.kpi-icon.k-blue   { background: var(--blue-soft);    color: var(--blue); }
.kpi-icon.k-teal   { background: var(--teal-soft);    color: var(--teal); }
.kpi-icon.k-yellow { background: var(--yellow-soft);  color: #B79309; }
.kpi-icon.k-green  { background: var(--green-soft);   color: var(--green); }
.kpi-icon.k-red    { background: var(--red-soft);     color: var(--red); }

.kpi-value {
  font-size: 24px; font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.1;
}
.kpi-meta {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  white-space: nowrap;
}
.trend.up   { background: var(--teal-soft); color: var(--teal); }
.trend.down { background: var(--red-soft);  color: var(--red); }
.trend.flat { background: var(--bg);        color: var(--text-mute); }

/* ============================================================
 * 15. Period bar (segmented tabs + live pill)
 * ============================================================ */
.period-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.period-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.period-tabs a {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mute);
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.period-tabs a:hover { color: var(--text); }
.period-tabs a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(242, 159, 103, .35);
}

/* Live pulse */
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}
.live-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 186, 133, .6);
  animation: livepulse 1.6s infinite;
}
@keyframes livepulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 186, 133, .6); }
  70%  { box-shadow: 0 0 0 10px rgba(46, 186, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 186, 133, 0); }
}

/* ============================================================
 * 16. Hero dark card (big number + sparkline)
 * ============================================================ */
.hero-dark {
  background: linear-gradient(135deg, #1E1E2C 0%, #2A2A3C 80%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.hero-dark::after {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 65%);
  opacity: .18;
  pointer-events: none;
}
.hero-dark > * { position: relative; z-index: 1; }
.hero-dark .hd-label {
  color: rgba(255,255,255,.65);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.hero-dark .hd-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.5px;
  margin-top: 6px;
}
.hero-dark .hd-sub {
  color: rgba(255,255,255,.6);
  font-size: 12.5px;
  margin-top: 4px;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.hero-dark .hd-spark {
  margin-top: 14px;
  height: 70px;
  position: relative;
}

/* ============================================================
 * 17. Donut row (two side-by-side mini donuts)
 * ============================================================ */
.donut-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.donut-cell {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
}
.donut-mini {
  width: 64px; height: 64px;
  position: relative;
  flex-shrink: 0;
}
.donut-mini .donut-center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13.5px;
  color: var(--text);
}
.donut-cell .donut-text strong {
  display: block;
  font-size: 17px; font-weight: 700;
  line-height: 1.2;
}
.donut-cell .donut-text small {
  color: var(--text-mute);
  font-size: 12px;
}

/* ============================================================
 * 18. Live order feed
 * ============================================================ */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 10px;
  transition: background .15s;
  color: inherit;
}
.feed-item:hover { background: var(--bg); }
.feed-ico {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
}
.feed-body { flex: 1; min-width: 0; }
.feed-body strong {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  color: var(--text);
}
.feed-body small {
  color: var(--text-mute);
  font-size: 12px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-amt {
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--text);
}

/* ============================================================
 * 19. Leaderboard rows (top restaurants/customers)
 * ============================================================ */
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}
.lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-rank {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  background: var(--bg);
  color: var(--text-mute);
  flex-shrink: 0;
}
.lb-row:first-child .lb-rank { background: var(--primary);      color: #fff; }
.lb-row:nth-child(2) .lb-rank { background: var(--primary-soft); color: var(--primary-dark); }
.lb-row:nth-child(3) .lb-rank { background: var(--yellow-soft);  color: #B79309; }
.lb-info { flex: 1; min-width: 0; }
.lb-info strong {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.lb-info .lb-bar {
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  margin-top: 7px;
  overflow: hidden;
}
.lb-info .lb-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 3px;
  transition: width .6s ease;
}
.lb-num {
  text-align: right;
  flex-shrink: 0;
}
.lb-num strong { font-weight: 700; font-size: 14px; display: block; }
.lb-num small { font-weight: 500; color: var(--text-mute); font-size: 11.5px; }

/* ============================================================
 * 20. Pipeline strip (today's status breakdown)
 * ============================================================ */
.pipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.pipe-cell {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid transparent;
  transition: border-color .15s, transform .15s;
  cursor: default;
}
.pipe-cell:hover { transform: translateY(-1px); }
.pipe-cell .pipe-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin: 0 auto 8px;
}
.pipe-cell .pipe-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.3px;
}
.pipe-cell .pipe-name {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 6px;
  font-weight: 500;
}

/* ============================================================
 * 22. Filter chips (date presets, status pills, etc.)
 * ============================================================ */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  padding: 7px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-mute);
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: var(--surface); color: var(--text); }
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(242, 159, 103, .3);
}

/* ============================================================
 * 23. Order timeline (vertical stepper)
 * ============================================================ */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.tl-step {
  position: relative;
  padding: 4px 0 18px;
}
.tl-step:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -24px; top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  z-index: 1;
}
.tl-step.done .tl-dot {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.tl-step.current .tl-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  animation: livepulse 2s infinite;
}
.tl-step.cancel .tl-dot {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.tl-label { font-weight: 600; font-size: 14px; color: var(--text); }
.tl-time { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }
.tl-step.pending .tl-label { color: var(--text-soft); font-weight: 500; }
.tl-step.pending .tl-time { color: var(--text-soft); }

/* ============================================================
 * 24. Bill rows
 * ============================================================ */
.bill-list { display: flex; flex-direction: column; gap: 2px; }
.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text);
}
.bill-row span:first-child { color: var(--text-mute); }
.bill-row.discount span:last-child { color: var(--green); font-weight: 600; }
.bill-row.total {
  border-top: 2px dashed var(--border);
  margin-top: 6px;
  padding-top: 14px;
  font-size: 16px;
  font-weight: 700;
}
.bill-row.total span:first-child { color: var(--text); }

/* ============================================================
 * 25. Order item rows
 * ============================================================ */
.oi-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.oi-row:first-child { padding-top: 0; }
.oi-row:last-child { border-bottom: none; padding-bottom: 0; }
.oi-img {
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.oi-img.placeholder {
  display: grid; place-items: center;
  color: var(--text-soft);
  font-size: 22px;
}
.oi-meta { flex: 1; min-width: 0; }
.oi-meta strong {
  font-size: 14px; font-weight: 600;
  display: block;
}
.oi-meta small {
  color: var(--text-mute);
  font-size: 12.5px;
  margin-top: 3px;
  display: block;
}
.oi-qty {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 5px 11px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12.5px;
  flex-shrink: 0;
}
.oi-price {
  font-weight: 700;
  font-size: 14.5px;
  flex-shrink: 0;
  min-width: 80px;
  text-align: right;
}

/* ============================================================
 * 26. Info cards (compact side cards on details page)
 * ============================================================ */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.info-card + .info-card { margin-top: 16px; }
.info-card .ic-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.info-card .ic-label svg { color: var(--primary); }
.info-card .ic-value { font-size: 15px; font-weight: 600; line-height: 1.3; }
.info-card .ic-sub {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 4px;
  line-height: 1.4;
}
.info-card .ic-actions {
  display: flex; gap: 8px;
  margin-top: 12px;
}

/* ============================================================
 * 27. Pagination
 * ============================================================ */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pager-info { font-size: 13px; color: var(--text-mute); }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mute);
  text-decoration: none;
  transition: all .15s;
}
.pager-links a:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.pager-links .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pager-links .disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
 * 28. Empty state
 * ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
}
.empty-state .ic {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg);
  display: grid; place-items: center;
  margin: 0 auto 14px;
  color: var(--text-soft);
  font-size: 28px;
}
.empty-state h4 { font-size: 16px; color: var(--text); margin-bottom: 4px; }

/* ============================================================
 * 29. Order details — large status banner
 * ============================================================ */
.order-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.order-banner::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 65%);
}
.order-banner .ob-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1;
}
.order-banner .ob-sub {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  margin-top: 6px;
}
.order-banner .ob-status {
  background: rgba(255,255,255,.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.3);
  position: relative;
}
.order-banner.is-cancel { background: linear-gradient(135deg, var(--red), #C73237); }
.order-banner.is-done   { background: linear-gradient(135deg, var(--green), #1F9E6E); }

/* ============================================================
 * 30. Action row (sticky bottom bar on details page) - actually inline
 * ============================================================ */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
 * 31. OTP card pair (pickup + delivery)
 * ============================================================ */
.otp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.otp-card {
  background: linear-gradient(135deg, #FFF1E6, #FBF5DC);
  border: 1px solid rgba(242, 159, 103, .35);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.otp-card.delivery {
  background: linear-gradient(135deg, #E4F6EE, #E1F5F3);
  border-color: rgba(46, 186, 133, .3);
}
.otp-card.is-used {
  opacity: .5;
  filter: grayscale(.7);
}
.otp-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.otp-digits {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--primary-dark);
  margin: 6px 0 4px;
  line-height: 1.1;
}
.otp-card.delivery .otp-digits { color: #1F9E6E; }
.otp-hint { font-size: 11.5px; color: var(--text-mute); line-height: 1.4; }
.otp-card.is-pending {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
}
.otp-card.is-pending .otp-digits { color: var(--text-soft); font-size: 22px; letter-spacing: 4px; }

/* ============================================================
 * 32. Restaurant cover banner (in details info card)
 * ============================================================ */
.rest-cover {
  position: relative;
  height: 110px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg) center / cover no-repeat;
  margin: -8px -4px 14px;
}
.rest-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(30, 30, 44, .55));
}
.rest-cover .rest-logo-fab {
  position: absolute;
  bottom: 10px; left: 12px;
  width: 56px; height: 56px;
  border-radius: 12px;
  border: 3px solid #fff;
  background: var(--surface) center / cover no-repeat;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  z-index: 1;
}
.rest-cover .rest-rating {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,.96);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
  z-index: 1;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ============================================================
 * 33. Sortable table headers
 * ============================================================ */
.table th.sortable a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}
.table th.sortable a:hover { color: var(--text); }
.table th.sortable .sort-arrow {
  opacity: .35;
  font-size: 10px;
  transition: opacity .15s;
}
.table th.sortable.active .sort-arrow { opacity: 1; color: var(--primary); }

/* ============================================================
 * 34. Inline action icon buttons (in table rows)
 * ============================================================ */
.act-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}
.act-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-mute);
  display: inline-grid;
  place-items: center;
  transition: all .15s;
  cursor: pointer;
}
.act-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.act-btn.act-go     { background: var(--primary-soft); color: var(--primary-dark); border-color: rgba(242,159,103,.35); }
.act-btn.act-go:hover    { background: var(--primary); color: #fff; border-color: var(--primary); }
.act-btn.act-cancel { color: var(--red); }
.act-btn.act-cancel:hover { background: var(--red-soft); border-color: rgba(245,73,79,.35); }
.act-btn svg { width: 15px; height: 15px; }

/* ============================================================
 * 35. Date range filter card
 * ============================================================ */
.daterange {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.daterange .dr-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.daterange label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-mute);
}
.daterange input[type=date] {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}
.daterange input[type=date]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(242, 159, 103, .15);
}
.daterange .dr-sep { color: var(--text-soft); font-weight: 500; font-size: 12.5px; }

/* ============================================================
 * 36. Per-page selector
 * ============================================================ */
.pp-select {
  height: 32px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E7383' stroke-width='2' stroke-linecap='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  cursor: pointer;
}

/* ============================================================
 * 37. Customer review / rating card
 * ============================================================ */
.rating-stars {
  display: inline-flex;
  gap: 2px;
  font-size: 22px;
  line-height: 1;
}
.rating-stars .star { color: var(--border-strong); }
.rating-stars .star.filled { color: var(--yellow); }
.review-card {
  background: linear-gradient(135deg, #FBF5DC, #FFF8E1);
  border: 1px solid rgba(224, 181, 15, .3);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.review-card .rc-head {
  display: flex; align-items: center;
  gap: 12px; margin-bottom: 10px;
}
.review-card .rc-rating-num {
  font-size: 22px; font-weight: 800;
  color: #B79309;
  line-height: 1;
}
.review-card .rc-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-top: 8px;
  font-style: italic;
}
.review-card .rc-text::before { content: '"'; }
.review-card .rc-text::after  { content: '"'; }
.review-card .rc-meta {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Customer note callout */
.note-callout {
  background: linear-gradient(135deg, #FFF1E6, #FFF8F0);
  border: 1px solid rgba(242, 159, 103, .3);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}
.note-callout strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

/* ============================================================
 * 38. AJAX table loader overlay
 * ============================================================ */
.tbl-wrap-rel { position: relative; min-height: 200px; }
.tbl-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius);
}
.tbl-loading.show { display: flex; }
.tbl-loading .spinner {
  width: 38px; height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
 * 39. Payment combo pill (method + status in one)
 * ============================================================ */
.pay-combo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}
.pay-combo .pc-method {
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  opacity: .82;
}
.pay-combo .pc-sep { opacity: .4; font-weight: 400; }
.pay-combo .pc-status { font-weight: 700; }

.pay-combo.pc-paid     { background: var(--green-soft);  color: var(--green); }
.pay-combo.pc-pending  { background: var(--yellow-soft); color: #B79309; }
.pay-combo.pc-failed   { background: var(--red-soft);    color: var(--red); }
.pay-combo.pc-refunded { background: var(--bg);          color: var(--text-mute); }

/* ============================================================
 * 40. Proof photo grid + lightbox
 * ============================================================ */
.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.proof-tile {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
}
.proof-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.proof-head .pt-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text);
}
.proof-head .pt-by {
  font-size: 10.5px;
  color: var(--text-mute);
}
.proof-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition: border-color .15s;
}
.proof-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .25s;
}
.proof-thumb:hover { border-color: var(--primary); border-style: solid; }
.proof-thumb:hover img { transform: scale(1.04); }
.proof-thumb.empty {
  border-style: dashed;
  cursor: default;
  color: var(--text-soft);
  font-size: 12px;
  text-align: center;
  padding: 18px 10px;
}
.proof-thumb .pt-zoom {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(30, 30, 44, .7);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.proof-thumb.empty .pt-zoom { display: none; }
.proof-foot {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-mute);
  text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 22px;
  border: none;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .25); }
.lightbox-caption {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
 * 42. Live Tracking module
 * ============================================================ */
.lt-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}

/* Google Maps InfoWindow tweaks */
.gm-style .gm-style-iw-c {
  border-radius: 10px !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.12) !important;
  padding: 10px 14px !important;
  font-family: inherit !important;
}
.gm-style .gm-style-iw-d {
  overflow: visible !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}
.gm-style .gm-style-iw-tc::after {
  background: #fff !important;
}
/* Hide the close button on InfoWindow (cleaner) */
.gm-style .gm-ui-hover-effect { display: none !important; }

/* ============================================================
 * 43. Responsive
 * ============================================================ */@media (max-width: 1100px) {
  /* Hide third pill on medium screens so the row stays clean */
  .ts-pill.ts-riders { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .menu-toggle { display: grid; }

  .content { padding: 20px 16px; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .topbar { padding: 0 16px; gap: 12px; }
  .topbar-stats { display: none; }
  .topbar-date { display: none; }
  .topbar .avatar-btn .who { display: none; }
  .topbar .avatar-btn .chev { display: none; }

  .page-header h1 { font-size: 20px; }
  .page-header small { font-size: 12.5px; }
}

@media (max-width: 480px) {
  .content { padding: 16px 12px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px 14px 12px; gap: 2px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 20px; letter-spacing: -.3px; }
  .stat-change { font-size: 11px; }

  /* KPI cards — 2 per row on phones */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-head { margin-bottom: 10px; }
  .kpi-icon { width: 32px; height: 32px; border-radius: 9px; }
  .kpi-icon svg { width: 15px; height: 15px; }
  .kpi-label { font-size: 11.5px; }
  .kpi-value { font-size: 19px; }
  .kpi-meta { font-size: 11px; margin-top: 6px; }

  /* Donut row stacks on phones */
  .donut-row { grid-template-columns: 1fr; gap: 8px; }
  .donut-mini { width: 56px; height: 56px; }
  .donut-mini .donut-center { font-size: 12px; }

  /* Hero dark slightly smaller */
  .hero-dark { padding: 20px; }
  .hero-dark .hd-value { font-size: 26px; }
  .hero-dark .hd-spark { height: 60px; }

  /* Period tabs scroll-x if needed */
  .period-tabs { width: 100%; overflow-x: auto; }
  .period-tabs a { padding: 7px 12px; font-size: 12.5px; }
  .live-pill { padding: 6px 12px; font-size: 11.5px; }

  /* Pipeline 3-col on phones */
  .pipe-grid { grid-template-columns: repeat(3, 1fr); }
  .pipe-cell { padding: 12px 8px; }
  .pipe-cell .pipe-num { font-size: 18px; }

  /* Feed item tighter */
  .feed-item { padding: 10px; gap: 10px; }
  .feed-ico { width: 34px; height: 34px; font-size: 12px; }

  /* Card padding */
  .card { padding: 18px 16px; border-radius: 14px; }
  .card-header { margin-bottom: 14px; gap: 10px; }
  .card-title { font-size: 15px; }
  .card-sub { font-size: 12.5px; }

  .icon-btn { width: 38px; height: 38px; }

  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title small { display: none; }
  .topbar .menu-toggle { width: 38px; height: 38px; }
  .topbar-actions { gap: 4px; }

  .btn-sm { padding: 6px 10px; font-size: 12.5px; }

  .card canvas { max-height: 220px; }
  .card-dark .flex.flex-col { gap: 10px !important; }

  /* Order details */
  .order-banner { padding: 18px 20px; }
  .order-banner .ob-num { font-size: 18px; }
  .pager { padding: 14px 16px; flex-direction: column; }
  .oi-img { width: 48px; height: 48px; }
  .oi-row { gap: 10px; }
  .timeline { padding-left: 24px; }

  /* OTP cards stack on phones */
  .otp-grid { grid-template-columns: 1fr; gap: 10px; }
  .otp-digits { font-size: 28px; letter-spacing: 6px; }

  /* Proof grid stacks on phones */
  .proof-grid { grid-template-columns: 1fr; }

  /* Live tracking layout: stack and shrink map */
  .lt-grid { grid-template-columns: 1fr; }
  #liveMap, #orderMap { height: 380px !important; }

  /* Date range stacks on small */
  .daterange { padding: 10px 12px; }
  .daterange .dr-group { flex: 1; min-width: 0; }
  .daterange input[type=date] { width: 100%; }
}

/* ============================================================
 *  Stackable table — turn rows into mobile cards
 *  Usage:
 *    <table class="table table-stack">…
 *    <td data-label="Customer">…
 *    First td gets class "td-hero" (no label, larger font)
 * ============================================================ */
@media (max-width: 600px) {
  .table-stack thead { display: none; }
  .table-stack,
  .table-stack tbody,
  .table-stack tr,
  .table-stack td {
    display: block;
    width: 100%;
  }
  .table-stack tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }
  .table-stack tr:last-child { border-bottom: none; }
  .table-stack tr:hover td   { background: transparent; }

  .table-stack td {
    padding: 5px 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    min-height: 24px;
  }
  .table-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-mute);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    flex-shrink: 0;
  }
  .table-stack td:empty::before,
  .table-stack td.td-hero::before { content: none; }

  /* First column (e.g. order number) — hero row */
  .table-stack td.td-hero {
    justify-content: flex-start;
    font-size: 15px;
    font-weight: 600;
    padding: 0 0 8px;
    margin-bottom: 6px;
    border-bottom: 1px dashed var(--border);
  }

  /* Right-aligned content (amounts, badges) stays right-aligned */
  .table-stack td.text-right { justify-content: space-between; }
}