:root {
  color-scheme: light;
  --navy-950: #06182b;
  --navy-900: #0a2138;
  --navy-800: #12314d;
  --slate-700: #36546b;
  --slate-500: #6f8798;
  --slate-300: #cbd8df;
  --slate-200: #dde7ec;
  --slate-100: #edf3f6;
  --slate-50: #f7fafb;
  --teal-600: #0f9fac;
  --teal-500: #18b8c6;
  --teal-100: #dff7f7;
  --yellow-500: #f2c94c;
  --yellow-100: #fff6d9;
  --green-600: #198754;
  --green-100: #e1f5e9;
  --red-600: #c3392d;
  --red-100: #fde9e7;
  --orange-600: #bc6917;
  --orange-100: #fff0df;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(6, 24, 43, 0.09);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--slate-50);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--navy-900);
  background: var(--slate-50);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 10%, rgba(24, 184, 198, 0.2), transparent 28%),
    radial-gradient(circle at 86% 90%, rgba(242, 201, 76, 0.18), transparent 25%),
    var(--navy-950);
}

.login-card {
  width: min(100%, 470px);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 32px 85px rgba(0, 0, 0, 0.32);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.brand-block img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.brand-block span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--navy-900);
  background: var(--yellow-500);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-copy h1,
.topbar h1,
.section-heading h2,
.dialog-header h2 {
  margin: 0;
  line-height: 1.1;
}

.login-copy h1 {
  font-size: clamp(30px, 6vw, 42px);
}

.login-copy > p:last-child {
  margin: 14px 0 28px;
  color: var(--slate-700);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal-600);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.form-stack,
.form-grid label,
.link-stack label,
.search-field,
.filter-field {
  display: grid;
  gap: 7px;
  color: var(--navy-800);
  font-size: 13px;
  font-weight: 800;
}

.form-stack {
  gap: 18px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--navy-900);
  background: var(--white);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(24, 184, 198, 0.14);
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 900;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button.primary {
  color: var(--navy-950);
  background: var(--teal-500);
}

.button.secondary {
  color: var(--navy-800);
  background: var(--slate-100);
}

.button.ghost {
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
}

.button.full {
  width: 100%;
}

.form-message {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.form-message.error {
  color: var(--red-600);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  color: var(--white);
  background: var(--navy-950);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
}

.sidebar-brand strong,
.sidebar-brand span,
.user-card strong,
.user-card span {
  display: block;
}

.sidebar-brand strong {
  font-size: 16px;
  letter-spacing: 0.07em;
}

.sidebar-brand span,
.user-card span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 6px;
  padding: 24px 0;
}

.nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.nav-item span {
  width: 22px;
  color: var(--teal-500);
  font-size: 18px;
  text-align: center;
}

.nav-item:hover,
.nav-item.active {
  color: var(--white);
  background: rgba(24, 184, 198, 0.14);
}

.sidebar-footer {
  margin-top: auto;
}

.user-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 8px;
}

.user-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--navy-950);
  background: var(--yellow-500);
  font-size: 12px;
  font-weight: 950;
}

.workspace {
  min-width: 0;
}

.topbar {
  min-height: 98px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px clamp(20px, 4vw, 44px);
  border-bottom: 1px solid var(--slate-200);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: clamp(22px, 4vw, 30px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.notification-center {
  position: relative;
}

.notification-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  color: var(--navy-900);
  background: var(--white);
  font-size: 18px;
  line-height: 1;
}

.notification-button:hover,
.notification-button[aria-expanded="true"] {
  border-color: var(--teal-500);
  background: var(--teal-100);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--white);
  border-radius: 999px;
  color: var(--white);
  background: var(--red-600);
  font-size: 10px;
  font-weight: 900;
}

.notifications-panel {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 12px);
  right: 0;
  width: min(390px, calc(100vw - 30px));
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(6, 24, 43, 0.22);
}

.notifications-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--slate-200);
}

