@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap");

/* ==========================================================================
   GlidR Admin — Design System
   Premium enterprise SaaS dashboard. All visual styling lives here so it
   applies uniformly across every screen without editing each HTML file.
   ========================================================================== */

:root {
  /* Brand */
  --color-primary: #d89b18;
  --color-primary-hover: #bf860f;
  --color-primary-active: #a37210;
  --color-primary-light: #fdf6e7;
  --color-primary-border: #f3e2b8;

  /* Surfaces */
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-alt: #fafbfc;
  --color-border: #e8e8e8;
  --color-border-strong: #d6d9de;

  /* Type */
  --color-text: #222222;
  --color-text-muted: #6f7684;
  --color-text-faint: #9aa1ae;

  /* Sidebar (dark) */
  --sidebar-bg: #161a20;
  --sidebar-bg-alt: #1d222a;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-text: #9aa2b1;
  --sidebar-text-strong: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-group: #5f6773;

  /* Semantic */
  --color-success: #15803d;
  --color-success-bg: #e8f6ed;
  --color-success-border: #c3e6d1;
  --color-warning: #b45309;
  --color-warning-bg: #fef6e7;
  --color-warning-border: #f7e0b5;
  --color-danger: #b91c1c;
  --color-danger-bg: #fdecec;
  --color-danger-border: #f6cfcf;
  --color-info: #1d4ed8;
  --color-info-bg: #eef2ff;
  --color-info-border: #d3dcfb;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 3px rgba(22, 26, 32, 0.05);
  --shadow-sm: 0 2px 10px rgba(22, 26, 32, 0.07);
  --shadow-md: 0 6px 20px rgba(22, 26, 32, 0.09);
  --shadow-lg: 0 14px 36px rgba(22, 26, 32, 0.14);

  /* Layout */
  --sidebar-w: 248px;
  --header-h: 64px;
  --content-pad: 26px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 170ms;

  --font-sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

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

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 0 0 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 0 20px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--sidebar-border);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sidebar-text-strong);
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.sidebar-logo a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), #eab543);
  color: #161a20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(216, 155, 24, 0.35);
}

.brand-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--sidebar-group);
  margin-top: -3px;
}

/* Nav groups — icon chip + solid active pill (reference pattern) */

.nav-section {
  border: 0;
  margin: 1px 10px;
}

.nav-section:last-child {
  border: 0;
}

.nav-section > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  border-radius: var(--radius-md);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  user-select: none;
}

.nav-section > summary::-webkit-details-marker {
  display: none;
}

.nav-section > summary:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}

/* chevron */
.nav-section > summary::after {
  content: "";
  width: 5.5px;
  height: 5.5px;
  margin-left: auto;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.4;
  transition: transform var(--dur) var(--ease);
}

.nav-section[open] > summary::after {
  transform: rotate(45deg);
}

/* icon chip */
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.nav-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.nav-section > summary:hover .nav-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ACTIVE: solid pill, inverted icon chip */
.nav-section.active > summary {
  background: var(--color-primary);
  color: #17130a;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(216, 155, 24, 0.32);
}

.nav-section.active > summary::after {
  opacity: 0.65;
}

.nav-section.active > summary .nav-icon {
  background: #17130a;
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

/* Sub-items */

.nav-subitems {
  list-style: none;
  margin: 2px 0 8px;
  padding: 0 0 0 14px;
  position: relative;
  animation: navIn var(--dur) var(--ease);
}

.nav-subitems::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: rgba(255, 255, 255, 0.09);
}

@keyframes navIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.nav-subitems li a {
  display: block;
  padding: 7px 10px 7px 22px;
  margin-left: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 12.75px;
  font-weight: 400;
  line-height: 1.45;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-subitems li a:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}

.nav-subitems li a.current {
  background: rgba(255, 255, 255, 0.96);
  color: #17130a;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

/* Sidebar group label */

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  padding: 16px 22px 6px;
  margin: 0;
}

/* ==========================================================================
   Main column + sticky topbar
   ========================================================================== */

.main-column {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--content-pad);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 38px;
  width: 380px;
  max-width: 40vw;
  color: var(--color-text-faint);
  background: var(--color-bg);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.header-search:focus-within {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

.header-search svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 2;
}

.search-input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text);
}

.search-input::placeholder {
  color: var(--color-text-faint);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-admin-name {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 38px;
  font-weight: 600;
  font-size: 13px;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.header-admin-name:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-xs);
}

.header-notifications {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.header-notifications:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}

.header-notifications svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

/* notification count pill sits on the bell */
.header-notifications .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10.5px;
  border-radius: var(--radius-pill);
  justify-content: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.icon-btn:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #eab543);
  color: #161a20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

/* ==========================================================================
   Content area
   ========================================================================== */

.main-content {
  flex-grow: 1;
  padding: var(--content-pad);
  max-width: 1600px;
  width: 100%;
}

/* Breadcrumb */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb .sep {
  color: var(--color-text-faint);
  opacity: 0.7;
}

.breadcrumb .crumb-current {
  color: var(--color-text);
  font-weight: 600;
}

/* Page header */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-head-text {
  min-width: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Legacy .screen-title, restyled as a flat page title (no card chrome) */

.screen-title {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 22px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--color-text);
}

.page-head .screen-title {
  margin-bottom: 0;
}

.screen-subtitle {
  display: block;
  margin-top: 5px;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 38px;
  background: var(--color-primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 2px 8px rgba(216, 155, 24, 0.3);
}

.btn:active {
  background: var(--color-primary-active);
  transform: translateY(1px);
  box-shadow: none;
}

.btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #9e1717;
  border-color: #9e1717;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.28);
}

.btn-info {
  background: var(--color-info);
  border-color: var(--color-info);
  color: #ffffff;
}

.btn-info:hover {
  background: #1e40af;
  border-color: #1e40af;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.28);
}

.btn-success {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #ffffff;
}

.btn-success:hover {
  background: #166534;
  border-color: #166534;
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.28);
}

.btn-warning {
  background: var(--color-warning);
  border-color: var(--color-warning);
  color: #ffffff;
}

.btn-warning:hover {
  background: #92400e;
  border-color: #92400e;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.28);
}

.btn-yellow {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.btn-yellow:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 2px 8px rgba(216, 155, 24, 0.35);
}

.btn-yellow-outline {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: #8a5a00;
}

