:root {
  color-scheme: light;
  --bg: #eef2f8;
  --bg-elevated: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --surface-3: #e8eef6;
  --text: #152238;
  --text-soft: #3d4f68;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #234176;
  --primary-dark: #1a3158;
  --primary-soft: rgba(35, 65, 118, 0.1);
  --primary-2: #1b8a7a;
  --primary-2-soft: rgba(27, 138, 122, 0.12);
  --danger: #c62828;
  --danger-soft: #fef2f2;
  --warning-soft: #fff8eb;
  --success: #047857;
  --success-soft: #ecfdf5;
  --shadow-xs: 0 1px 2px rgba(21, 34, 56, 0.05);
  --shadow-sm: 0 4px 14px rgba(21, 34, 56, 0.06);
  --shadow-md: 0 12px 32px rgba(21, 34, 56, 0.1);
  --shadow-lg: 0 20px 48px rgba(21, 34, 56, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --sidebar-width: 272px;
  --content-pad: 28px;
  --transition: 0.2s ease;
  --font: "Cairo", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.sidebar-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

h1 {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

/* ——— Auth ——— */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(27, 138, 122, 0.14), transparent),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(35, 65, 118, 0.12), transparent),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-card-brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 28px 20px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #2d5a9e 100%);
  color: #fff;
}

.auth-card-brand .eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

.auth-card-brand h1 {
  color: #fff;
  margin-bottom: 8px;
}

.auth-card-brand .muted {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0;
  font-size: 14px;
}

.auth-card .form-stack {
  padding: 24px 28px 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.form-stack {
  display: grid;
  gap: 18px;
}

/* ——— Forms ——— */
.admin-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}

.admin-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: center;
}

.admin-form-grid .primary-btn {
  grid-column: 1 / -1;
}

.admin-pages-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.admin-pages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-pages-head small {
  color: var(--muted);
  font-size: 12px;
}

.admin-pages-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.admin-page-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.admin-page-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.field-wrap {
  display: grid;
  gap: 7px;
  align-self: stretch;
  min-width: 0;
}

.field-wrap input,
.field-wrap select {
  width: 100%;
}

.field-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-dispatch-heading {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(27, 138, 122, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(27, 138, 122, 0.12), rgba(35, 65, 118, 0.08));
  color: var(--primary);
  font-weight: 900;
}

.product-dispatch-heading small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.settings-summary-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.settings-summary-title span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.settings-summary-title small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: end;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.settings-summary-item {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.settings-summary-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.settings-summary-item strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.form-group-title {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.admin-form.invite-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
}

.admin-form.invite-form .primary-btn {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition);
}

input::placeholder {
  color: #94a3b8;
}