.notifications-panel h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.notifications-panel .eyebrow {
  font-size: 9px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--teal-600);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.notification-permission {
  width: calc(100% - 28px);
  margin: 12px 14px 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--navy-900);
  background: var(--yellow-100);
  font-size: 11px;
  font-weight: 900;
}

.notifications-list {
  max-height: min(480px, 62vh);
  overflow-y: auto;
  padding: 8px;
}

.notification-item {
  position: relative;
  width: 100%;
  padding: 13px 14px 13px 27px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.notification-item + .notification-item {
  border-top: 1px solid var(--slate-100);
}

.notification-item.unread {
  background: var(--teal-100);
}

.notification-item.unread::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-600);
}

.notification-item strong,
.notification-item span,
.notification-item time {
  display: block;
}

.notification-item strong {
  color: var(--navy-900);
  font-size: 12px;
}

.notification-item span {
  margin-top: 4px;
  color: var(--slate-700);
  font-size: 11px;
  line-height: 1.45;
}

.notification-item time {
  margin-top: 6px;
  color: var(--slate-500);
  font-size: 9px;
  font-weight: 800;
}

.notifications-empty {
  padding: 34px 18px;
  color: var(--slate-500);
  text-align: center;
  font-size: 12px;
}

.date-chip {
  padding: 10px 13px;
  border: 1px solid var(--slate-200);
  border-radius: 11px;
  color: var(--slate-700);
  background: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.content {
  padding: 30px clamp(20px, 4vw, 44px) 60px;
}

.global-message {
  margin: 18px clamp(20px, 4vw, 44px) 0;
  padding: 13px 16px;
  border-radius: 12px;
  color: var(--green-600);
  background: var(--green-100);
  font-size: 13px;
  font-weight: 800;
}

.global-message.error {
  color: var(--red-600);
  background: var(--red-100);
}

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

.stat-card,
.table-card,
.entity-card {
  border: 1px solid var(--slate-200);
  background: var(--white);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 158px;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.stat-card span,
.stat-card small {
  display: block;
}

.stat-card span {
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 850;
}

.stat-card strong {
  display: block;
  margin: 17px 0 9px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
}

.stat-card small {
  color: var(--slate-500);
  font-size: 11px;
}

.stat-card.accent {
  color: var(--white);
  border-color: var(--navy-900);
  background: var(--navy-900);
}

.stat-card.accent span,
.stat-card.accent small {
  color: rgba(255, 255, 255, 0.68);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 16px;
}

.section-heading h2 {
  font-size: 22px;
}

.table-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.orders-list {
  min-height: 160px;
}

.order-row {
  display: grid;
  grid-template-columns: 112px minmax(210px, 1.3fr) minmax(180px, 1fr) 110px 120px;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--slate-100);
}

.order-row:last-child {
  border-bottom: 0;
}

.order-row:hover {
  background: var(--slate-50);
}

.order-code strong,
.order-route strong,
.entity-card strong {
  display: block;
}

.order-code strong {
  font-size: 13px;
}

.order-code small,
.order-route small,
.order-meta small,
.entity-card small,
.entity-card p {
  color: var(--slate-500);
  font-size: 11px;
}

.order-code .order-schedule {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 6px;
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.order-code .order-schedule time {
  color: var(--navy-950);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.order-route {
  min-width: 0;
}

.order-route strong,
.order-route small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-route strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.order-meta {
  font-size: 12px;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pending {
  color: var(--orange-600);
  background: var(--orange-100);
}

.status-assigned,
.status-en_route {
  color: #08717a;
  background: var(--teal-100);
}

.status-picked_up {
  color: #785b00;
  background: var(--yellow-100);
}

.status-delivered {
  color: var(--green-600);
  background: var(--green-100);
}

.status-cancelled {
  color: var(--red-600);
  background: var(--red-100);
}

.row-action {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--slate-200);
  border-radius: 9px;
  color: var(--navy-800);
  background: var(--white);
  font-size: 11px;
  font-weight: 850;
}

.row-action:hover {
  border-color: var(--teal-500);
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.location-row,
.entity-location {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.location-status {
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 850;
}

.location-status.ready {
  color: var(--green-600);
}

.entity-location {
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--slate-100);
}

.location-dialog {
  width: min(94vw, 840px);
}

.location-dialog-body {
  display: grid;
  gap: 12px;
}

.location-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.location-dialog-body > p {
  margin: 0;
  color: var(--slate-500);
  font-size: 12px;
}

#location-map {
  width: 100%;
  height: min(52vh, 460px);
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: var(--slate-100);
}

.live-map-heading {
  margin-top: 0;
}

.map-updated {
  display: block;
  margin-top: 8px;
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 700;
}

.live-map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.live-map-stats article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: var(--white);
}

.live-map-stats span {
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 800;
}

.live-map-stats strong {
  font-size: 24px;
}

.live-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  min-height: 600px;
}

.operations-map-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

#operations-map {
  width: 100%;
  height: 100%;
  min-height: 600px;
  background: var(--slate-100);
}