.btn-yellow-outline:hover {
  background: #faecc2;
  border-color: var(--color-primary-hover);
  color: #704800;
  box-shadow: 0 2px 8px rgba(216, 155, 24, 0.2);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  background: var(--color-bg);
  border-color: transparent;
  color: var(--color-text);
  box-shadow: none;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* ==========================================================================
   Toolbar / filters
   ========================================================================== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

/* :not(.ts-wrapper) matters here: Tom Select (panel.js initGlidrSelects)
   copies the source <select>'s classList -- including "field" -- onto the
   wrapper <div> it generates. Without the exclusion, this bare ".toolbar
   .field" descendant selector matches that wrapper too, drawing a SECOND
   1px border/radius around the one ".ts-wrapper.single .ts-control" already
   draws for the visible control -- the "extra border" around toolbar
   selects on Refund Management, Onboarding Queue, etc. */
.toolbar .field:not(.ts-wrapper),
input.field,
select.field {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 13px;
  height: 38px;
  min-width: 170px;
  background: var(--color-surface);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.toolbar .field::placeholder {
  color: var(--color-text-faint);
}

.toolbar .field:not(.ts-wrapper):focus,
input.field:focus,
select.field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

/* non-input .field divs keep their box look */
div.toolbar > div.field {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
}

.toolbar-spacer {
  margin-left: auto;
}

/* ==========================================================================
   Panels / cards
   ========================================================================== */

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: box-shadow var(--dur) var(--ease);
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.panel-title svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: var(--color-text-muted);
}

/* a panel whose body is only a table gets tighter padding */
.panel > table.data-table:last-child {
  margin-bottom: 0;
}

.placeholder-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  min-height: 112px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.6;
  background: var(--color-surface-alt);
}

.placeholder-box svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.6;
  color: var(--color-text-faint);
  margin-bottom: 2px;
}

/* a note/callout inside a panel — not a missing-content placeholder */
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  padding: 13px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 18px;
}

.note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-primary-active);
}

.note.note-warn {
  border-left-color: var(--color-warning);
  background: var(--color-warning-bg);
}
.note.note-warn svg {
  color: var(--color-warning);
}

/* ==========================================================================
   Layout utilities
   ========================================================================== */

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-2 > .panel,
.grid-3 > .panel,
.grid-4 > .panel {
  margin-bottom: 0;
}

.split-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.split-main > .panel {
  margin-bottom: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

/* Author `display:flex` on .form-field overrides the [hidden] attribute in some browsers. */
.form-field.stock-qty-field-wrap[hidden],
.form-field.stock-qty-field-wrap.is-collapsed,
.form-field.form-field-pink-ride[hidden],
.form-field.form-field-pink-ride.is-collapsed {
  display: none !important;
}

.form-field a,
.form-field p {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form-field input[type="file"] {
  max-width: 100%;
}

.user-avatar-preview {
  margin-bottom: 16px;
}

.user-avatar-preview img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.customer-profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.customer-profile-preview {
  flex: 0 0 auto;
}

.customer-profile-image {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  display: block;
}

.customer-profile-empty {
  width: 160px;
  height: 160px;
  min-height: 0;
}

.customer-profile-upload {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  max-width: 520px;
  margin-top: 0;
}

.customer-profile-upload input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.form-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.form-action-row .btn,
.form-action-row .btn-secondary,
.form-action-row .btn-danger {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  line-height: 1;
  margin: 0;
}


.restaurant-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.restaurant-media-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.restaurant-media-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.restaurant-media-preview {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  box-shadow: var(--shadow-xs);
}

.restaurant-media-preview.is-logo {
  width: 120px;
  height: 120px;
  object-fit: cover;
}

.restaurant-media-preview.is-banner,
.restaurant-media-preview.is-license {
  max-width: 100%;
  height: 140px;
  object-fit: cover;
}

.restaurant-media-doc {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
}

.form-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
}

.form-field select,
.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  min-height: 38px;
  background: var(--color-surface);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.form-field input[type="checkbox"],
.form-field input[type="radio"],
.checkbox-label input[type="checkbox"],
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  background: var(--color-surface);
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-field-checkbox {
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  padding-top: 2px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  margin: 0;
}

.form-field-checkbox .checkbox-label {
  width: 100%;
}

.form-field-checkbox .checkbox-label span {
  line-height: 1.35;
}

.modal-body .form-grid {
  margin-bottom: 0;
  align-items: start;
}

dialog.modal.modal-sm .modal-body .form-grid,
.modal-body .form-grid.form-grid-single {
  grid-template-columns: 1fr;
}

.modal-body .form-field-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-field select:focus,
.form-field input:not([type="checkbox"]):not([type="radio"]):focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
}

/* Custom web fonts break native date/time segment placeholders (shows
   "dd----yyyy" instead of "dd-mm-yyyy") — use the system UI font instead. */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
.form-field input[type="date"],
.form-field input[type="time"],
.form-field input[type="datetime-local"],
input.field[type="date"],
input.field[type="time"],
input.field[type="datetime-local"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: normal;
}

.form-field input[type="date"]::-webkit-datetime-edit,
.form-field input[type="time"]::-webkit-datetime-edit,
input.field[type="date"]::-webkit-datetime-edit,
input.field[type="time"]::-webkit-datetime-edit {
  padding: 0;
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Tables
   ========================================================================== */

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
}

/* tables sitting inside a panel are already on a card */
.panel table.data-table {
  border-radius: var(--radius-md);
  box-shadow: none;
}

table.data-table th,
table.data-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 11px 16px;
  text-align: left;
  vertical-align: middle;
}

table.data-table th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  background: var(--color-surface-alt);
  white-space: nowrap;
}

/* Sticky headers are opt-in: wrap a long table in .table-scroll. Making them
   sticky by default collides with the rounded-corner `overflow:hidden` and
   paints the header over the first row. */
.table-scroll {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.table-scroll table.data-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}

.table-scroll table.data-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: inset 0 -1px 0 var(--color-border);
}

/* first data column carries the identity of the row */
table.data-table tbody td:first-of-type,
table.data-table tbody td.select-cell + td {
  color: var(--color-text);
  font-weight: 600;
}

table.data-table tbody tr {
  transition: background var(--dur) var(--ease);
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover td {
  background: var(--color-primary-light);
}

table.data-table td strong {
  font-weight: 600;
  color: var(--color-text);
}

table.data-table td.toggle-cell,
table.data-table th.toggle-cell {
  text-align: center;
}

/* selection + action columns */
th.select-cell,
td.select-cell {
  width: 44px;
  padding-right: 0;
  text-align: center;
}

/* Actions column: header and row controls share one right-aligned column width. */
table.data-table th.action-cell,
table.data-table td.action-cell {
  text-align: right;
  vertical-align: middle;
  width: 1%;
  min-width: 220px;
  white-space: nowrap;
}

/* Even spacing between Edit / toggle / Delete controls in every admin table. */
table.data-table td.action-cell > * + * {
  margin-left: 6px;
}

table.data-table td.action-cell > .btn,
table.data-table td.action-cell > button.btn,
table.data-table td.action-cell > a.btn,
table.data-table td.action-cell form,
table.data-table td.action-cell form .btn {
  margin-top: 0;
  margin-bottom: 0;
  vertical-align: middle;
}

table.data-table td.action-cell form {
  display: inline-flex;
}

table.data-table td.action-cell .table-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

table.data-table td.action-cell .table-row-actions > * {
  margin: 0;
}

table.data-table td.action-cell.campaign-review-cell {
  min-width: 240px;
  white-space: normal;
}

/* Cab vehicle master lists: keep View / Edit / toggle / Delete on one row. */
table.data-table.cab-master-table th.action-cell,
table.data-table.cab-master-table td.action-cell {
  min-width: 380px;
  white-space: nowrap;
}

table.data-table.cab-master-table td.action-cell .table-row-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

table.data-table.cab-master-table td.action-cell .table-row-actions form {
  display: inline-flex;
  margin: 0;
}

table.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--color-primary);
  cursor: pointer;
  vertical-align: middle;
}

