/**
 * ChattyCourier Admin — Packo-inspired professional dashboard theme
 */

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

:root {
  --pk-primary: #6c5ce7;
  --pk-primary-hover: #5b4bd4;
  --pk-primary-soft: #f0edff;
  --pk-primary-muted: #e8e4ff;
  --pk-bg: #f4f6f9;
  --pk-surface: #ffffff;
  --pk-text: #1a1d26;
  --pk-muted: #6b7280;
  --pk-border: #e8eaef;
  --pk-shadow: 0 1px 3px rgba(26, 29, 38, 0.06), 0 4px 12px rgba(26, 29, 38, 0.04);
  --pk-radius: 14px;
  --pk-radius-sm: 10px;
  --pk-success: #10b981;
  --pk-warning: #f59e0b;
  --pk-danger: #ef4444;
  --pk-sidebar-w: 260px;
  --pk-sidebar-bg: #4a2f8a;
  --pk-sidebar-bg-hover: rgba(255, 255, 255, 0.1);
  --pk-sidebar-active: rgba(255, 255, 255, 0.16);
  --pk-sidebar-text: rgba(255, 255, 255, 0.78);
  --pk-sidebar-accent: #f5b942;
  --pk-shell-bg: #ebe8f3;
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", system-ui, sans-serif !important;
  background: var(--pk-shell-bg) !important;
  color: var(--pk-text);
  font-size: 14px;
}

/* ── Shell layout (wefha-style purple sidebar) ── */
.wd-admin-shell {
  display: flex;
  min-height: 100vh;
  background: var(--pk-shell-bg);
}

.wd-sidebar {
  width: var(--pk-sidebar-w);
  min-width: var(--pk-sidebar-w);
  background: var(--pk-sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 0 1rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.wd-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.15rem 1.15rem;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 0.85rem;
}

.wd-sidebar-logo-img,
.wd-brand-mark-lg-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
}

.wd-brand-mark-lg-img {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
}

.wd-sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wd-sidebar-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.wd-sidebar-nav {
  flex: 1;
  padding: 0 0.75rem;
  overflow-y: auto;
}

.wd-sidebar-nav .navbar-nav {
  flex-direction: column !important;
  width: 100%;
}

.wd-sidebar-nav .nav-item {
  width: 100%;
  margin-bottom: 3px;
}

.wd-sidebar-nav .nav-link,
.wd-sidebar-nav .wd-nav-link {
  color: var(--pk-sidebar-text) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.62rem 0.85rem !important;
  border-radius: 12px;
  border-left: 4px solid transparent;
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.wd-sidebar-nav .nav-link .nav-link-icon,
.wd-sidebar-nav .wd-nav-link .wd-nav-icon {
  width: 1.15rem;
  text-align: center;
  opacity: 0.92;
  flex-shrink: 0;
}

.wd-sidebar-nav .nav-link .nav-link-icon .ti,
.wd-sidebar-nav .wd-nav-link .wd-nav-icon .ti {
  font-size: 1.1rem;
}

.wd-sidebar-nav .nav-link:hover,
.wd-sidebar-nav .wd-nav-link:hover {
  background: var(--pk-sidebar-bg-hover);
  color: #fff !important;
  text-decoration: none;
}

.wd-sidebar-nav .nav-link.active,
.wd-sidebar-nav .wd-nav-link.active {
  background: var(--pk-sidebar-active) !important;
  color: #fff !important;
  font-weight: 600;
  border-left-color: var(--pk-sidebar-accent);
}

.wd-sidebar-nav .dropdown-menu {
  position: static !important;
  transform: none !important;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0.15rem 0 0.35rem 0.35rem;
  margin: 0;
  display: block !important;
}

.wd-sidebar-nav .dropdown-toggle::after {
  margin-left: auto;
  opacity: 0.65;
}

.wd-sidebar-nav .nav-item.dropdown > .nav-link {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92) !important;
}

.wd-sidebar-nav .dropdown-menu .nav-link {
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem 0.5rem 1.65rem !important;
}