.map-legend {
  position: absolute;
  z-index: 500;
  top: 14px;
  left: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(6, 24, 43, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(6, 24, 43, 0.13);
  font-size: 10px;
  font-weight: 850;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 4px;
  border-radius: 50%;
}

.legend-dot.courier {
  background: var(--yellow-500);
}

.legend-dot.pickup {
  background: var(--green-600);
}

.legend-dot.delivery {
  background: var(--red-600);
}

.operations-marker {
  display: grid;
  place-items: center;
  border: 3px solid var(--navy-950);
  box-shadow: 0 5px 18px rgba(6, 24, 43, 0.32);
  color: var(--white);
  font-size: 11px;
  font-weight: 950;
}

.operations-marker.courier {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--navy-950);
  background: var(--yellow-500);
}

.operations-marker.courier.stale {
  color: var(--white);
  background: var(--slate-500);
}

.operations-marker.pickup,
.operations-marker.delivery {
  width: 30px;
  height: 30px;
  border-width: 2px;
  border-radius: 9px;
}

.operations-marker.pickup {
  background: var(--green-600);
}

.operations-marker.delivery {
  border-radius: 50% 50% 50% 4px;
  background: var(--red-600);
}

.live-orders-list {
  max-height: 650px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.live-order-card {
  padding: 15px;
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--slate-300);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(6, 24, 43, 0.06);
}

.live-order-card[data-map-lat] {
  cursor: pointer;
}

.live-order-card.is-live {
  border-left-color: var(--green-600);
}

.live-order-card.is-stale {
  border-left-color: var(--orange-600);
}

.live-order-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.live-order-card strong {
  font-size: 12px;
}

.live-order-card p {
  margin: 12px 0 5px;
  color: var(--navy-800);
  font-size: 12px;
  font-weight: 800;
}

.live-order-card small {
  color: var(--slate-500);
  line-height: 1.4;
}

.live-order-card em {
  margin-top: 9px;
  color: var(--slate-500);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.cash-heading {
  margin-top: 0;
}

.cash-summary-grid {
  margin-bottom: 20px;
}

.cash-summary-grid .stat-card {
  min-height: 145px;
}

.cash-summary-grid .stat-card strong {
  font-size: clamp(26px, 3vw, 36px);
}

.cash-summary-grid .cash-receivable {
  border-top: 4px solid var(--orange-600);
}

.cash-summary-grid .cash-payable {
  border-top: 4px solid var(--green-600);
}

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

.cash-history-grid {
  margin-top: 18px;
}

.cash-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.cash-panel > header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--slate-200);
}

.cash-panel > header h3 {
  margin: 0;
  font-size: 18px;
}

.cash-panel > header > small {
  max-width: 175px;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.4;
  text-align: right;
}

.cash-account-list,
.cash-history-list {
  max-height: 520px;
  overflow-y: auto;
}

.cash-account {
  padding: 17px 20px;
  border-bottom: 1px solid var(--slate-100);
  border-left: 4px solid var(--slate-300);
}

.cash-account:last-child,
.cash-history-item:last-child {
  border-bottom: 0;
}

.cash-account.positive {
  border-left-color: var(--green-600);
}