/* sortable header affordance */
th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 4.5px solid currentColor;
  opacity: 0.32;
  vertical-align: middle;
}

th.sortable:hover::after {
  opacity: 0.7;
}

th.sortable a {
  color: inherit;
  text-decoration: none;
}

th.sortable.is-sorted.sort-desc::after,
th.sortable.is-sorted.sort-asc::after {
  opacity: 1;
}

th.sortable.is-sorted.sort-asc::after {
  transform: rotate(180deg);
}

[data-table-url].is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

/* row action menu trigger */
.row-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.row-menu:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.row-menu svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

/* link-style table actions */
table.data-table td a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

table.data-table td a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

table.data-table td a.btn {
  text-decoration: none;
}

table.data-table td a.btn,
table.data-table td a.btn:hover {
  color: #ffffff;
}

table.data-table td a.btn.btn-secondary,
table.data-table td a.btn.btn-secondary:hover {
  color: var(--color-text);
}

table.data-table td a.btn.btn-danger,
table.data-table td a.btn.btn-danger:hover,
table.data-table td a.btn.btn-info,
table.data-table td a.btn.btn-info:hover,
table.data-table td a.btn.btn-success,
table.data-table td a.btn.btn-success:hover,
table.data-table td a.btn.btn-warning,
table.data-table td a.btn.btn-warning:hover,
table.data-table td a.btn.btn-yellow,
table.data-table td a.btn.btn-yellow:hover,
table.data-table td a.btn:not(.btn-secondary):not(.btn-ghost):not(.btn-yellow-outline),
table.data-table td a.btn:not(.btn-secondary):not(.btn-ghost):not(.btn-yellow-outline):hover {
  color: #ffffff;
}

table.data-table td a.btn.btn-yellow-outline,
table.data-table td a.btn.btn-yellow-outline:hover {
  color: #8a5a00;
}

/* Bulk action bar */

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: -8px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  font-size: 13px;
  color: var(--color-text);
}

.bulk-bar .count {
  font-weight: 700;
}

/* Pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* inside a table card it reads as a footer, not an orphaned line */
.table-wrap > .pagination {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

/* the table above a footer must not draw its own bottom edge */
.table-wrap:has(> .pagination) > table.data-table {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.table-wrap:has(> .pagination) {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-wrap:has(> .pagination) > table.data-table {
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  box-shadow: none;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.page-btn:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.page-btn.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
}

.tab-bar .tab {
  padding: 11px 16px;
  color: var(--color-text-muted);
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.tab-bar .tab:hover {
  color: var(--color-text);
}

.tab-bar .tab.active {
  font-weight: 600;
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* vertical tabs (detail pages / settings) */

.tab-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-side a {
  padding: 9px 13px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.tab-side a:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.tab-side a.active {
  background: var(--color-primary-light);
  color: var(--color-primary-active);
  font-weight: 600;
}

/* ==========================================================================
   KPI / stat cards
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

a.kpi-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.kpi-card-link.is-active,
a.kpi-card-link:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

.status-module-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* ==========================================================================
   Status tabs — compact chip row for status-filter counts (e.g. Food Orders
   "All / Placed / Accepted / …"). Deliberately NOT a .kpi-card: those are
   sized for a handful of headline dashboard numbers, not 8+ filter states,
   and blew up into oversized, unevenly-wrapping boxes here.
   ========================================================================== */

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.status-tab:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.status-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

.status-tab .status-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.status-tab.is-active {
  background: var(--color-primary-light);
  border-color: var(--color-primary-border);
  color: var(--color-primary-active);
}

.status-tab.is-active .status-tab-count {
  background: var(--color-primary);
  color: #fff;
}

@media (max-width: 640px) {
  .status-tabs {
    gap: 6px;
  }

  .status-tab {
    padding: 7px 11px;
    font-size: 12.5px;
  }
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.kpi-label svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  color: var(--color-primary);
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.kpi-meta.up {
  color: var(--color-success);
}

.kpi-meta.down {
  color: var(--color-danger);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-success,
.status-active,
.status-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-warning,
.status-idle,
.status-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-danger,
.status-urgent,
.status-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

.badge-neutral {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 10px;
  width: 2px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
}

.timeline li {
  position: relative;
  padding: 0 0 22px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
}

.timeline li.done::before {
  background: var(--color-success);
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-bg);
}

.timeline li.current::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.timeline .tl-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-text);
}

.timeline .tl-meta {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Activity feed */

.activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.activity li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity .act-body {
  min-width: 0;
  font-size: 13.5px;
}

.activity .act-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Definition list for detail cards */

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
}

.detail-list .row dt,
.detail-list .row .k {
  color: var(--color-text-muted);
}

.detail-list .row dd,
.detail-list .row .v {
  margin: 0;
  font-weight: 600;
  text-align: right;
  color: var(--color-text);
}

/* Empty state */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.empty-state .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

/* ==========================================================================
   Charts
   ========================================================================== */

.chart-canvas {
  width: 100%;
  min-height: 260px;
}

.chart-canvas.tall {
  min-height: 320px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.chart-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .split-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-w: 232px;
    --content-pad: 24px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding-bottom: 12px;
  }

  .sidebar-logo {
    position: static;
  }

  .header-bar {
    height: auto;
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-search {
    width: 100%;
    max-width: none;
    order: 3;
  }

  .main-content {
    padding: 20px;
  }

  .screen-title {
    font-size: 21px;
  }

  .page-head {
    gap: 14px;
  }
}

/* Horizontal scroll rescue for wide tables on small screens */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  .sidebar,
  .header-bar,
  .page-actions,
  .toolbar {
    display: none !important;
  }
  .main-content {
    padding: 0;
  }
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ==========================================================================
   Data presentation components
   ========================================================================== */

/* Identity cell: avatar + primary name + muted secondary line */

.cell-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.cell-user .avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--color-primary-light);
  color: var(--color-primary-active);
  border: 1px solid var(--color-primary-border);
}

.cell-user .avatar.av-blue {
  background: #eef2ff;
  color: #3949c4;
  border-color: #d3dcfb;
}
.cell-user .avatar.av-green {
  background: #e8f6ed;
  color: #15803d;
  border-color: #c3e6d1;
}
.cell-user .avatar.av-rose {
  background: #fdecec;
  color: #b91c1c;
  border-color: #f6cfcf;
}

.cell-user .who {
  min-width: 0;
}

.cell-user .name {
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}

.cell-sub,
.cell-user .sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-top: 1px;
}

/* Service-module chip */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.chip-food {
  background: #fdf6e7;
  color: #a37210;
  border-color: #f3e2b8;
}
.chip-cab {
  background: #eef2ff;
  color: #3949c4;
  border-color: #d3dcfb;
}
.chip-share {
  background: #e8f6ed;
  color: #15803d;
  border-color: #c3e6d1;
}
.chip-parcel {
  background: #fdecec;
  color: #b91c1c;
  border-color: #f6cfcf;
}

/* Numerals */

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.num,
th.num {
  text-align: right;
}

.num-strong {
  font-weight: 600;
  color: var(--color-text);
}

/* Rating */

.rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.rating svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  color: var(--color-primary);
  fill: var(--color-primary);
}

.rating .of {
  font-weight: 400;
  color: var(--color-text-faint);
}

/* Badge dot */

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Progress meter */

.meter {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  overflow: hidden;
  min-width: 90px;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
}

.meter.ok > span {
  background: var(--color-success);
}
.meter.warn > span {
  background: var(--color-warning);
}
.meter.bad > span {
  background: var(--color-danger);
}

/* ==========================================================================
   Panel head with trailing actions
   ========================================================================== */

.panel-title .title-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.panel-title .title-actions a {
  color: var(--color-primary);
  text-decoration: none;
}

.panel-title .title-actions a:hover {
  text-decoration: underline;
}

.kit-order-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--color-bg);
}