input:hover,
select:hover {
  border-color: #94a3b8;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* ——— Buttons ——— */
.primary-btn,
.ghost-btn,
.nav-btn,
.mini-btn,
.icon-btn {
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  transition:
    background var(--transition),
    color var(--transition),
    filter var(--transition);
}

.primary-btn {
  min-height: 48px;
  padding: 0 20px;
  background: linear-gradient(180deg, #2a4f8f 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(35, 65, 118, 0.28);
}

.primary-btn:hover {
  background: linear-gradient(180deg, #315a9c 0%, var(--primary) 100%);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.mini-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.25);
  opacity: 0.72;
  transform: none;
}

.btn-loading-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.inline-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.ghost-btn {
  width: 100%;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.form-status-message {
  grid-column: 1 / -1;
  min-height: 22px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-status-message.success {
  color: var(--success);
}

.form-status-message.error {
  color: var(--danger);
}

/* ——— App shell ——— */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, #1a2d52 0%, #14233f 48%, #101c33 100%);
  color: #fff;
  padding: 24px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-toggle {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 6px;
}

.brand strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary-2), #22a895);
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 6px 16px rgba(27, 138, 122, 0.35);
  flex-shrink: 0;
}

.brand-mark-lg {
  width: 52px;
  height: 52px;
  font-size: 26px;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 14px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-group-title {
  padding: 0 10px 2px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.nav-section.has-alert .nav-group-title {
  position: relative;
  color: #fbbf24;
}

.nav-section.has-alert .nav-group-title::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-start: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
}

.nav-btn {
  min-height: 46px;
  padding: 0 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: right;
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid transparent;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-inline-start-color: var(--primary-2);
  box-shadow: var(--shadow-xs);
}

.content {
  min-width: 0;
  width: 100%;
  padding: var(--content-pad);
  background:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(35, 65, 118, 0.04), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
}

/* ——— Topbar ——— */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.topbar-card {
  position: sticky;
  top: 12px;
  z-index: 20;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}

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

.topbar-titles {
  min-width: 0;
}

.topbar-btn {
  white-space: nowrap;
}

.topbar h2 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-pill,
.admin-email {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.notif-wrap {
  position: relative;
}

.notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 14px;
}

.notif-btn.has-unread {
  background: var(--primary-soft);
  border-color: rgba(35, 65, 118, 0.25);
  color: var(--primary);
}

.notif-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(380px, calc(100vw - 32px));
  max-height: min(420px, 70vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.notif-panel-head strong {
  font-size: 14px;
}

.notif-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.notif-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: right;
  cursor: pointer;
  transition: background var(--transition);
}

.notif-item:hover {
  background: var(--primary-soft);
}

.notif-item.read {
  opacity: 0.72;
}

.notif-item:last-child {
  border-bottom: 0;
}

.notif-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-item-icon.user {
  background: var(--primary-2-soft);
  color: var(--primary-2);
}

.notif-item-icon.order {
  background: var(--primary-soft);
  color: var(--primary);
}

.notif-item-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notif-item-body strong {
  font-size: 14px;
  color: var(--text);
}

.notif-item-body small {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.notif-item-body em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.nav-btn.has-alert {
  position: relative;
}

.nav-btn.has-alert::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px #14233f;
}

/* ——— Pages ——— */
.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 20px;
  animation: pageIn 0.28s ease;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— Stats ——— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  position: relative;
  padding: 20px 20px 18px;
  display: grid;
  gap: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  opacity: 0.85;
}

.stat-card:hover {
  border-color: rgba(35, 65, 118, 0.18);
}

.stat-card span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.stat-card strong {
  font-size: clamp(1.75rem, 4vw, 2.1rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.operations-stats {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.operations-stat-card {
  width: 100%;
  border: 1px solid var(--line);
  text-align: start;
  cursor: pointer;
}

.operations-stat-card small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.operations-stat-card:hover {
  border-color: rgba(35, 65, 118, 0.28);
}

.dashboard-focus-grid {
  align-items: stretch;
}

.dashboard-action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  padding: 16px;
}

.dashboard-action-card {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
  text-align: start;
  cursor: pointer;
  transition: border-color var(--transition);
}

.dashboard-action-card:hover {
  border-color: rgba(35, 65, 118, 0.25);
}

.dashboard-action-card span,
.dashboard-action-card small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-action-card strong {
  color: var(--primary);
  font-size: 2rem;
  line-height: 1;
}

.dashboard-action-card small {
  line-height: 1.45;
  font-size: 12px;
}

.ops-status-stack {
  display: grid;
  gap: 5px;
}

.ops-status-stack small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.ops-actions {
  align-items: stretch;
}

.link-btn {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
}

.operations-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(35, 65, 118, 0.18);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at top right, rgba(35, 65, 118, 0.12), transparent 34%),
    linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
}

.operations-detail-hero h3 {
  margin: 8px 0 4px;
}

.operations-detail-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.order-details-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.operations-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.order-address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.order-address-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.order-address-card strong {
  display: block;
  margin-top: 8px;
  color: var(--primary);
  line-height: 1.7;
}

.address-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.address-chip-list span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f6fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.operations-card-list,
.operations-board {
  display: grid;
  gap: 12px;
}

.operations-board {
  padding: 16px;
}

.operations-linked-card,
.operations-issue-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.operations-linked-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.operations-linked-card strong,
.operations-linked-card small {
  display: block;
}

.operations-linked-card small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.order-preparation-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.operations-issue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 14px;
  padding: 14px;
}

.operations-issue-card.open {
  border-color: rgba(239, 68, 68, 0.28);
}

.operations-issue-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.operations-issue-title {
  display: grid;
  gap: 5px;
}

.operations-issue-title strong {
  color: var(--text);
  font-size: 16px;
}

.operations-issue-title small,
.operations-issue-main p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.6;
}

.operations-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.operations-meta-grid span {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.operations-meta-grid strong {
  color: var(--text);
}

.operations-issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  justify-content: flex-end;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  min-height: 64px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fafbfd 0%, var(--surface) 100%);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-head h3 {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
}

.panel-head .toolbar-row,
.panel-head .select-input,
.panel-head .mini-btn {
  flex: 1 1 auto;
}

.search-input {
  width: min(360px, 100%);
  max-width: 100%;
  flex: 1 1 200px;
}

.toolbar-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 100%;
  width: 100%;
}