.cash-account.negative {
  border-left-color: var(--orange-600);
}

.cash-account-main,
.cash-account-detail,
.cash-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cash-account-main strong,
.cash-account-main small,
.cash-balance span,
.cash-balance strong,
.cash-history-item strong,
.cash-history-item small {
  display: block;
}

.cash-account-main > div:first-child {
  min-width: 0;
}

.cash-account-main > div:first-child strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-account-main small,
.cash-history-item small,
.cash-history-item p,
.cash-account-detail span {
  color: var(--slate-500);
  font-size: 10px;
  line-height: 1.45;
}

.cash-balance {
  flex: 0 0 auto;
  text-align: right;
}

.cash-balance span {
  color: var(--slate-500);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.cash-balance strong {
  margin-top: 4px;
  font-size: 18px;
}

.cash-account.positive .cash-balance strong {
  color: var(--green-600);
}

.cash-account.negative .cash-balance strong {
  color: var(--orange-600);
}

.cash-account-detail {
  flex-wrap: wrap;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--slate-100);
}

.cash-account-detail .row-action {
  margin-left: auto;
}

.cash-account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.cash-account-actions .row-action {
  margin-left: 0;
}

.cash-history-item {
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
}

.cash-history-item > div:first-child {
  min-width: 0;
}

.cash-history-item > div:first-child > strong {
  font-size: 12px;
}

.cash-history-item > div:first-child > .cash-delivery-address {
  font-size: 14px;
  line-height: 1.3;
}

.cash-history-item p {
  margin: 7px 0 0;
}

.cash-history-amount {
  flex: 0 0 auto;
  text-align: right;
}

.cash-history-amount span,
.cash-history-amount small {
  display: block;
  color: var(--slate-500);
  font-size: 9px;
}

.cash-history-amount small {
  color: var(--slate-700);
  font-size: 11px;
  font-weight: 850;
}

.cash-history-amount strong {
  margin: 3px 0 6px;
  font-size: 14px;
}

.cash-history-item.voided {
  opacity: 0.6;
  background: var(--slate-50);
}

.cash-history-item.voided strong {
  text-decoration: line-through;
}

.row-action.danger,
.void-label {
  color: var(--red-600);
}

.void-label {
  font-weight: 900;
  text-transform: uppercase;
}

.settlement-balance {
  margin: 0;
  padding: 13px 15px;
  border-radius: 12px;
  color: var(--navy-800);
  background: var(--slate-100);
  font-size: 13px;
  font-weight: 850;
}

.business-deliveries-body {
  display: grid;
  gap: 18px;
}

.business-deliveries-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.business-deliveries-summary article {
  padding: 14px 15px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: var(--slate-50);
}

.business-deliveries-summary span,
.business-deliveries-summary strong {
  display: block;
}

.business-deliveries-summary span {
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.business-deliveries-summary strong {
  margin-top: 5px;
  color: var(--navy-900);
  font-size: 18px;
}

.business-deliveries-list {
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
}

.business-delivery-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--slate-100);
}

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

.business-delivery-main {
  min-width: 0;
}

.business-delivery-main > strong,
.business-delivery-main > small,
.business-delivery-main > p {
  display: block;
}

.business-delivery-main > strong {
  color: var(--navy-900);
  font-size: 15px;
  line-height: 1.35;
}

.business-delivery-main > small {
  margin-top: 5px;
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 750;
}

.business-delivery-main > p {
  margin: 6px 0 0;
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 800;
}

.business-delivery-values {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 10px;
  color: var(--slate-500);
  font-size: 11px;
}

.business-delivery-values strong {
  color: var(--navy-800);
}

.business-delivery-effect {
  flex: 0 0 auto;
  min-width: 145px;
  text-align: right;
}

.business-delivery-effect span,
.business-delivery-effect strong {
  display: block;
}