.kit-order-block-spaced {
  margin-top: 12px;
}

.kit-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kit-order-kit {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kit-order-kit strong {
  display: block;
  margin-bottom: 4px;
}

.kit-order-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.kit-create-form {
  margin-bottom: 16px;
}

.kit-create-grid {
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) auto;
  align-items: end;
}

.kit-create-grid .form-field-full {
  grid-column: 1 / -1;
}

.kit-create-actions {
  justify-content: flex-end;
}

.kit-order-status-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kit-order-status-form .field {
  min-width: 140px;
}

.kit-size-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kit-size-create-grid {
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
  align-items: end;
}

.kit-size-available-field {
  justify-content: flex-end;
  padding-bottom: 8px;
}

.modal-lg {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}

/* ==========================================================================
   Filter bar — labelled controls instead of bare inputs
   ========================================================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.filter-group > label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}

.filter-group select,
.filter-group input {
  height: 38px;
  min-width: 172px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: var(--color-surface);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.revenue-report-filters .filter-group {
  flex: 0 1 auto;
}

.revenue-report-filters .filter-group select.field[data-native-select] {
  min-width: 172px;
  max-width: 220px;
}

.revenue-report-filters .filter-group input[type="date"] {
  min-width: 152px;
  width: 100%;
}

.transaction-ledger-filters .filter-group:first-child input[type="search"] {
  min-width: 240px;
}

.transaction-ledger-filters .filter-group select.field[data-native-select] {
  min-width: 172px;
  max-width: 220px;
}

/* Segmented control */

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.segmented button:hover {
  color: var(--color-text);
}

.segmented button.active {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Multi-step form stepper
   ========================================================================== */

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.stepper li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.stepper li .n {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.stepper li.done {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}
.stepper li.done .n {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}

.stepper li.current {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-active);
  font-weight: 600;
}
.stepper li.current .n {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   Table overflow — scroll horizontally instead of squeezing columns
   ========================================================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
}

.table-wrap > table.data-table {
  margin-bottom: 0;
  min-width: 760px;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}
.table-wrap::-webkit-scrollbar-track {
  background: var(--color-bg);
  border-radius: var(--radius-pill);
}
.table-wrap::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

/* keep atomic values on one line */
table.data-table td {
  white-space: nowrap;
}

/* let genuinely long prose wrap */
table.data-table td.wrap,
table.data-table td:has(> .cell-user),
table.data-table td:has(> .empty-state),
table.data-table td.prose {
  white-space: normal;
}

/* the old <700px block is superseded by .table-wrap */
@media (max-width: 700px) {
  table.data-table {
    display: table;
    overflow: visible;
    white-space: normal;
  }
}

/* ==========================================================================
   Compact document / evidence tiles
   ========================================================================== */

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.doc-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.doc-tile:hover {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-xs);
}

.doc-tile .thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  border: 1px dashed var(--color-border-strong);
  color: var(--color-text-faint);
}

.doc-tile .thumb svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}

.doc-tile .thumb.thumb-image {
  padding: 0;
  overflow: hidden;
  border-style: solid;
}

.doc-tile .thumb.thumb-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-detail {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 20px;
  align-items: start;
}

.profile-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .profile-detail {
    grid-template-columns: 1fr;
  }
}

.doc-tile .doc-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}