/* Collapsible sidebar sections */
.wd-nav-section {
  list-style: none;
  margin: 0.65rem 0.75rem 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.wd-nav-section:first-child {
  margin-top: 0.15rem;
  padding-top: 0;
  border-top: none;
}
.wd-nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: calc(100% - 0.5rem);
  margin: 0 0.25rem;
  padding: 0.35rem 0.5rem 0.15rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--pk-sidebar-accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.wd-sidebar-nav .wd-nav-section-toggle.wd-nav-section-label-btn {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--pk-sidebar-accent, #f5b942) !important;
  padding: 0.35rem 0.5rem 0.15rem !important;
  border-radius: 0 !important;
  border-left: none !important;
}
.wd-nav-section-toggle .wd-nav-section-label-text {
  flex: 1;
}
.wd-nav-section-toggle .nav-link-icon {
  opacity: 0.95;
  color: var(--pk-sidebar-accent);
}
.wd-nav-section-toggle .nav-link-icon .ti {
  font-size: 0.95rem;
}
.wd-nav-section-toggle:hover,
.wd-nav-section-toggle.active {
  background: rgba(245, 185, 66, 0.12);
  color: #ffe8a3;
}
.wd-nav-section-toggle .wd-nav-chevron {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.75;
  color: rgba(255, 255, 255, 0.55);
  transition: transform 0.2s;
}
.wd-nav-section-toggle[aria-expanded="true"] .wd-nav-chevron {
  transform: rotate(180deg);
}
.wd-nav-section-items {
  list-style: none;
  margin: 0.2rem 0 0.15rem;
  padding: 0.15rem 0 0.15rem 0.35rem;
  display: none;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}
.wd-nav-section-items.is-open {
  display: block;
}
.wd-nav-section-items .nav-link,
.wd-nav-section-items .wd-nav-child {
  padding-left: 1.85rem !important;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.82) !important;
  font-weight: 500;
}
.wd-nav-section-items .nav-link .nav-link-icon,
.wd-nav-section-items .wd-nav-child .nav-link-icon {
  opacity: 0.78;
}
.wd-nav-section-items .nav-link.active,
.wd-nav-section-items .wd-nav-child.active {
  color: #fff !important;
}

.wd-sidebar-footer {
  padding: 0.75rem 0.75rem 0;
  margin-top: auto;
}

.wd-sidebar-promo {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-bottom: 0.65rem;
}

.wd-sidebar-promo-title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.wd-sidebar-promo-text {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.wd-sidebar-promo-btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--pk-sidebar-accent);
  color: #3d2a00;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.wd-sidebar-promo-btn:hover {
  background: #ffc857;
  color: #3d2a00;
  text-decoration: none;
}

.wd-sidebar-logout {
  margin: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  width: 100%;
}

.wd-sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.wd-admin-main {
  flex: 1;
  margin: 0.75rem 0.85rem 0.75rem var(--pk-sidebar-w);
  min-height: calc(100vh - 1.5rem);
  display: flex;
  flex-direction: column;
  background: var(--pk-surface);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(74, 47, 138, 0.12);
  overflow: hidden;
}

.wd-topbar {
  background: var(--pk-surface);
  border-bottom: 1px solid var(--pk-border);
  padding: 1.1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wd-topbar-welcome {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--pk-bg);
  color: var(--pk-muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.wd-topbar-welcome i { color: var(--pk-primary); }

.wd-topbar-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wd-topbar-sub {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--pk-muted);
}

.wd-page-content {
  padding: 1.5rem 1.75rem 2rem;
  flex: 1;
}

/* ── Vertical forms (label above field) ── */
.pk-form-field,
.form-group.row {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group.row .form-label,
.form-group.row > label,
.pk-form-field .form-label {
  width: 100%;
  max-width: 100%;
  flex: none;
  padding: 0;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pk-muted);
}

.form-group.row > .col-sm-10,
.form-group.row > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  flex: none;
  padding: 0;
}

.pk-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 36rem;
}

.pk-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--pk-border);
}

.pk-form-actions-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-fieldset .form-control,
.form-fieldset .form-select,
.pk-form-field .form-control,
.pk-form-field .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--pk-radius-sm);
  border-color: var(--pk-border);
}

.form-fieldset .form-control:focus,
.form-fieldset .form-select:focus {
  border-color: var(--pk-primary);
  box-shadow: 0 0 0 3px var(--pk-primary-soft);
}

@media (max-width: 991px) {
  .wd-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }
  .wd-admin-shell.wd-sidebar-open .wd-sidebar { transform: translateX(0); }
  .wd-admin-main {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }
}

/* Hide default tabler wrapper if leaked */
.wrapper > .navbar-vertical { display: none !important; }
.page-wrapper { margin: 0 !important; }