.toolbar-row .search-input,
.toolbar-row .select-input,
.toolbar-row .segmented-control {
  flex: 1 1 180px;
  max-width: 100%;
}

.segmented-control {
  min-height: 42px;
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.segment-btn {
  min-width: 72px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}

.segment-btn.active,
.segment-btn:hover {
  background: var(--surface);
  color: var(--primary);
}

.select-input {
  width: min(240px, 100%);
  max-width: 100%;
}

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 4px 0 8px;
}

.table-wrap::after {
  content: "";
  display: block;
  height: 1px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table.data-table {
  min-width: 720px;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover td {
  background: rgba(35, 65, 118, 0.03);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong {
  font-weight: 800;
  color: var(--text);
}

td small {
  color: var(--muted);
  font-size: 12px;
}

/* ——— Badges & actions ——— */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  border: 1px solid transparent;
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(198, 40, 40, 0.15);
}

.badge.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(4, 120, 87, 0.18);
}

.order-short-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 3px 8px;
  margin-inline-end: 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  direction: ltr;
}

.current-user-badge {
  margin-inline-start: 8px;
  background: var(--primary-2-soft);
  color: var(--primary-2);
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.mini-btn {
  min-height: 38px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--line);
  font-size: 13px;
}

.mini-btn:hover {
  background: var(--primary-soft);
  border-color: rgba(35, 65, 118, 0.2);
}

.mini-btn.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(198, 40, 40, 0.2);
}

.mini-btn.danger:hover {
  background: #fee2e2;
}

.topbar-btn {
  background: var(--surface-2);
}

/* ——— Lists ——— */
.compact-list {
  display: grid;
  gap: 0;
}

.compact-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  transition: background var(--transition);
}

.compact-item:hover {
  background: rgba(35, 65, 118, 0.03);
}

.compact-item > div {
  min-width: 0;
  flex: 1 1 180px;
}

.compact-item:last-child {
  border-bottom: 0;
}

.compact-item strong {
  font-weight: 800;
  color: var(--text);
}

.compact-item small {
  color: var(--muted);
  font-size: 12px;
}

.pricing-rule-card {
  align-items: center;
}

.pricing-rule-main {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.pricing-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pricing-rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 180px;
  padding: 4px 7px;
  border: 1px solid rgba(93, 113, 143, 0.18);
  border-radius: 7px;
  background: rgba(245, 247, 251, 0.72);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.pricing-rule-chip b {
  color: var(--muted);
  font-weight: 700;
}

.pricing-rule-chip em {
  overflow: hidden;
  color: var(--text);
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
}

.pricing-rule-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ——— Documents & profiles ——— */
.documents-list {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.vendor-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(27, 138, 122, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--success-soft) 0%, rgba(27, 138, 122, 0.06) 100%);
  color: var(--text);
}

.vendor-profile h3,
.vendor-profile p {
  margin-bottom: 6px;
}

.vendor-profile p,
.vendor-profile small {
  color: var(--muted);
}

.vendor-doc-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vendor-doc-stats span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.vendor-doc-stats strong {
  color: var(--primary);
  font-weight: 800;
}

.document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.delivery-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.delivery-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.delivery-card-head h3,
.delivery-card-head p {
  margin-bottom: 6px;
}

.delivery-card-head p,
.delivery-card-head small {
  color: var(--muted);
}

.delivery-status-box {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.delivery-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.delivery-doc-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  transition: border-color var(--transition);
}

.delivery-doc-card:hover {
  border-color: var(--line-strong);
}

.delivery-doc-preview {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.delivery-doc-preview button {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.delivery-doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.doc-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.doc-group summary {
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
  list-style: none;
  background: var(--surface-2);
  transition: background var(--transition);
}

.doc-group summary:hover {
  background: var(--surface-3);
}

.doc-group summary::-webkit-details-marker {
  display: none;
}

.doc-group summary small {
  color: var(--muted);
  font-weight: 700;
}

.doc-group-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px;
}

.detail-box {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.detail-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-box strong {
  font-weight: 800;
  color: var(--text);
}

.details-list {
  display: grid;
}

.live-map-card {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-xs);
}

.live-map-head,
.route-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.live-map-head div,
.route-history-head div {
  display: grid;
  gap: 4px;
}

.live-map-head strong,
.route-history-head strong {
  color: var(--primary);
  font-weight: 900;
}

.live-map-head small,
.route-history-head small {
  color: var(--muted);
  font-weight: 700;
}

.live-map-canvas {
  position: relative;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    linear-gradient(rgba(35, 65, 118, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 65, 118, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 20% 20%, rgba(27, 138, 122, 0.12), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #e8eef6 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.live-driver-pin {
  position: absolute;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--muted);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
  font-size: 12px;
}

.live-driver-pin .bike-marker {
  font-size: 20px;
  line-height: 1;
}

.live-driver-pin small {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.live-driver-pin.fresh {
  background: var(--success);
}

.live-driver-pin.stale {
  background: #f59e0b;
}

.live-driver-list {
  display: grid;
  gap: 8px;
}

.online-drivers-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.95fr);
  gap: 12px;
  align-items: stretch;
}

.online-drivers-map-main .online-drivers-leaflet-map {
  min-height: 420px;
}

.online-driver-details-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 420px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.online-driver-detail-card {
  margin: 0;
}

.online-driver-rating-block {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(27, 138, 122, 0.08), rgba(35, 65, 118, 0.06));
}