.doc-tile .doc-meta {
  font-size: 11.5px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Table card — filter bar + table + footer in ONE card (reference pattern)
   ========================================================================== */

.table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.table-card > .toolbar,
.table-card > .filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.table-card > .table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.table-card > .table-wrap > table.data-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.table-card > .pagination,
.table-card > .table-wrap > .pagination {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  margin: 0;
}

/* compact filter controls inside a card. :not(.ts-wrapper) excludes Tom
   Select's generated wrapper div (see the .toolbar .field comment above) --
   without it, this rule's border-radius: var(--radius-sm) fights the 8px
   radius on .ts-wrapper .ts-control, showing a corner seam around the
   select on pages like Food Orders / Restaurants where the filter form
   lives inside .table-card. The compact sizing is reapplied below directly
   to .ts-control, the element Tom Select actually renders -- see the
   ".table-card .ts-wrapper .ts-control" override in the Tom Select section
   further down (it has to live there: equal-specificity rules resolve by
   source order, and it must come after ".ts-wrapper.single .ts-control"
   to win). Without that override those selects fall back to the default
   (taller) Tom Select size instead of matching the plain search input
   next to them. */
.table-card .field:not(.ts-wrapper),
.table-card input.field,
.table-card select.field {
  height: 34px;
  min-width: 150px;
  font-size: 12.75px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.table-card .btn {
  height: 34px;
  padding: 0 14px;
  font-size: 12.75px;
  border-radius: var(--radius-sm);
}

.table-card-section-head {
  padding: 16px 16px 0;
}

.table-card-section-head .panel-title {
  margin: 0 0 6px;
  padding-bottom: 0;
  border-bottom: 0;
}

.table-card-section-head .panel-subtitle {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Paid campaign review tables — shared column widths across pending/approved lists */
table.data-table.paid-campaign-table {
  table-layout: fixed;
  min-width: 980px;
}

table.data-table.paid-campaign-table col.col-name { width: 18%; }
table.data-table.paid-campaign-table col.col-restaurant { width: 18%; }
table.data-table.paid-campaign-table col.col-amount { width: 9%; }
table.data-table.paid-campaign-table col.col-razorpay { width: 15%; }
table.data-table.paid-campaign-table col.col-dates { width: 16%; }
table.data-table.paid-campaign-table col.col-last { width: 28%; }

table.data-table.paid-campaign-table th.action-cell {
  text-align: right;
}

table.data-table.paid-campaign-table td.campaign-review-cell {
  width: auto;
  min-width: 0;
  text-align: right;
  white-space: normal;
  vertical-align: top;
}

table.data-table.paid-campaign-table td.col-name,
table.data-table.paid-campaign-table td.col-restaurant {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

table.data-table.paid-campaign-table td.col-razorpay,
table.data-table.paid-campaign-table td.col-dates {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pending-campaign review actions: "Approve" and "Reject" sit side by side
   as two compact buttons by default. The reason field used to be permanently
   visible next to Reject on every row (cramped into a narrow fixed-width
   table column, and stacked awkwardly under a full-width Approve button) --
   it's now a <details>/<summary> disclosure (see .campaign-reject-disclosure
   below) revealed only when an admin actually clicks Reject. Zero new JS:
   plain HTML disclosure semantics. */
.campaign-review-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.campaign-review-buttons {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.campaign-review-buttons:has(.campaign-reject-disclosure[open]),
.campaign-review-buttons.campaign-review-expanded {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.campaign-review-buttons:has(.campaign-reject-disclosure[open]) .campaign-review-approve,
.campaign-review-buttons.campaign-review-expanded .campaign-review-approve {
  align-self: flex-end;
  margin: 0;
}

.campaign-review-approve {
  margin: 0;
  flex: 0 0 auto;
}

.campaign-reject-disclosure {
  margin: 0;
  flex: 0 0 auto;
}

/* Style <summary> as an ordinary .btn (it already gets .btn/.btn-sm/
   .btn-secondary's own display/height/padding/colors); only the native
   disclosure triangle needs removing. */
.campaign-reject-disclosure > summary {
  list-style: none;
  cursor: pointer;
}

.campaign-reject-disclosure > summary::-webkit-details-marker {
  display: none;
}

.campaign-reject-disclosure > summary::marker {
  content: '';
}

/* Explicit close-state hiding, rather than relying on the UA default for
   non-summary <details> children: a bare ".campaign-review-reject
   { display: flex }" is an author-stylesheet rule, and any normal author
   rule beats the UA stylesheet's default hiding regardless of specificity
   -- it would force the form visible even while <details> is closed,
   defeating the whole disclosure. Writing both states ourselves makes the
   behavior deterministic across browsers instead of depending on it. */
details.campaign-reject-disclosure:not([open]) .campaign-review-reject {
  display: none;
}

details.campaign-reject-disclosure[open] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

/* Hide the toggle once expanded — otherwise two "Reject" buttons show. */
details.campaign-reject-disclosure[open] > summary {
  display: none;
}

details.campaign-reject-disclosure[open] .campaign-review-reject {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.campaign-review-reject .campaign-reject-reason {
  width: 100%;
  min-width: 0;
  height: 34px;
}

.campaign-review-reject-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.campaign-review-reject-actions .btn {
  flex: 0 0 auto;
  margin: 0;
}

.campaign-approved-cell {
  white-space: normal;
  vertical-align: top;
}

.campaign-approved-on {
  margin-bottom: 8px;
}

.campaign-approved-delete {
  margin: 0;
}

.campaign-rejected-cell {
  white-space: normal;
  vertical-align: top;
}

/* Paid ad banner review tables — preview column + shared campaign widths */
table.data-table.paid-ad-banner-table {
  table-layout: fixed;
  min-width: 1040px;
}

table.data-table.paid-ad-banner-table col.col-preview { width: 7%; }
table.data-table.paid-ad-banner-table col.col-name { width: 16%; }
table.data-table.paid-ad-banner-table col.col-restaurant { width: 16%; }
table.data-table.paid-ad-banner-table col.col-amount { width: 8%; }
table.data-table.paid-ad-banner-table col.col-razorpay { width: 14%; }
table.data-table.paid-ad-banner-table col.col-dates { width: 15%; }
table.data-table.paid-ad-banner-table col.col-last { width: 28%; }

table.data-table.paid-ad-banner-table th.action-cell {
  text-align: right;
}

table.data-table.paid-ad-banner-table td.campaign-review-cell,
table.data-table.paid-ad-banner-table td.campaign-rejected-cell {
  width: auto;
  min-width: 0;
  text-align: right;
  white-space: normal;
  vertical-align: top;
}

table.data-table.paid-ad-banner-table td.col-name,
table.data-table.paid-ad-banner-table td.col-restaurant {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

table.data-table.paid-ad-banner-table td.col-razorpay,
table.data-table.paid-ad-banner-table td.col-dates {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.data-table.paid-ad-banner-table td.col-preview {
  width: 72px;
}

/* a panel that only wraps a table gets no double chrome */
.panel > .table-wrap:only-of-type {
  margin-bottom: 0;
}

/* Brand logo image */
.brand-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-logo--sidebar {
  max-height: 46px;
  max-width: 168px;
  border-radius: 8px;
}

.brand-logo--login {
  max-height: 88px;
  max-width: min(280px, 100%);
  border-radius: 10px;
}

.sidebar-logo {
  overflow: hidden;
}

/* subtitle separator breathing room */
.screen-subtitle {
  letter-spacing: 0.005em;
}

/* ==========================================================================
   Flat sidebar links (top-level sections with no children)
   ========================================================================== */

.nav-flat {
  list-style: none;
  margin: 2px 0;
  padding: 0;
}

.nav-flat > li {
  margin: 1px 10px;
}

.nav-flat > li > .nav-section {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}

.nav-link:hover .nav-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.nav-link.current {
  background: var(--color-primary);
  color: #17130a;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(216, 155, 24, 0.32);
}

.nav-link.current .nav-icon {
  background: #17130a;
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

/* Nested expandable group (Service Module -> Restaurants -> Food Management) */

.nav-subsection {
  border: 0;
  margin: 1px 0 1px 10px;
}

.nav-subsection > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
  font-size: 12.75px;
  font-weight: 500;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  user-select: none;
}

.nav-subsection > summary::-webkit-details-marker {
  display: none;
}

.nav-subsection > summary::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.4;
  transition: transform var(--dur) var(--ease);
}

.nav-subsection[open] > summary::after {
  transform: rotate(45deg);
}

.nav-subsection > summary:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}

.nav-subsection > summary .nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.nav-subsection > summary .nav-icon svg {
  width: 13px;
  height: 13px;
}

.nav-subsection.active > summary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text-strong);
  font-weight: 600;
}

.nav-subsection .nav-subitems {
  padding-left: 10px;
}

.nav-subsection .nav-subsection {
  margin-left: 18px;
}

/* ==========================================================================
   Modal dialogs (native <dialog>)
   ========================================================================== */

html.modal-open,
body.modal-open {
  overflow: hidden;
  height: 100%;
}

body.modal-open .main-column,
body.modal-open .sidebar {
  overflow: hidden;
}

dialog.modal:not([open]) {
  display: none;
}

dialog.modal[open] {
  display: flex;
  flex-direction: column;
  border: 0;
  padding: 0;
  margin: auto;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border-radius: var(--radius-lg, 14px);
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  color: var(--color-text, #1f2937);
  overflow: hidden;
}

dialog.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: inherit;
  overflow: hidden;
}

dialog.modal > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
}

dialog.modal.modal-sm {
  width: min(460px, calc(100vw - 32px));
}

dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 4px;
  border-radius: 6px;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.modal-body {
  padding: 18px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border, #e5e7eb);
  background: #fafafa;
  border-radius: 0 0 var(--radius-lg, 14px) var(--radius-lg, 14px);
  flex-shrink: 0;
}

.modal-foot .modal-foot-note {
  margin-right: auto;
  font-size: 12px;
  color: #6b7280;
}

.confirm-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-muted, #4b5563);
}

/* ==========================================================================
   Toast notifications
   ========================================================================== */

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md, 10px);
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-left: 4px solid #9ca3af;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  line-height: 1.45;
  animation: toastIn 0.22s var(--ease, ease) both;
}

.toast.toast-success {
  border-left-color: #16a34a;
  color: #14532d;
}

.toast.toast-error {
  border-left-color: #dc2626;
  color: #7f1d1d;
}

.toast.toast-warning {
  border-left-color: #d97706;
  color: #78350f;
}

.toast-dismiss {
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.toast-dismiss:hover {
  opacity: 1;
}

.toast.is-leaving {
  animation: toastOut 0.18s var(--ease, ease) both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

/* ==========================================================================
   Form/button loading + validation states
   ========================================================================== */

.btn.is-loading,
.btn-secondary.is-loading,
.btn-danger.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #17130a;
  animation: btnSpin 0.6s linear infinite;
}

.btn-secondary.is-loading::after,
.btn-danger.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid #6b7280;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
  to {
    transform: rotate(360deg);
  }
}

.field-errors {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: #b91c1c;
}

.form-field.has-field-error .field,
.form-field.has-field-error select.field,
.form-field.has-field-error textarea.field {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

.form-field .field.has-error,
.form-field select.has-error,
.form-field textarea.has-error {
  border-color: #dc2626;
}

#global-confirm-modal[open] {
  z-index: 10001;
}

/* Read-only masked value (sensitive data) */
.masked-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #475569;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text, #1f2937);
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.thumb-preview {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border, #e5e7eb);
  background: #f8fafc;
  display: block;
}

.thumb-preview-lg {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--color-border, #e5e7eb);
  display: block;
}

/* Tag-style multi-select (categories, etc.) */

.form-field:has(.tag-multiselect),
.form-field.form-field-full {
  grid-column: 1 / -1;
}

select.tag-multiselect-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tag-multiselect {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff);
}