/* ── Buttons ── */
.btn-primary {
  background: var(--pk-primary) !important;
  border-color: var(--pk-primary) !important;
  border-radius: var(--pk-radius-sm) !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
}
.btn-primary:hover {
  background: var(--pk-primary-hover) !important;
  border-color: var(--pk-primary-hover) !important;
}
.btn-outline-secondary {
  border-radius: var(--pk-radius-sm) !important;
  border-color: var(--pk-border) !important;
  color: var(--pk-muted) !important;
}
.btn-success { border-radius: var(--pk-radius-sm) !important; }

/* ── Cards ── */
.card, .pk-card {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border) !important;
  border-radius: var(--pk-radius) !important;
  box-shadow: var(--pk-shadow) !important;
}
.card-header, .pk-card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--pk-border) !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1rem 1.25rem;
}
.card-body, .pk-card-body { padding: 1.25rem; }

/* ── Metric cards (Packo style) ── */
.pk-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.pk-metric {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--pk-shadow);
  position: relative;
}
.pk-metric-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--pk-muted);
  margin-bottom: 0.35rem;
}
.pk-metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.pk-metric-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--pk-primary-soft);
  color: var(--pk-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.pk-metric-foot {
  font-size: 0.72rem;
  color: var(--pk-muted);
  margin-top: 0.5rem;
}
.pk-metric.warn .pk-metric-value { color: var(--pk-danger); }
.pk-metric.warn .pk-metric-icon { background: #fef2f2; color: var(--pk-danger); }

/* Legacy stat grid */
.wd-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.wd-stat-card {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--pk-shadow);
}
.wd-stat-card .label { font-size: 0.78rem; color: var(--pk-muted); font-weight: 500; margin-bottom: 0.35rem; }
.wd-stat-card .value { font-size: 1.5rem; font-weight: 700; }

/* ── Tables (base) — extended in List views section below ── */

/* Map marker hover cards */
.pk-map-tip { font-family: "Inter", system-ui, sans-serif; font-size: 0.8rem; color: var(--pk-text); max-width: 300px; }
.pk-map-tip-head { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.35rem; }
.pk-map-tip-dl { margin: 0.5rem 0 0; display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.2rem 0.5rem; }
.pk-map-tip-dl dt { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; color: var(--pk-muted); margin: 0; }
.pk-map-tip-dl dd { margin: 0; font-size: 0.78rem; line-height: 1.35; }
.pk-map-tip-foot { margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid var(--pk-border); font-size: 0.72rem; color: var(--pk-muted); }
.gm-style .gm-style-iw-c { border-radius: 12px !important; padding: 0 !important; }
.gm-style .gm-style-iw-d { overflow: auto !important; padding: 0.75rem 0.85rem !important; }

/* Status badges */
.pk-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.pk-badge--matching, .pk-badge--paid { background: var(--pk-primary-soft); color: var(--pk-primary); }
.pk-badge--assigned, .pk-badge--picked_up, .pk-badge--in_transit, .pk-badge--pod_pending { background: #dbeafe; color: #1d4ed8; }
.pk-badge--delivered, .pk-badge--closed, .pk-badge--approved { background: #d1fae5; color: #047857; }
.pk-badge--late { background: #fef2f2; color: var(--pk-danger); animation: pk-blink 1.2s ease-in-out infinite; }
.pk-badge--rejected, .pk-badge--cancelled { background: #fef2f2; color: var(--pk-danger); }
.pk-badge--pending, .pk-badge--review, .pk-badge--quoted, .pk-badge--awaiting_payment { background: #fef3c7; color: #92400e; }
.pk-badge--collected, .pk-badge--cod { background: #dbeafe; color: #1d4ed8; }
.pk-badge--resolved { background: #d1fae5; color: #047857; }
.pk-badge--waived { background: #f3f4f6; color: #6b7280; }
.pk-badge--trialing { background: #e0e7ff; color: #4338ca; }
.pk-badge--expired, .pk-badge--past_due, .pk-badge--pending_payment { background: #fef2f2; color: #b91c1c; }

.pk-inline-actions summary { cursor: pointer; list-style: none; }
.pk-inline-actions summary::-webkit-details-marker { display: none; }
.pk-action-panel {
  margin-top: 0.5rem;
  padding: 0.75rem;
  min-width: 16rem;
  background: var(--pk-bg, #f8fafc);
  border: 1px solid var(--pk-border, #e5e7eb);
  border-radius: var(--pk-radius-sm, 8px);
}
.pk-badge--offline, .pk-badge--suspended { background: #f3f4f6; color: #6b7280; }
.pk-badge--available, .pk-badge--busy { background: #dbeafe; color: #1d4ed8; }

@keyframes pk-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ── Fleet map ── */
.pk-map-panel {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.pk-map-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--pk-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.pk-map-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }
#wd-fleet-map {
  height: min(58vh, 520px);
  min-height: 380px;
  width: 100%;
}
.pk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--pk-muted);
}
.pk-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.pk-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pk-dot-rider { background: #3b82f6; }
.pk-dot-pickup { background: var(--pk-primary); }
.pk-dot-dropoff { background: #8b5cf6; }
.pk-dot-late { background: var(--pk-danger); animation: pk-blink 1s infinite; }

/* ── Login ── */
.wd-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0edff 0%, var(--pk-bg) 50%, #e8eaef 100%);
}
.wd-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: 18px;
  padding: 2.25rem;
  box-shadow: 0 12px 40px rgba(108, 92, 231, 0.12);
}
.wd-brand { text-align: center; margin-bottom: 2rem; }
.wd-brand-mark-lg {
  width: 52px; height: 52px; margin: 0 auto 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pk-primary), #8b7cf7);
  color: #fff; font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.wd-brand h1 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.wd-brand p { margin: 0.35rem 0 0; color: var(--pk-muted); font-size: 0.9rem; }
.wd-login-card .form-control {
  padding: 0.7rem 0.9rem;
  border-radius: var(--pk-radius-sm);
  border-color: var(--pk-border);
}
.wd-login-card .form-label { font-size: 0.8rem; font-weight: 600; color: var(--pk-muted); }
.wd-login-card .btn-primary { width: 100%; padding: 0.75rem; margin-top: 0.5rem; }
.wd-login-foot { margin-top: 1.25rem; font-size: 0.75rem; color: #9ca3af; text-align: center; }

/* ── Test chat ── */
#wd-test-chat .wd-tc-hint {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--pk-muted);
}
#wd-test-chat .wd-tc-hint code {
  font-size: 0.82rem;
  background: var(--pk-primary-soft);
  color: var(--pk-primary);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
#wd-test-chat .wd-tc-role {
  display: none;
  margin-bottom: 1rem;
  padding: 0.55rem 0.85rem;
  background: var(--pk-primary-soft);
  color: var(--pk-primary);
  border-radius: var(--pk-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}
#wd-test-chat .wd-tc-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}
#wd-test-chat .wd-tc-grid.wd-tc-grid-3 {
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr) minmax(14rem, 17rem);
}
@media (max-width: 1100px) {
  #wd-test-chat .wd-tc-grid,
  #wd-test-chat .wd-tc-grid.wd-tc-grid-3 { grid-template-columns: 1fr; }
}
#wd-test-chat .wd-tc-context {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--pk-radius-sm);
  font-size: 0.8rem;
  color: #1e3a5f;
}
#wd-test-chat .wd-tc-quick-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.65rem;
}
#wd-test-chat .wd-tc-quick-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pk-muted);
  margin-right: 0.25rem;
}
#wd-test-chat .wd-tc-live-panel {
  margin-bottom: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius-sm);
  background: #f8fafc;
}
#wd-test-chat .wd-tc-live-panel.is-rider-active {
  border-color: #6ee7b7;
  background: #ecfdf5;
}
#wd-test-chat .wd-tc-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
#wd-test-chat .wd-tc-live-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pk-muted);
}
#wd-test-chat .wd-tc-live-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
#wd-test-chat .wd-tc-live-badge--on { background: #dcfce7; color: #166534; }
#wd-test-chat .wd-tc-live-badge--warn { background: #fef3c7; color: #92400e; }
#wd-test-chat .wd-tc-live-badge--off { background: #e2e8f0; color: #475569; }
#wd-test-chat .wd-tc-live-note { margin: 0 0 0.5rem; line-height: 1.4; }
#wd-test-chat .wd-tc-live-status {
  margin-bottom: 0.55rem;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}
#wd-test-chat .wd-tc-live-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
#wd-test-chat .wd-tc-live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
#wd-test-chat .wd-tc-live-trip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #cbd5e1;
}
#wd-test-chat .wd-tc-live-trip-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pk-muted);
}
#wd-test-chat .wd-tc-live-autoping {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  margin: 0;
  color: var(--pk-muted);
}
#wd-test-chat .wd-tc-personas .card-body {
  max-height: min(68vh, 640px);
  overflow-y: auto;
}
#wd-test-chat .wd-tc-personas-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pk-muted);
  margin: 0.75rem 0 0.4rem;
}
#wd-test-chat .wd-tc-personas-label:first-child { margin-top: 0; }
#wd-test-chat .wd-tc-persona-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
#wd-test-chat .wd-tc-persona {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--pk-border);
  border-radius: 8px;
  background: var(--pk-surface);
  font-size: 0.78rem;
  cursor: pointer;
}
#wd-test-chat .wd-tc-persona:hover { border-color: var(--pk-primary); }
#wd-test-chat .wd-tc-persona.is-active {
  border-color: var(--pk-primary);
  background: #eff6ff;
  font-weight: 600;
}
#wd-test-chat .wd-tc-persona.is-rider { border-left: 3px solid #059669; }
#wd-test-chat .wd-tc-persona.is-customer { border-left: 3px solid #2563eb; }
#wd-test-chat .wd-tc-personas-foot { margin-top: 0.85rem; margin-bottom: 0; line-height: 1.45; }
#wd-test-chat .wd-tc-composer .card-header,
#wd-test-chat .wd-tc-conversation .card-header {
  background: #fafbfc;
  border-bottom: 1px solid var(--pk-border);
  padding: 0.85rem 1.15rem;
}
#wd-test-chat .wd-tc-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
#wd-test-chat .wd-tc-conv-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
#wd-test-chat .wd-tc-conv-hint {
  font-size: 0.75rem;
  color: var(--pk-muted);
  font-weight: 400;
}
#wd-test-chat .wd-tc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#wd-test-chat .wd-tc-recording {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--pk-danger);
  font-weight: 600;
}
#wd-test-chat .wd-tc-preview {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--pk-muted);
}
#wd-test-chat .wd-tc-image-preview {
  margin-top: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--pk-border);
  border-radius: var(--pk-radius-sm);
  background: #f8fafc;
}
#wd-test-chat .wd-tc-image-preview-img {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--pk-border);
  flex-shrink: 0;
}
#wd-test-chat .wd-tc-image-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
#wd-test-chat .wd-tc-image-preview-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pk-text);
  word-break: break-all;
}
#wd-test-chat .wd-tc-image-preview-hint {
  font-size: 0.78rem;
  color: var(--pk-muted);
}
#wd-test-chat .wd-tc-err {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fef2f2;
  color: var(--pk-danger);
  border-radius: var(--pk-radius-sm);
  font-size: 0.82rem;
}
#wd-test-chat .wd-tc-conv-body {
  padding: 0 !important;
}
#wd-test-chat .wd-tc-pinned {
  margin-bottom: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}