.online-driver-rating-block strong {
  color: var(--primary);
  font-size: 12px;
}

.online-driver-rating-block span {
  font-weight: 900;
  color: var(--text);
}

.online-driver-list-item {
  width: 100%;
  text-align: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
}

.online-driver-list-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(35, 65, 118, 0.12);
}

.tracking-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-end: 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.legend-dot.static-party.seller {
  background: var(--primary-2);
  border-style: dashed;
}

.legend-dot.live-party.seller {
  background: var(--primary-2);
  animation: live-marker-pulse 2s ease-in-out infinite;
}

.legend-dot.driver {
  background: var(--primary);
}

@media (max-width: 960px) {
  .online-drivers-map-layout {
    grid-template-columns: 1fr;
  }

  .online-driver-details-panel,
  .online-drivers-map-main .online-drivers-leaflet-map {
    min-height: 320px;
  }
}

.route-history-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tracking-route-map {
  position: relative;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    linear-gradient(rgba(35, 65, 118, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 65, 118, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 20% 24%, rgba(27, 138, 122, 0.14), transparent 28%),
    radial-gradient(circle at 82% 74%, rgba(239, 68, 68, 0.12), transparent 24%),
    linear-gradient(135deg, #f8fafc 0%, #e8eef6 100%);
  background-size: 36px 36px, 36px 36px, auto, auto, auto;
}

.leaflet-tracking-shell {
  display: grid;
  gap: 10px;
}

.leaflet-tracking-map {
  position: relative;
  width: 100%;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  z-index: 1;
}

.leaflet-tracking-map-focus {
  outline: 3px solid rgba(35, 65, 118, 0.24);
  outline-offset: 3px;
}

.leaflet-tracking-map .leaflet-control-container {
  font-family: inherit;
}

.leaflet-tracking-map .leaflet-control-container,
.leaflet-tracking-map .leaflet-pane,
.leaflet-tracking-map .leaflet-top,
.leaflet-tracking-map .leaflet-bottom {
  z-index: 20;
}

.leaflet-tracking-map .leaflet-control-zoom a {
  cursor: pointer;
}

.map-loading-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  background: var(--surface-2);
}

.tracking-map-inline-notice {
  min-height: 28px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.leaflet-tracking-marker {
  display: grid;
  place-items: center;
  gap: 2px;
  text-align: center;
  pointer-events: auto;
}

.leaflet-tracking-marker strong,
.leaflet-tracking-marker .leaflet-driver-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.leaflet-tracking-marker small {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.leaflet-tracking-marker.seller strong {
  background: var(--primary-2);
}

.leaflet-tracking-marker.customer strong {
  background: var(--danger);
}

.leaflet-tracking-marker.static-party strong {
  border-style: dashed;
}

.leaflet-tracking-marker.live-party strong {
  box-shadow: 0 0 0 4px rgba(27, 138, 122, 0.18), 0 8px 18px rgba(15, 23, 42, 0.18);
  animation: live-marker-pulse 2s ease-in-out infinite;
}

.leaflet-tracking-marker.online-driver-pin.fresh .leaflet-driver-icon {
  background: var(--success);
}

.leaflet-tracking-marker.online-driver-pin.stale .leaflet-driver-icon {
  background: #f59e0b;
}

.leaflet-tracking-marker.online-driver-pin.selected .leaflet-driver-icon {
  box-shadow: 0 0 0 4px rgba(35, 65, 118, 0.22), 0 8px 18px rgba(15, 23, 42, 0.18);
}

@keyframes live-marker-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.leaflet-tracking-marker.driver .leaflet-driver-icon {
  position: relative;
  width: 40px;
  height: 40px;
  background: var(--primary);
}

.leaflet-tracking-marker.driver .leaflet-driver-icon::before {
  content: "";
  position: absolute;
  inset-inline-start: 11px;
  top: 11px;
  width: 18px;
  height: 9px;
  border-radius: 8px 8px 4px 4px;
  background: #fff;
}

.leaflet-tracking-marker.driver .leaflet-driver-icon::after {
  content: "";
  position: absolute;
  inset-inline-start: 8px;
  bottom: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 18px 0 0 -2px var(--primary), 18px 0 0 0 #fff;
}

.tracking-route-map-focus {
  outline: 3px solid rgba(35, 65, 118, 0.24);
  outline-offset: 3px;
}

.tracking-route-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tracking-route-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.tracking-route-line.shadow {
  stroke: rgba(35, 65, 118, 0.16);
  stroke-width: 8;
}

.tracking-bike-pin,
.tracking-map-pin {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  transform: translate(-50%, -50%) !important;
  z-index: 4;
  pointer-events: none;
}

.tracking-bike-pin {
  width: 58px;
  height: 58px;
  background: var(--primary);
  font-size: 10px;
  line-height: 1;
  gap: 2px;
  box-shadow: 0 8px 20px rgba(35, 65, 118, 0.22);
  z-index: 8;
}

.tracking-bike-icon {
  position: relative;
  display: block;
  width: 32px;
  height: 18px;
}

.tracking-bike-icon::before {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  top: 3px;
  width: 17px;
  height: 8px;
  border-radius: 8px 8px 4px 4px;
  background: #fff;
}

.tracking-bike-icon::after {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  bottom: 0;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 18px 0 0 -2px var(--primary), 18px 0 0 0 #fff;
}

.tracking-bike-pin small {
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.tracking-map-pin {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.tracking-map-pin.seller {
  background: var(--primary-2);
}

.tracking-map-pin.customer {
  background: var(--danger);
}

.tracking-map-legend,
.tracking-map-status {
  position: absolute;
  display: flex;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  z-index: 4;
}

.tracking-map-legend {
  inset-inline-start: 12px;
  bottom: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
}

.tracking-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tracking-map-status {
  top: 12px;
  left: 12px;
  right: auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  z-index: 5;
}

.tracking-map-status strong {
  color: var(--primary);
}

.tracking-map-warning {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 12px;
  max-width: min(360px, calc(100% - 24px));
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, 0.36);
  border-radius: 999px;
  background: rgba(255, 251, 235, 0.96);
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
  z-index: 5;
}

.tracking-map-label {
  position: absolute;
  max-width: 160px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  transform: translate(-50%, calc(-100% - 12px)) !important;
  z-index: 7;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.tracking-map-label.driver {
  color: var(--primary);
}

.tracking-map-label.seller {
  color: var(--primary-2);
}

.tracking-map-label.customer {
  color: var(--danger);
}

.legend-bike,
.legend-dot {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
}

.legend-dot {
  border-radius: 50%;
  background: var(--primary);
}

.legend-dot.seller {
  background: var(--primary-2);
}

.legend-dot.customer {
  background: var(--danger);
}

.route-map-canvas {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    linear-gradient(rgba(35, 65, 118, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 65, 118, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 18% 22%, rgba(27, 138, 122, 0.14), transparent 26%),
    radial-gradient(circle at 82% 74%, rgba(239, 68, 68, 0.10), transparent 24%),
    linear-gradient(135deg, #f8fafc 0%, #e8eef6 100%);
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.route-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-map-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.route-map-line-shadow {
  stroke: rgba(35, 65, 118, 0.16);
  stroke-width: 5;
}

.route-map-pin {
  position: absolute;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.route-map-pin.start {
  background: var(--primary-2);
}

.route-map-pin.end {
  background: var(--danger);
}

.route-map-legend {
  position: absolute;
  inset-inline-start: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-xs);
}

.route-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.route-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.route-legend-dot.start {
  background: var(--primary-2);
}

.route-legend-dot.end {
  background: var(--danger);
}

.route-history-strip {
  position: relative;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--primary-soft), var(--primary-2-soft));
  overflow: hidden;
}

.route-history-strip::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 50%;
  height: 3px;
  background: rgba(35, 65, 118, 0.24);
  transform: translateY(-50%);
}

.route-point {
  position: absolute;
  left: calc(24px + (100% - 48px) * var(--point-index) / var(--point-total));
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--shadow-xs);
  transform: translate(-50%, -50%);
}

.route-point.start {
  background: var(--primary-2);
}

.route-point.end {
  width: 18px;
  height: 18px;
  background: var(--danger);
}

.document-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.doc-preview {
  width: 142px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  color: var(--primary);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
}

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

.doc-list-preview {
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  position: relative;
}

.doc-list-preview button {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.doc-file-preview,
.doc-text-preview {
  padding: 10px;
  text-align: center;
  line-height: 1.6;
}

.doc-text-preview {
  color: var(--text);
  font-size: 13px;
  overflow: auto;
}

.doc-preview[type="button"],
button.doc-preview {
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
}

.more-count {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-width: 34px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.78);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.document-info {
  min-width: 0;
}

.document-info h4,
.document-info p {
  margin-bottom: 6px;
}

.document-info p,
.document-info small {
  color: var(--muted);
}

.document-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.note-line {
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.document-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.empty-state {
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

/* ——— Toast & modal ——— */
.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  max-width: min(400px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--surface-3);
}

.manual-alert {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(11, 18, 32, 0.62);
  backdrop-filter: blur(5px);
}

.manual-alert-panel {
  width: min(920px, 100%);
  max-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.manual-alert-head,
.manual-alert-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--danger-soft);
  border-bottom: 1px solid #fecaca;
}

.manual-alert-head strong {
  display: block;
  color: var(--danger);
  font-size: 18px;
}

.manual-alert-head small {
  color: var(--text-soft);
  font-weight: 700;
}

.manual-alert-body {
  overflow: auto;
  padding: 16px;
  background: var(--surface);
}

.manual-alert-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface);
  justify-content: flex-start;
  flex-wrap: wrap;
}

.manual-alert-actions .primary-btn {
  width: auto;
}

.manual-order-list {
  display: grid;
  gap: 10px;
}

.manual-order-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.manual-order-card strong,
.manual-order-card small {
  display: block;
}

.manual-order-card small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.manual-order-details {
  display: grid;
  gap: 14px;
}

.manual-dispatch-map-panel {
  width: min(1180px, 100%);
  max-height: min(92vh, 900px);
}

.manual-dispatch-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.manual-dispatch-map-main {
  position: relative;
  min-height: 460px;
  border-inline-start: 1px solid var(--line);
}

.manual-dispatch-map-main .leaflet-tracking-map {
  min-height: 460px;
  height: 100%;
}

.manual-dispatch-driver-panel {
  overflow: auto;
  padding: 14px;
  background: var(--surface-2);
}

.manual-dispatch-driver-card {
  display: grid;
  gap: 12px;
}

.manual-dispatch-driver-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.manual-dispatch-driver-head strong {
  font-size: 17px;
}

.compact-details-grid {
  gap: 8px;
}

.leaflet-tracking-marker.manual-dispatch-driver-pin {
  cursor: pointer;
}

.leaflet-tracking-marker.manual-dispatch-driver-pin.selected .leaflet-driver-icon {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
  transform: scale(1.08);
}

.manual-dispatch-bonus-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 12px;
}

.manual-dispatch-bonus-field {
  display: grid;
  gap: 6px;
}

.manual-dispatch-bonus-field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.manual-dispatch-bonus-field input {
  width: 100%;
}

.manual-dispatch-bonus-field small {
  color: var(--text-muted);
  font-size: 12px;
}

.manual-dispatch-bonus-preview {
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  background: #f8fbff;
  display: grid;
  gap: 8px;
}

.manual-dispatch-bonus-preview strong {
  font-size: 13px;
  color: var(--primary);
}

.manual-assign-bonus-panel .panel-subtitle {
  margin: 4px 0 0;
}

.manual-assign-bonus-form {
  display: grid;
  gap: 16px;
  max-width: 720px;
}

.manual-assign-bonus-field {
  display: grid;
  gap: 6px;
}

.manual-assign-bonus-field span {
  font-size: 14px;
  font-weight: 800;
}

.manual-assign-bonus-field small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.manual-assign-bonus-summary {
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  background: #f8fbff;
  display: grid;
  gap: 10px;
}

.manual-assign-bonus-summary strong {
  color: var(--primary);
  font-size: 13px;
}

.form-warning {
  margin: 0;
  color: #b45309;
  font-size: 12px;
  line-height: 1.45;
}

.manual-order-summary {
  padding: 16px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
}

.manual-order-summary h3 {
  margin: 8px 0 4px;
  color: var(--text);
}

.manual-order-summary p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.manual-items {
  display: grid;
  gap: 8px;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 18, 32, 0.78);
  backdrop-filter: blur(6px);
}

.media-viewer-panel {
  width: min(980px, 100%);
  max-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.media-viewer-head,
.media-viewer-actions {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.media-viewer-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  flex-wrap: wrap;
  background: var(--surface);
}

.media-viewer-body {
  min-height: 320px;
  display: grid;
  place-items: center;
  background: #0f1725;
  overflow: auto;
}

.wallet-dialog-body {
  display: block;
  place-items: initial;
  width: 100%;
  padding: 16px;
  background: var(--surface);
}

.wallet-dialog-body .compact-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.media-viewer-body img,
.media-viewer-body video {
  max-width: 100%;
  max-height: 640px;
  display: block;
  object-fit: contain;
}

.media-nav-actions,
.media-review-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-note-input {
  width: min(360px, 70vw);
}

/* ——— Tablet ——— */
@media (max-width: 1024px) {
  :root {
    --content-pad: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(340px, 92vw);
    max-width: 100%;
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar-card {
    top: 8px;
  }

  .topbar-main {
    flex-wrap: wrap;
    width: 100%;
  }

  .admin-form.invite-form,
  .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ——— Mobile ——— */
@media (max-width: 768px) {
  :root {
    --content-pad: 14px;
  }

  .auth-shell {
    padding: 16px;
  }

  .auth-card-brand {
    padding: 22px 20px 16px;
  }

  .auth-card .form-stack {
    padding: 20px;
  }

  .stats-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px 14px;
    gap: 16px;
  }

  .nav-list {
    gap: 12px;
  }

  .nav-btn {
    min-height: 44px;
  }

  .dashboard-action-list {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .notif-wrap {
    width: 100%;
  }

  .notif-btn {
    width: 100%;
    justify-content: center;
  }

  .notif-panel {
    left: auto;
    right: 0;
    width: 100%;
  }

  .admin-pill,
  .admin-email {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .topbar-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-row {
    justify-content: stretch;
  }

  .segmented-control {
    width: 100%;
  }

  .segment-btn {
    flex: 1;
    min-width: 0;
    padding-inline: 8px;
    font-size: 12px;
  }

  .search-input,
  .select-input {
    width: 100%;
    flex: 1 1 100%;
  }

  .admin-form.invite-form,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

  table.data-table {
    min-width: 0;
  }

  table.data-table thead {
    display: none;
  }

  table.data-table tbody tr {
    display: block;
    margin: 0 14px 14px;
    padding: 4px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  table.data-table tbody tr:hover td {
    background: transparent;
  }

  table.data-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    min-height: 44px;
  }

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

  table.data-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    max-width: 42%;
    color: var(--muted);
    font-weight: 800;
    font-size: 11px;
    line-height: 1.5;
    text-align: right;
  }

  table.data-table tbody td:empty::before {
    display: none;
  }

  table.data-table tbody td[colspan]::before {
    display: none;
  }

  table.data-table tbody td[colspan] {
    display: block;
    text-align: center;
    padding: 20px;
  }

  table.data-table tbody td select {
    width: 100%;
    max-width: 100%;
  }

  table.data-table tbody td .row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  table.data-table tbody td .mini-btn {
    flex: 1 1 auto;
  }

  .document-card,
  .document-main,
  .delivery-card-head {
    grid-template-columns: 1fr;
  }

  .document-main {
    gap: 10px;
  }

  .doc-preview {
    width: 100%;
    max-width: 200px;
  }

  .document-actions {
    justify-content: stretch;
    width: 100%;
  }

  .document-actions .mini-btn {
    flex: 1 1 auto;
  }

  .delivery-status-box {
    justify-items: stretch;
  }

  .vendor-profile {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .vendor-doc-stats {
    width: 100%;
  }

  .vendor-doc-stats span {
    flex: 1 1 auto;
    justify-content: center;
  }

  .media-viewer {
    padding: 10px;
  }

  .manual-alert {
    padding: 10px;
  }

  .manual-order-card {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-order-card .mini-btn,
  .manual-alert-actions .primary-btn,
  .manual-alert-actions .mini-btn {
    width: 100%;
  }

  .manual-dispatch-map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 48vh) auto;
  }

  .manual-dispatch-map-main {
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }

  .manual-dispatch-driver-panel {
    max-height: 38vh;
  }

  .manual-dispatch-bonus-fields {
    grid-template-columns: 1fr;
    padding-inline: 12px;
  }

  .media-viewer-panel {
    max-height: 94dvh;
    border-radius: var(--radius-md);
  }

  .media-nav-actions,
  .media-review-actions,
  .review-note-input {
    width: 100%;
  }

  .media-review-actions .mini-btn,
  .media-nav-actions .mini-btn {
    flex: 1;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .eyebrow {
    font-size: 10px;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .mini-btn {
    min-height: 40px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .nav-group-title {
    font-size: 10px;
  }

  .dashboard-action-card {
    min-height: auto;
  }

  .delivery-doc-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


.admin-section-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 14px;
}

.admin-info-card,
.admin-proof-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.admin-info-card-wide {
  grid-column: 1 / -1;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-action-box {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-action-box-wide {
  grid-column: span 2;
}

.admin-action-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-action-box strong {
  overflow-wrap: anywhere;
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-proof-image {
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
}

.admin-proof-image img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #0f172a;
}

.admin-tracking-map {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.admin-tracking-grid {
  padding-inline: 0;
}

@media (max-width: 760px) {
  .admin-section-grid {
    grid-template-columns: 1fr;
  }

  .operations-detail-hero,
  .operations-linked-card,
  .operations-issue-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .operations-section-grid {
    grid-template-columns: 1fr;
  }

  .operations-hero-actions,
  .operations-issue-actions {
    justify-content: stretch;
  }

  .operations-hero-actions .mini-btn,
  .operations-issue-actions .mini-btn,
  .operations-issue-actions .primary-btn {
    width: 100%;
  }
  .admin-action-box-wide {
    grid-column: auto;
  }
  .admin-tracking-map {
    min-height: 280px;
  }
}

.compact-stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 16px;
}

.code-block {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f4f6f8;
  border: 1px solid #e6eaf0;
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
}

.reason-editor-list {
  display: grid;
  gap: 12px;
}

.reason-editor-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr repeat(3, auto) auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.reason-editor-row input[type="text"],
.reason-editor-row input[type="number"] {
  width: 100%;
  min-width: 0;
}

.reason-editor-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.action-reason-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (max-width: 1100px) {
  .reason-editor-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Performance guard: keep hover stable on large admin pages. */
*,
*::before,
*::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}

.app-shell *,
.app-shell *::before,
.app-shell *::after {
  filter: none !important;
  backdrop-filter: none !important;
}

button:hover,
a:hover,
summary:hover,
input:hover,
select:hover,
textarea:hover,
.nav-btn:hover,
.primary-btn:hover,
.ghost-btn:hover,
.mini-btn:hover,
.icon-btn:hover,
.stat-card:hover,
.dashboard-action-card:hover,
.operations-stat-card:hover,
.segment-btn:hover,
.notif-item:hover,
.compact-item:hover,
.document-card:hover,
.delivery-doc-card:hover,
.doc-group summary:hover {
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

tbody tr:hover td {
  background: inherit !important;
}

.support-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-chat-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 14px;
  min-height: 520px;
}

.support-chat-sidebar {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.support-chat-threads {
  max-height: 560px;
  overflow: auto;
}

.support-chat-thread-item {
  width: 100%;
  text-align: right;
  border: none;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  cursor: pointer;
  padding: 12px 14px;
}

.support-chat-thread-item.active {
  background: #eef3fb;
}

.support-chat-thread-item:hover {
  background: #f8fafc;
}

.support-chat-main {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: #fff;
  min-height: 520px;
}

.support-chat-user-card {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
}

.support-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.support-chat-bubble {
  max-width: min(78%, 520px);
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
}

.support-chat-bubble.admin {
  align-self: flex-start;
  background: #234176;
  color: #fff;
}

.support-chat-bubble.user {
  align-self: flex-end;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111827;
}

.support-chat-bubble-meta {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.75;
}

.support-chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #eef2f7;
}

@media (max-width: 980px) {
  .support-chat-layout {
    grid-template-columns: 1fr;
  }
}


.seller-item-details-head {
  align-items: stretch;
  gap: 18px;
}

.seller-item-details-image {
  width: 180px;
  max-width: 100%;
  flex: 0 0 180px;
}

.seller-item-image-button,
.seller-item-image-empty {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.seller-item-image-button {
  padding: 0;
  cursor: pointer;
}

.seller-item-image-button img,
.seller-item-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seller-item-details-actions {
  align-self: flex-start;
  margin-inline-start: auto;
}

.seller-item-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.seller-item-gallery button {
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}


@media (max-width: 760px) {
  .seller-item-details-head {
    display: grid;
  }

  .seller-item-details-image {
    width: 100%;
    flex-basis: auto;
  }

  .seller-item-details-actions {
    margin-inline-start: 0;
  }
}