.tag-multiselect-selected,
.tag-multiselect-available {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  align-items: center;
}

.tag-multiselect-selected {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--color-border, #e5e7eb);
}

.tag-multiselect-empty {
  font-size: 12.5px;
  color: var(--color-text-muted, #6b7280);
  font-style: italic;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill, 999px);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-bg, #f8fafc);
  color: var(--color-text, #1f2937);
  cursor: pointer;
  transition: background var(--dur, 0.15s) var(--ease, ease),
    border-color var(--dur, 0.15s) var(--ease, ease),
    color var(--dur, 0.15s) var(--ease, ease),
    box-shadow var(--dur, 0.15s) var(--ease, ease);
}

.tag-chip:hover {
  border-color: var(--color-primary, #d89b18);
  background: #fff8eb;
}

.tag-chip.is-selected {
  background: #fff8eb;
  border-color: #f3e2b8;
  color: #a37210;
  padding-right: 8px;
}

.tag-chip.is-selected:hover {
  background: #fef3c7;
  border-color: #e8c96a;
}

.tag-chip-label {
  pointer-events: none;
}

.tag-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: #a37210;
  background: rgba(163, 114, 16, 0.12);
}

.tag-chip.is-selected:hover .tag-chip-remove {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}

.tag-multiselect-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--color-text-muted, #6b7280);
}

.doc-verification-batch-form .doc-status-select {
  min-width: 150px;
  max-width: 220px;
}

.doc-verification-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.presence-badge--offline {
  background: var(--color-surface-muted, #f3f4f6);
  color: var(--color-text-muted, #6b7280);
  border: 1px solid var(--color-border, #e5e7eb);
}

.presence-badge--offline .dot {
  background: #9ca3af;
}

.presence-badge.badge-success .dot {
  background: var(--color-success, #16a34a);
}

table.data-table.coupon-list-table td {
  white-space: nowrap;
}

table.data-table.coupon-list-table td.coupon-valid-cell {
  white-space: normal;
}

table.data-table.coupon-list-table td.coupon-assigned-cell {
  min-width: 210px;
}

.coupon-assigned-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

table.data-table.coupon-list-table th.coupon-actions-cell,
table.data-table.coupon-list-table td.coupon-actions-cell {
  text-align: right;
}

.coupon-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ==========================================================================
   Coupon user searchable multiselect (Tom Select — coupon modals only)
   ========================================================================== */

select.coupon-user-select[data-coupon-user-enhanced] {
  display: none !important;
}

.coupon-user-field,
.form-field:has(select.coupon-user-select) {
  grid-column: 1 / -1;
  width: 100%;
}

.coupon-user-field .field-label,
.form-field:has(select.coupon-user-select) label {
  display: block;
  margin-bottom: 6px;
}

.coupon-user-field .field-help,
.form-field:has(select.coupon-user-select) .form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.form-field:has(.coupon-user-select + .ts-wrapper),
.coupon-user-field:has(.ts-wrapper) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.form-field .ts-wrapper.multi,
.coupon-user-field .ts-wrapper.multi {
  width: 100%;
  font-family: var(--font-sans);
}

.form-field .ts-wrapper.multi .ts-control,
.coupon-user-field .ts-wrapper.multi .ts-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  max-height: 132px;
  overflow-y: auto;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
  font-size: 13.5px;
  color: var(--color-text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.form-field .ts-wrapper.multi.input-active .ts-control,
.form-field .ts-wrapper.multi.focus .ts-control,
.coupon-user-field .ts-wrapper.multi.input-active .ts-control,
.coupon-user-field .ts-wrapper.multi.focus .ts-control {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

.form-field .ts-wrapper.multi .ts-control > div,
.coupon-user-field .ts-wrapper.multi .ts-control > div {
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-border);
  color: #7a5208;
  border-radius: var(--radius-pill);
  font-size: 12px;
  margin: 0;
}

.form-field .ts-wrapper.multi .ts-control > div .remove,
.coupon-user-field .ts-wrapper.multi .ts-control > div .remove {
  border-left: 1px solid var(--color-primary-border);
}

.form-field .ts-wrapper.multi .ts-control > div .remove:hover,
.coupon-user-field .ts-wrapper.multi .ts-control > div .remove:hover {
  background: rgba(185, 28, 28, 0.12);
  color: var(--color-danger);
}

.form-field .ts-wrapper.multi .ts-control input,
.coupon-user-field .ts-wrapper.multi .ts-control input {
  flex: 1 1 160px;
  min-width: 140px;
  font-size: 13.5px;
}

.app-shell .ts-dropdown,
body > .ts-dropdown {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  margin: 0;
  z-index: 500;
  background: var(--color-surface);
  overflow: hidden;
}

.app-shell .ts-dropdown .ts-dropdown-content,
body > .ts-dropdown .ts-dropdown-content {
  max-height: min(240px, 40vh);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.28) transparent;
}

.app-shell .ts-dropdown .ts-dropdown-content::-webkit-scrollbar,
body > .ts-dropdown .ts-dropdown-content::-webkit-scrollbar {
  width: 6px;
}

.app-shell .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-track,
body > .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb,
body > .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.22);
  border-radius: 999px;
}

.app-shell .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb:hover,
body > .ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.36);
}