.business-delivery-effect span {
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.business-delivery-effect strong {
  margin-top: 5px;
  color: var(--navy-900);
  font-size: 17px;
}

.business-delivery-effect.positive strong {
  color: var(--green-600);
}

.business-delivery-effect.negative strong {
  color: var(--orange-600);
}

.reports-heading {
  margin-top: 0;
}

.reports-toolbar {
  display: grid;
  grid-template-columns: 190px 190px auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: var(--white);
}

.reports-toolbar label {
  display: grid;
  gap: 7px;
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 850;
}

.report-summary-grid {
  margin-bottom: 14px;
}

.report-summary-grid .stat-card {
  min-height: 145px;
}

.report-summary-grid .stat-card strong {
  font-size: clamp(26px, 3vw, 36px);
}

.report-summary-grid .report-cancelled {
  border-top: 4px solid var(--red-600);
}

.report-extra-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-extra-stats article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: var(--white);
}

.report-extra-stats span {
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 800;
}

.report-extra-stats strong {
  font-size: 14px;
  text-align: right;
}

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

.report-section {
  min-width: 0;
}

.compact-heading {
  margin: 28px 0 12px;
}

.compact-heading h2 {
  font-size: 18px;
}

.report-table-card {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(6, 24, 43, 0.06);
}

.report-orders-card {
  max-height: 520px;
}

.report-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 11px;
}

.report-table th,
.report-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--slate-100);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.report-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: var(--slate-700);
  background: var(--slate-50);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.report-table tbody tr:hover {
  background: var(--slate-50);
}

.report-table td strong,
.report-table td small {
  display: block;
}

.report-table td small {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 9px;
}

.report-balance {
  font-weight: 900;
}

.report-balance.positive {
  color: var(--green-600);
}

.report-balance.negative {
  color: var(--orange-600);
}

.report-empty-row td {
  padding: 34px 18px;
  color: var(--slate-500);
  text-align: center;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--slate-500);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  margin-bottom: 7px;
  color: var(--navy-800);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 210px;
  gap: 14px;
  margin-bottom: 16px;
}

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

.entity-card {
  min-height: 165px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.entity-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.entity-card strong {
  font-size: 16px;
}

.entity-card p {
  margin: 18px 0 0;
  line-height: 1.55;
}

.entity-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
}

.entity-code span {
  grid-column: 1 / -1;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entity-code code {
  overflow: hidden;
  color: var(--navy-800);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-entity-card {
  min-height: 250px;
}

.business-portal-access {
  display: grid;
  gap: 11px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: var(--slate-50);
}

.business-portal-access.active {
  border-color: #b9e8cb;
  background: var(--green-100);
}

.business-portal-access > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.business-portal-access span,
.business-portal-access strong {
  display: block;
}

.business-portal-access span {
  color: var(--slate-500);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.business-portal-access strong {
  color: var(--navy-800);
  font-size: 10px;
}

.business-portal-access > div:last-child {
  justify-content: flex-start;
}

.access-help,
.access-warning {
  margin: 0;
  padding: 12px 14px;
  border-radius: 11px;
  color: var(--slate-700);
  background: var(--slate-100);
  font-size: 11px;
  line-height: 1.5;
}

.access-warning {
  color: var(--orange-600);
  background: var(--orange-100);
  font-weight: 800;
}

.active-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green-600);
  box-shadow: 0 0 0 4px var(--green-100);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--slate-200);
  border-radius: 11px;
  color: var(--navy-800);
  background: var(--white);
  font-size: 24px;
  line-height: 1;
}

.menu-button {
  display: none;
  font-size: 18px;
}

.app-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: 0 35px 90px rgba(6, 24, 43, 0.3);
}

.app-dialog.small {
  width: min(570px, calc(100vw - 28px));
}

.app-dialog::backdrop {
  background: rgba(6, 24, 43, 0.7);
  backdrop-filter: blur(5px);
}

.dialog-card {
  margin: 0;
  color: var(--navy-900);
  background: var(--white);
}

.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
}

.dialog-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--slate-200);
}

.dialog-header h2 {
  font-size: 22px;
}

.dialog-body {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding: 24px;
}

.dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--slate-200);
}

.dialog-footer .form-message {
  margin-right: auto;
}

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