#wd-test-chat .wd-tc-pinned-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b45309;
  margin-bottom: 0.45rem;
}
#wd-test-chat .wd-tc-pinned-ref {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #92400e;
}
#wd-test-chat .wd-tc-pinned-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #1f2937;
  background: transparent;
  border: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

#wd-test-chat .wd-tc-log {
  min-height: 420px;
  max-height: min(68vh, 640px);
  overflow-y: auto;
  padding: 1rem 1.15rem;
  background: linear-gradient(180deg, #f8f9fb 0%, #f3f4f6 100%);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
#wd-test-chat .wd-tc-empty {
  margin: auto;
  max-width: 22rem;
  text-align: center;
  color: var(--pk-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 2rem 1rem;
}
#wd-test-chat .wd-tc-msg-row {
  display: flex;
  width: 100%;
}
#wd-test-chat .wd-tc-msg-row.is-user { justify-content: flex-end; }
#wd-test-chat .wd-tc-msg-row.is-bot { justify-content: flex-start; }
#wd-test-chat .wd-tc-msg {
  max-width: min(88%, 28rem);
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--pk-border);
  background: var(--pk-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
#wd-test-chat .wd-tc-msg.is-user {
  background: var(--pk-primary);
  border-color: var(--pk-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
#wd-test-chat .wd-tc-msg.is-bot {
  border-bottom-left-radius: 4px;
}
#wd-test-chat .wd-tc-who {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  opacity: 0.85;
}
#wd-test-chat .wd-tc-msg.is-bot .wd-tc-who { color: var(--pk-primary); }
#wd-test-chat .wd-tc-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.45;
}
#wd-test-chat .wd-tc-media {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 0.45rem;
}
#wd-test-chat .wd-tc-media.is-customer-photo {
  max-width: min(100%, 16rem);
  max-height: 14rem;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: zoom-in;
}
#wd-test-chat .wd-tc-media.is-bot-photo {
  max-width: min(100%, 16rem);
  max-height: 14rem;
  object-fit: cover;
  border: 1px solid var(--pk-border);
  cursor: zoom-in;
}
#wd-test-chat .wd-tc-msg.is-user .wd-tc-text {
  margin-top: 0.15rem;
}
#wd-test-chat .wd-tc-audio {
  display: block;
  width: 100%;
  max-width: 16rem;
  margin-bottom: 0.35rem;
}
#wd-test-chat .wd-tc-transcript {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.78rem;
  opacity: 0.9;
}
#wd-test-chat .wd-tc-msg.is-bot .wd-tc-transcript {
  border-top-color: var(--pk-border);
  color: var(--pk-muted);
}