.app-shell .ts-dropdown .option,
body > .ts-dropdown .option {
  padding: 8px 12px;
}

.app-shell .ts-dropdown .option.active,
body > .ts-dropdown .option.active {
  background: var(--color-primary-light);
  color: var(--color-text);
}

.app-shell .ts-dropdown .option:hover,
.app-shell .ts-dropdown .option.selected,
body > .ts-dropdown .option:hover,
body > .ts-dropdown .option.selected {
  background: rgba(216, 155, 24, 0.12);
  color: var(--color-text);
}

.app-shell .ts-dropdown .no-results,
body > .ts-dropdown .no-results {
  padding: 8px 12px;
  color: var(--color-text-muted);
}

.ts-dropdown-content .option[data-value=""] {
  display: none !important;
}

/* ==========================================================================
   Glidr admin single-select (Tom Select — forms, filters, modals)
   ========================================================================== */

.app-shell select.field[data-glidr-select-enhanced],
.app-shell select.searchable-select[data-glidr-select-enhanced] {
  display: none !important;
}

.form-field:has(select.searchable-select) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.app-shell .ts-wrapper.single {
  width: 100%;
  font-family: var(--font-sans);
}

/* Toolbar is a full-width flex row; width:100% makes the select span the page. */
.toolbar .ts-wrapper.single {
  width: auto;
  min-width: 180px;
  max-width: 240px;
  flex: 0 0 auto;
}

.filter-group .ts-wrapper.single {
  min-width: 170px;
}

.app-shell .ts-wrapper.single .ts-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
  font-size: 13.5px;
}

.app-shell .ts-wrapper.single:not(.plugin-dropdown_input) .ts-control input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 8px 0;
  margin: 0;
  min-height: 0;
  height: auto;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
  color: inherit;
}

.app-shell .ts-wrapper.single:not(.plugin-dropdown_input) .ts-control input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.app-shell .ts-wrapper.single.input-active .ts-control,
.app-shell .ts-wrapper.single.focus .ts-control {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

/* dropdown_input: closed control shows placeholder or selected bank; search lives in the list */
.app-shell .ts-wrapper.single.plugin-dropdown_input .ts-control {
  cursor: pointer;
  padding: 8px 12px;
}

.app-shell .ts-wrapper.single.plugin-dropdown_input:not(.has-items) .ts-control input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  min-height: 0;
  height: auto;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
}

.app-shell .ts-wrapper.single.plugin-dropdown_input.has-items .ts-control .item {
  display: block;
  width: 100%;
  color: var(--color-text);
}

.app-shell .ts-wrapper.single.plugin-dropdown_input .dropdown-input-wrap,
.app-shell .ts-dropdown .dropdown-input-wrap,
body > .ts-dropdown .dropdown-input-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.app-shell .ts-wrapper.single.plugin-dropdown_input input.dropdown-input,
.app-shell .ts-dropdown input.dropdown-input,
body > .ts-dropdown input.dropdown-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  min-height: 38px;
  margin: 0;
  background: var(--color-surface);
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--color-text);
}

.app-shell .ts-wrapper.single.plugin-dropdown_input input.dropdown-input::placeholder,
.app-shell .ts-dropdown input.dropdown-input::placeholder,
body > .ts-dropdown input.dropdown-input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

.app-shell .ts-wrapper.single.plugin-dropdown_input input.dropdown-input:focus,
.app-shell .ts-dropdown input.dropdown-input:focus,
body > .ts-dropdown input.dropdown-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(216, 155, 24, 0.14);
}

body > .ts-dropdown {
  z-index: 12000;
}

/* ==========================================================================
   Create restaurant modal — form layout & responsiveness
   ========================================================================== */

#create-restaurant-modal .modal-body .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 14px;
}

#create-restaurant-modal .form-field textarea.field {
  min-height: 72px;
  resize: vertical;
}

#create-restaurant-modal .restaurant-hours-panel {
  margin-top: 16px;
}

#create-restaurant-modal .restaurant-hours-note {
  margin: -4px 0 14px;
}

#create-restaurant-modal .create-operating-hour-slot {
  margin: 0;
}

/* Compact grid inside the modal — keeps columns aligned without breaking the row layout */
#create-restaurant-modal .restaurant-hours-panel .operating-hours-table {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hours-head,
#create-restaurant-modal .restaurant-hours-panel .create-operating-hours-day-group {
  min-width: 560px;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hours-head,