.form-grid.compact {
  gap: 13px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

fieldset {
  margin: 0;
  padding: 17px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

legend {
  padding: 0 7px;
  color: var(--teal-600);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.team-permissions-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.team-permissions-note > div,
.permission-preview {
  padding: 14px 16px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: var(--slate-100);
}

.team-permissions-note strong,
.team-permissions-note span,
.permission-preview strong,
.permission-preview span {
  display: block;
}

.team-permissions-note strong,
.permission-preview strong {
  color: var(--navy-800);
  font-size: 12px;
}

.team-permissions-note span,
.permission-preview span {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 10px;
  line-height: 1.5;
}

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

.team-panel {
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.team-panel > header {
  padding: 19px 20px;
  border-bottom: 1px solid var(--slate-200);
}

.team-panel h3 {
  margin: 0;
  font-size: 18px;
}

.team-list {
  min-height: 180px;
}

.team-member,
.team-invitation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--slate-100);
}

.team-member:last-child,
.team-invitation:last-child,
.team-audit-row:last-child {
  border-bottom: 0;
}

.team-member.inactive {
  background: var(--slate-50);
  opacity: 0.72;
}

.team-member-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.team-member-main strong,
.team-member-main span,
.team-member-main small,
.team-member-access strong,
.team-member-access span,
.team-member-access small,
.team-invitation strong,
.team-invitation span,
.team-invitation small {
  display: block;
}

.team-member-main strong,
.team-invitation strong {
  color: var(--navy-900);
  font-size: 12px;
}

.team-member-main span,
.team-invitation span {
  overflow: hidden;
  margin-top: 4px;
  color: var(--slate-700);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-main small,
.team-invitation small,
.team-member-access small {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 9px;
}

.team-member-access {
  flex: 0 0 auto;
  text-align: right;
}

.team-member-access .team-role {
  color: var(--slate-500);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.team-member-access .access-active,
.team-member-access .access-inactive {
  margin-top: 4px;
  font-size: 10px;
}

.access-active {
  color: var(--green-600);
}

.access-inactive {
  color: var(--red-600);
}

.team-member-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 9px;
}

.team-member-actions .row-action {
  margin-top: 0;
}

.team-audit-panel {
  margin-top: 16px;
}

.team-audit-list {
  min-height: 150px;
}

.team-audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--slate-100);
}

.team-audit-row strong,
.team-audit-row small,
.team-audit-row span,
.team-audit-row time {
  display: block;
}

.team-audit-row strong {
  font-size: 11px;
}

.team-audit-row small,
.team-audit-row span,
.team-audit-row time {
  margin-top: 3px;
  color: var(--slate-500);
  font-size: 9px;
}

.team-audit-row > div:last-child {
  text-align: right;
}

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

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.row-action.evidence-action {
  border-color: #a8e3e6;
  color: var(--teal-600);
  background: var(--teal-100);
}

.evidence-dialog {
  width: min(900px, calc(100vw - 28px));
}

.evidence-dialog-body {
  display: grid;
  gap: 20px;
}

.evidence-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.evidence-summary > div {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: var(--slate-50);
}

.evidence-summary > .wide {
  grid-column: span 2;
}

.evidence-summary span,
.evidence-summary strong {
  display: block;
}

.evidence-summary span {
  color: var(--slate-500);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.evidence-summary strong {
  overflow: hidden;
  margin-top: 5px;
  color: var(--navy-900);
  font-size: 11px;
  text-overflow: ellipsis;
}

.evidence-gallery {
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.evidence-card {
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 15px;
  background: var(--white);
}

.evidence-card a {
  display: block;
  background: var(--navy-950);
}

.evidence-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
}

.evidence-card > div {
  padding: 12px 14px;
}

.evidence-card strong,
.evidence-card span {
  display: block;
}

.evidence-card strong {
  color: var(--navy-900);
  font-size: 12px;
}

.evidence-card span,
.evidence-privacy {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 9px;
}

.evidence-loading {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 800;
}

.evidence-privacy {
  margin: 0;
  text-align: center;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .order-row {
    grid-template-columns: 105px minmax(180px, 1fr) 115px 110px;
  }

  .order-row .order-meta {
    display: none;
  }

  .live-map-layout {
    grid-template-columns: 1fr;
  }

  .cash-columns,
  .cash-history-grid,
  .report-columns,
  .team-layout {
    grid-template-columns: 1fr;
  }

  .reports-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #operations-map {
    height: 520px;
    min-height: 520px;
  }

  .live-orders-list {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: 250px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
    box-shadow: 24px 0 60px rgba(6, 24, 43, 0.34);
  }

  .menu-button {
    display: grid;
  }

  .topbar {
    min-height: 86px;
    padding: 16px 18px;
  }

  .topbar .date-chip {
    display: none;
  }

  .topbar-actions .button {
    padding: 0 12px;
    font-size: 11px;
  }

  .notifications-panel {
    position: fixed;
    top: 78px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .content {
    padding: 24px 16px 50px;
  }

  .global-message {
    margin-inline: 16px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .live-map-stats {
    grid-template-columns: 1fr;
  }

  .report-extra-stats {
    grid-template-columns: 1fr;
  }

  .evidence-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-orders-list {
    grid-template-columns: 1fr;
  }

  .cash-account-main,
  .cash-history-item {
    align-items: flex-start;
  }

  .order-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px;
  }

  .order-row .order-route {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .order-row .status-badge {
    grid-column: 2;
    grid-row: 1;
  }

  .order-row .row-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .login-shell {
    padding: 14px;
  }

  .login-card {
    padding: 27px 22px;
  }

  .stats-grid,
  .entity-grid,
  .form-grid,
  .team-permissions-note,
  .evidence-gallery,
  .evidence-summary,
  .business-deliveries-summary {
    grid-template-columns: 1fr;
  }

  .business-delivery-item {
    flex-direction: column;
  }

  .business-delivery-effect {
    min-width: 0;
    text-align: left;
  }

  .cash-account-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .evidence-summary > .wide {
    grid-column: span 1;
  }

  .team-member,
  .team-invitation,
  .team-audit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .team-member-access,
  .team-audit-row > div:last-child {
    text-align: left;
  }

  .team-member-actions {
    justify-content: flex-start;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }

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

  .dialog-header,
  .dialog-body,
  .dialog-footer {
    padding-inline: 17px;
  }

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

  .dialog-footer .form-message {
    margin-right: 0;
  }

  .copy-row {
    grid-template-columns: 1fr;
  }

  .location-search {
    grid-template-columns: 1fr;
  }

  #location-map {
    min-height: 300px;
  }

  #operations-map {
    height: 440px;
    min-height: 440px;
  }

  .map-legend {
    left: 46px;
    gap: 7px;
    padding: 8px 9px;
  }

  .cash-account-main,
  .cash-history-item {
    flex-direction: column;
  }

  .cash-balance,
  .cash-history-amount {
    text-align: left;
  }

  .reports-toolbar {
    grid-template-columns: 1fr;
  }
}


/* v3.3 · módulos integrados */
.heading-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.integrated-module-view{padding-bottom:10px}.integrated-module-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:18px;margin-bottom:14px}.integrated-module-heading h2{margin:7px 0 5px}.integrated-module-heading p:not(.eyebrow){margin:0;color:var(--muted,#8e8e93);max-width:760px}.integrated-module-frame{overflow:hidden;border:1px solid rgba(255,255,255,.08);border-radius:20px;background:#0a0a0b;min-height:680px;box-shadow:0 20px 60px rgba(0,0,0,.18)}.integrated-module-frame iframe{display:block;width:100%;height:calc(100vh - 205px);min-height:680px;border:0;background:#0a0a0b}@media(max-width:760px){.integrated-module-heading{align-items:flex-start;flex-direction:column}.integrated-module-frame,.integrated-module-frame iframe{min-height:760px}.integrated-module-frame iframe{height:calc(100vh - 170px)}}

/* v3.7 · acción administrativa destructiva */
.button.danger {
  color: var(--white);
  background: var(--red-600);
}