/* ── Misc ── */
.page-title { font-weight: 700 !important; letter-spacing: -0.02em; }
.text-muted { color: var(--pk-muted) !important; }
.wd-json-block {
  background: #fafbfc;
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius-sm);
  padding: 1rem;
  font-size: 0.8rem;
  white-space: pre-wrap;
  margin: 0;
}
.wd-zone-bar { background: linear-gradient(90deg, var(--pk-primary), #8b7cf7); height: 8px; border-radius: 4px; }
.wd-chat-log { max-height: 280px; overflow-y: auto; }
.wd-chat-row { padding: 0.6rem 1rem; border-bottom: 1px solid var(--pk-border); font-size: 0.875rem; }
.alert { border-radius: var(--pk-radius-sm) !important; }
.page-body .row-deck > .col-12 { display: block !important; width: 100% !important; flex: 0 0 100% !important; }

/* List views (sqladmin CRUD) */
.page-wrapper .page-body { background: var(--pk-bg); }
.pk-table-page { display: block; width: 100%; }
.pk-table-card { width: 100%; overflow: hidden; }
.pk-table-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem !important;
  background: transparent !important;
  border-bottom: 1px solid var(--pk-border) !important;
}
.pk-table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}
.pk-table-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.pk-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
}
.pk-table-search {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--pk-bg);
  border: 1px solid var(--pk-border);
  border-radius: 10px;
  padding: 0.2rem 0.35rem 0.2rem 0.65rem;
  flex: 1 1 auto;
  max-width: 300px;
  min-width: 160px;
}
.pk-table-search > .ti-search {
  color: var(--pk-muted);
  font-size: 1rem;
  flex-shrink: 0;
}
.pk-table-search .form-control {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0.35rem 0.35rem;
  font-size: 0.85rem;
  min-width: 0;
  flex: 1;
}
.pk-table-search .form-control:focus { box-shadow: none; }
.pk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--pk-muted);
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
}
.pk-icon-btn:hover:not(:disabled) {
  background: var(--pk-primary-soft);
  color: var(--pk-primary);
}
.pk-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pk-table-toolbar .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.pk-table-toolbar .btn-sm .ti { font-size: 1rem; }
.pk-table-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}
.pk-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--pk-primary-soft);
  color: var(--pk-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none !important;
}
.pk-filter-chip .ti { font-size: 0.85rem; opacity: 0.85; }
.pk-filter-chip:hover {
  background: var(--pk-primary-muted);
  color: var(--pk-primary-hover);
}
.pk-filter-clear {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pk-muted);
  text-decoration: none;
  padding: 0.25rem 0.35rem;
}
.pk-filter-clear:hover { color: var(--pk-primary); }
.pk-filter-menu {
  min-width: 14rem;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.35rem;
}
.pk-filter-group + .pk-filter-group {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--pk-border);
}
.pk-filter-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pk-muted);
  padding: 0.35rem 0.65rem 0.25rem;
}
.pk-filter-option.active {
  background: var(--pk-primary-soft);
  color: var(--pk-primary);
  font-weight: 600;
}
.pk-table-bulk {
  background: #fafbfc;
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
}
.pk-table-bulk-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pk-table-bulk-row .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.pk-table-footer { background: #fafbfc; border-top: 1px solid var(--pk-border) !important; }
.pk-table-count { font-size: 0.82rem; }
.pk-sort-icon { font-size: 0.75rem; opacity: 0.75; }
.pk-col-check { width: 2.5rem; }
.pk-col-actions { width: 6.5rem; text-align: right; white-space: nowrap; }
.pk-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
}
.pk-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  cursor: pointer;
}
.pk-action-btn .ti {
  font-size: 1.05rem;
  stroke-width: 1.5;
}
.pk-action-btn:hover {
  background: var(--pk-primary-soft);
  color: var(--pk-primary);
}
.pk-action-btn--danger:hover {
  background: #fef2f2;
  color: var(--pk-danger);
}
.pk-action-btn--success:hover {
  background: #ecfdf5;
  color: var(--pk-success);
}
@media (max-width: 900px) {
  .pk-table-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .pk-table-toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .pk-table-search {
    max-width: none;
    width: 100%;
    order: -1;
  }
}
.page-body .table, .pk-table {
  font-size: 0.875rem;
  margin: 0;
}
.page-body .table thead th, .pk-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pk-muted);
  background: #fafbfc;
  border-bottom: 1px solid var(--pk-border) !important;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}