#create-restaurant-modal .restaurant-hours-panel .operating-hour-day-header,
#create-restaurant-modal .restaurant-hours-panel .operating-hour-row,
#create-restaurant-modal .restaurant-hours-panel .operating-hour-add-row {
  grid-template-columns: 68px 76px minmax(0, 1fr) minmax(0, 1fr) 148px;
  gap: 8px 10px;
  align-items: center;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hour-day-header-spacer {
  display: none;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hour-row--continued .operating-hour-closed-spacer {
  display: block;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hour-time .field {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hour-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hour-actions .btn-sm {
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

#create-restaurant-modal .restaurant-hours-panel .create-operating-hour-remove[hidden] {
  display: none !important;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hour-add-spacer {
  display: none;
}

#create-restaurant-modal .restaurant-hours-panel .operating-hour-add-label {
  grid-column: 3 / 5;
  min-width: 0;
  line-height: 1.35;
}

#create-restaurant-modal .restaurant-hours-panel .create-operating-hour-add {
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 640px) {
  #create-restaurant-modal .modal-body .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Restaurant operating hours (partner detail)
   ========================================================================== */

.operating-hours-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.operating-hours-head,
.operating-hour-row {
  display: grid;
  grid-template-columns: 120px 90px minmax(140px, 1fr) minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.operating-hours-head {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.operating-hour-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.operating-hour-day {
  font-weight: 600;
}

.operating-hour-time {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.operating-hour-time .field {
  width: 100%;
  min-width: 0;
}

.operating-hour-closed {
  margin: 0;
}

.operating-hour-day--continued {
  display: block;
}

.operating-hour-row--continued .operating-hour-day--continued::before {
  content: '↳';
  color: var(--color-text-muted);
  margin-right: 6px;
}

.operating-hour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.operating-hours-day-group {
  scroll-margin-top: 96px;
}

.operating-hour-day-header {
  display: grid;
  grid-template-columns: 120px 90px minmax(140px, 1fr) minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
  background: color-mix(in srgb, var(--color-border) 18%, transparent);
}

.operating-hour-closed-spacer,
.operating-hour-day-header-spacer {
  display: block;
}

.operating-hour-row--highlight {
  background: color-mix(in srgb, var(--color-accent, #2563eb) 10%, transparent);
  border-radius: 8px;
}

.operating-hour-add-row {
  display: grid;
  grid-template-columns: 120px 90px minmax(140px, 1fr) minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.operating-hour-add-spacer {
  display: block;
}

.operating-hour-add-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

#operating-hours-panel {
  scroll-margin-top: 96px;
}

/* Cab / courier payout review table */
.payout-kpi-grid {
  margin: 16px 0 20px;
}

.payout-bulk-toolbar {
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.payout-bulk-toolbar .toolbar-hint {
  font-size: 13px;
  color: var(--color-text-muted);
}

table.data-table.payout-table col.col-select { width: 44px; }
table.data-table.payout-table col.col-driver { width: 17%; }
table.data-table.payout-table col.col-amount { width: 9%; }
table.data-table.payout-table col.col-bank { width: 11%; }
table.data-table.payout-table col.col-status { width: 10%; }
table.data-table.payout-table col.col-requested { width: 12%; }
table.data-table.payout-table col.col-reference { width: 10%; }
table.data-table.payout-table col.col-detail { width: 88px; }
table.data-table.payout-table col.col-actions { width: auto; }

table.data-table.payout-table th.action-cell,
table.data-table.payout-table td.action-cell {
  min-width: 210px;
  white-space: normal;
}

table.data-table.payout-table td.payout-requested {
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 13px;
}

table.data-table.payout-table td.payout-bank {
  color: var(--color-text-muted);
  font-size: 13px;
}

table.data-table.payout-table td.payout-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}

table.data-table.payout-table td.campaign-review-cell {
  vertical-align: middle;
}

table.data-table.payout-table td.payout-reference {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 13px;
}

table.data-table.payout-table td.payout-detail-cell {
  min-width: 88px;
  white-space: nowrap;
  vertical-align: middle;
}

.payout-detail-modal .payout-detail-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.payout-detail-modal .payout-detail-section-title {
  margin: 20px 0 10px;
}

.payout-detail-modal .payout-detail-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  white-space: pre-wrap;
  word-break: break-word;
}

table.data-table.payout-table .cell-user .name {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

table.data-table.payout-table .cell-user .name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.cell-muted {
  color: var(--color-text-muted);
}

/* Cab vehicle list table */
.vehicle-bulk-toolbar {
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.vehicle-bulk-toolbar .toolbar-hint {
  font-size: 13px;
  color: var(--color-text-muted);
}

.vehicle-bulk-toolbar [data-bulk-action]:disabled,
.vehicle-bulk-toolbar [data-bulk-action].is-disabled {
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  box-shadow: none;
}

.vehicle-bulk-toolbar [data-bulk-action]:disabled:hover,
.vehicle-bulk-toolbar [data-bulk-action].is-disabled:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  box-shadow: none;
}

table.data-table.vehicle-table col.col-select { width: 44px; }
table.data-table.vehicle-table col.col-registration { width: 12%; }
table.data-table.vehicle-table col.col-driver { width: 18%; }
table.data-table.vehicle-table col.col-vehicle { width: 18%; }
table.data-table.vehicle-table col.col-approval { width: 11%; }
table.data-table.vehicle-table col.col-active { width: 9%; }
table.data-table.vehicle-table col.col-actions { width: auto; }

table.data-table.vehicle-table th.action-cell,
table.data-table.vehicle-table td.action-cell {
  min-width: 300px;
  white-space: nowrap;
}

table.data-table.vehicle-table td.campaign-review-cell {
  min-width: 280px;
  white-space: normal;
  vertical-align: middle;
}

table.data-table.vehicle-table .vehicle-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

table.data-table.vehicle-table .vehicle-crud-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

table.data-table.vehicle-table .vehicle-crud-actions form {
  display: inline-flex;
  margin: 0;
}

table.data-table.vehicle-table .vehicle-row-actions > form,
table.data-table.vehicle-table .vehicle-row-actions > details {
  display: inline-flex;
  margin: 0;
}

.vehicle-detail-modal .vehicle-detail-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.vehicle-detail-modal .vehicle-detail-photos-title {
  margin: 20px 0 12px;
}

table.data-table.vehicle-table .vehicle-registration {
  font-weight: 600;
}

table.data-table.vehicle-table .cell-user .name,
table.data-table.vehicle-table .cell-vehicle .name {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

table.data-table.vehicle-table .cell-user .name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

table.data-table.vehicle-table .cell-vehicle .name {
  display: block;
}

/* Cab earnings ledger */
.earnings-kpi-grid {
  margin: 16px 0 20px;
}

.earnings-credit {
  color: #15803d;
}

.earnings-debit {
  color: #b91c1c;
}

.earnings-ledger-note {
  margin: 16px 0 0;
}

table.data-table.earnings-table col.col-created { width: 14%; }
table.data-table.earnings-table col.col-driver { width: 20%; }
table.data-table.earnings-table col.col-type { width: 14%; }
table.data-table.earnings-table col.col-amount { width: 11%; }
table.data-table.earnings-table col.col-reference { width: 14%; }
table.data-table.earnings-table col.col-description { width: auto; }

table.data-table.earnings-table td.earnings-date {
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 13px;
}

table.data-table.earnings-table td.earnings-reference,
table.data-table.earnings-table td.earnings-description {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 13px;
}

table.data-table.earnings-table .cell-user .name {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

table.data-table.earnings-table .cell-user .name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

table.data-table.earnings-table td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Cab revenue report */
.cab-revenue-note {
  margin: 0 0 16px;
}

table.data-table.cab-revenue-table col.col-completed { width: 13%; }
table.data-table.cab-revenue-table col.col-source { width: 11%; }
table.data-table.cab-revenue-table col.col-reference { width: 13%; }
table.data-table.cab-revenue-table col.col-driver { width: 16%; }
table.data-table.cab-revenue-table col.col-passenger { width: 11%; }
table.data-table.cab-revenue-table col.col-gross { width: 10%; }
table.data-table.cab-revenue-table col.col-commission { width: 12%; }
table.data-table.cab-revenue-table col.col-driver-net { width: 10%; }

table.data-table.cab-revenue-table td.cab-revenue-date,
table.data-table.cab-revenue-table td.cab-revenue-reference {
  white-space: nowrap;
  font-size: 13px;
}

table.data-table.cab-revenue-table td.cab-revenue-date {
  color: var(--color-text-muted);
}

table.data-table.cab-revenue-table td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data-table.cab-revenue-table .cell-user .name {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

table.data-table.cab-revenue-table .cell-user .name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