.page-body .table td, .pk-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-color: var(--pk-border) !important;
  border-left: none;
  border-right: none;
}
.page-body .table tbody tr:hover, .pk-table tbody tr:hover { background: #fafbfc; }
.page-body .table tbody tr.pk-row-highlight, .pk-table tbody tr.pk-row-highlight { background: var(--pk-primary-soft) !important; }
.pk-table code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.pk-inline-reprice { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.table-responsive { border-radius: 0; }

/* Detail pages — label above value */
.pk-detail-page .card-body { padding: 1.35rem 1.5rem; }
.pk-detail-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--pk-border);
}
.pk-detail-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.pk-detail-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pk-text);
  margin: 0 0 1rem;
}
.pk-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem 1.5rem;
}
.pk-detail-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.pk-detail-grid--compact { gap: 0.85rem 1rem; }
.pk-detail-field { min-width: 0; }
.pk-detail-field--full { grid-column: 1 / -1; }
.pk-detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pk-muted);
  margin-bottom: 0.35rem;
}
.pk-detail-value {
  font-size: 0.925rem;
  color: var(--pk-text);
  word-break: break-word;
  line-height: 1.45;
}
.pk-detail-value .pk-badge { vertical-align: middle; }
.pk-detail-page .pk-table-card-header {
  display: block;
  padding: 1rem 1.25rem !important;
}
.pk-detail-page .pk-table-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}
.pk-detail-page .pk-table-header-title {
  min-width: 0;
  flex: 1 1 auto;
}
.pk-detail-page .pk-detail-toolbar {
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}
.pk-waybill-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.pk-waybill-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
.pk-waybill-preview {
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius-sm);
  background: #fff;
  overflow: hidden;
}
.pk-waybill-preview iframe {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #fff;
}
.pk-detail-ops-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}
.pk-detail-ops-form--assign { min-width: min(100%, 22rem); }
.pk-detail-ops-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.pk-detail-ops-inline .form-select { min-width: 14rem; flex: 1 1 auto; }
.pk-detail-ai-map .pk-route-map-embed,
.pk-route-map-embed {
  width: 100%;
  min-height: 260px;
  height: 260px;
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius-sm);
  background: #f8fafc;
}
.pk-pod-records { display: grid; gap: 1rem; }
.pk-pod-record {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pk-border);
}
.pk-pod-record:last-child { padding-bottom: 0; border-bottom: none; }
.pk-media-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}
.pk-json-block {
  background: #f8fafc;
  border: 1px solid var(--pk-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.pk-json-details summary { cursor: pointer; }
.pk-ai-summary { line-height: 1.5; }
.pk-ai-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.pk-badge--inactive { background: #f3f4f6; color: #6b7280; }

/* Media previews (POD, KYC) */
.pk-media-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}
.pk-media-previews--lg { gap: 0.75rem; }
.pk-media-thumb {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none !important;
  color: var(--pk-muted);
  font-size: 0.72rem;
}
.pk-media-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--pk-border);
  background: #f8fafc;
  transition: box-shadow 0.15s;
}
.pk-media-thumb--detail img { width: 120px; height: 120px; }
.pk-media-thumb--sig img { object-fit: contain; background: #fff; }
.pk-media-thumb:hover img { box-shadow: var(--pk-shadow); }
.pk-media-missing {
  font-size: 0.8rem;
  color: var(--pk-muted);
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--pk-border);
  border-radius: 8px;
}

/* Rider verification cards */
.pk-verify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.pk-verify-card { border: 1px solid var(--pk-border); border-radius: var(--pk-radius-sm); }
.pk-verify-card .card-header { background: #fafbfc; border-bottom: 1px solid var(--pk-border); }
.pk-verify-docs { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--pk-border); }

/* Commission dashboard metrics */
.pk-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.pk-metric-grid--5 {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.pk-metric-grid .pk-metric {
  background: #fafbfc;
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius-sm);
  padding: 0.85rem 1rem;
}

/* Grouped delivery event timeline */
.pk-event-timeline {
  min-width: 220px;
  max-width: 420px;
}
.pk-event-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.25rem 0;
  border-left: 2px solid var(--pk-border);
  margin-left: 0.35rem;
  padding-left: 0.65rem;
}
.pk-event-item:first-child { border-left-color: var(--pk-primary); }
.pk-event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pk-primary);
  margin-top: 0.45rem;
  flex-shrink: 0;
  margin-left: -0.98rem;
  margin-right: 0.35rem;
}
.pk-event-body { min-width: 0; }
.pk-event-body strong { font-size: 0.82rem; margin-right: 0.35rem; }

/* Sidebar section labels (tenant portal) */
.wd-nav-section-label {
  margin: 1rem 0.35rem 0.4rem;
  padding: 0.35rem 0.5rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pk-sidebar-accent, #f5b942);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.wd-nav-section-label:first-child {
  margin-top: 0.15rem;
  border-top: none;
  padding-top: 0;
}
.wd-sidebar-nav .wd-nav-link {
  color: rgba(255, 255, 255, 0.84) !important;
}

/* In-app notification bell */
.wd-notifications { position: relative; display: inline-flex; }
.wd-topbar-actions .wd-notifications { margin-right: 0.5rem; }
.wd-notifications-btn { position: relative; }
.wd-notifications-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--pk-danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}
.wd-notifications-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(22rem, 92vw);
  max-height: 24rem;
  overflow: auto;
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius-sm);
  box-shadow: var(--pk-shadow);
  z-index: 200;
}
.wd-notifications-panel-head,
.wd-notifications-panel-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--pk-border);
  background: #fafbfc;
}
.wd-notifications-panel-foot { border-bottom: none; border-top: 1px solid var(--pk-border); }
.wd-notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wd-notifications-item a {
  display: block;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--pk-border);
}
.wd-notifications-item:last-child a { border-bottom: none; }
.wd-notifications-item:not(.is-read) a { background: #f8fafc; }
.wd-notifications-item a:hover { background: var(--pk-primary-soft); }
.wd-notifications-title {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
}
.wd-notifications-body {
  display: block;
  font-size: 0.78rem;
  color: var(--pk-muted);
  margin-top: 0.15rem;
}
.wd-notifications-time {
  display: block;
  font-size: 0.72rem;
  color: var(--pk-muted);
  margin-top: 0.2rem;
}
.wd-notifications-empty { padding: 0.85rem; font-size: 0.82rem; }
.wd-notifications-page-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.wd-notifications-page-link:hover { color: var(--pk-primary); }

/* SaaS plan module picker (admin) */
.wd-module-picker {
  display: grid;
  gap: 0.5rem;
}
.wd-module-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius-sm);
  background: #fafbfc;
  cursor: pointer;
  margin: 0;
}
.wd-module-option:hover { border-color: var(--pk-primary); background: var(--pk-primary-soft); }
.wd-module-option input { margin-top: 0.2rem; flex-shrink: 0; }
.wd-module-option-body { min-width: 0; }

.wd-zone-map {
  width: 100%;
  height: min(420px, 60vh);
  border-radius: var(--pk-radius-sm);
  border: 1px solid var(--pk-border);
  background: #eef1f6;
}
.wd-zone-heatmap-map {
  width: 100%;
  height: min(58vh, 520px);
  min-height: 380px;
  background: #eef1f6;
}
.wd-zone-toolbar #wd-zone-status {
  flex: 1 1 220px;
}
