:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-strong: #134e4a;
  --accent-soft: #ccfbf1;
  --accent-wash: rgba(15, 118, 110, 0.1);
  --warning: #f97316;
  --warning-soft: rgba(249, 115, 22, 0.12);
  --danger: #b91c1c;
  --border: #e2e8f0;
  --card: #ffffff;
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 18px 44px rgba(15, 23, 42, 0.08);
}

body {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 42%, #f1f5f9 100%);
  color: var(--text);
}

h1,
h2,
h3,
.brand,
.nav-label,
.dashboard-kpi strong {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: 0;
}

.site-header {
  min-height: 72px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 36px -30px rgba(15, 23, 42, 0.45);
}

.site-header--menu-first {
  justify-content: flex-start;
}

.site-header--menu-first .main-nav {
  flex: 1 1 auto;
  justify-content: space-between;
}

.site-header--menu-first .nav-group:first-child {
  flex: 1 1 auto;
}

.brand {
  text-transform: none;
  letter-spacing: 0;
  font-size: 18px;
  color: var(--text);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.main-nav {
  gap: 8px;
}

.nav-group {
  padding: 4px;
  gap: 6px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.nav-label {
  padding: 0 8px;
  color: #94a3b8;
  font-size: 10px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  box-shadow: none;
}

.main-nav a:hover {
  color: var(--accent);
  background: var(--accent-wash);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.main-nav a.is-active {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
  box-shadow: 0 10px 22px -16px rgba(15, 23, 42, 0.85);
}

.nav-meta .chip,
.chip {
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.content {
  padding: 24px;
}

.card,
.wizard-card,
.map-panel,
.rider-panel,
.rider-card,
.telephony-row,
.order-card,
.context-bar__item,
.insight-card,
.dashboard-card {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.dashboard-shell {
  gap: 18px;
}

.dashboard-hero {
  padding: 22px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 118, 110, 0.88));
  color: #e2e8f0;
  border: 1px solid rgba(15, 118, 110, 0.25);
  box-shadow: var(--shadow-card);
}

.dashboard-hero h1,
.dashboard-hero .eyebrow {
  color: #ffffff;
}

.dashboard-hero .muted,
.dashboard-hero .kpi-meta {
  color: #cbd5e1;
}

.dashboard-hero__title h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  margin: 6px 0 8px;
}

.eyebrow {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.14);
  color: var(--accent);
  border: 1px solid rgba(20, 184, 166, 0.22);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.dashboard-hero .eyebrow {
  color: #99f6e4;
  background: rgba(20, 184, 166, 0.14);
}

.dashboard-hero__kpis {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.dashboard-kpi {
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.dashboard-kpi span {
  color: #cbd5e1;
  letter-spacing: 0.08em;
}

.dashboard-kpi strong {
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
}

.work-start-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.work-start-card {
  min-height: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: none;
  background: #ffffff;
}

.work-start-card strong {
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: 0;
}

.work-start-card span {
  display: none;
}

.work-start-card--primary {
  background: #0f172a;
  color: #ffffff;
}

.ops-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.ops-command-main,
.ops-live-riders {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.ops-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ops-flow-card {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.ops-flow-card span,
.ops-flow-card small {
  color: var(--muted);
}

.ops-flow-card span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-flow-card strong {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 34px;
  line-height: 1;
  color: var(--text);
}

.ops-flow-card small {
  line-height: 1.35;
}

.ops-live-riders__head,
.ops-rider-row,
.ops-rider-row__meta {
  display: flex;
  align-items: center;
}

.ops-live-riders__head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.ops-live-riders__head h3 {
  margin: 0;
}

.ops-rider-row {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.ops-rider-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ops-rider-row strong,
.ops-rider-row span,
.ops-rider-row small {
  overflow-wrap: anywhere;
}

.ops-rider-row span,
.ops-rider-row small {
  color: var(--muted);
  font-size: 12px;
}

.ops-rider-row__meta {
  flex: 0 0 112px;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.ops-rider-row--route {
  border-left: 4px solid #14b8a6;
  padding-left: 10px;
}

.ops-rider-row--assigned {
  border-left: 4px solid #8b5cf6;
  padding-left: 10px;
}

.ops-rider-row--online {
  border-left: 4px solid #22c55e;
  padding-left: 10px;
}

.ops-rider-row--warn {
  border-left: 4px solid var(--warning);
  padding-left: 10px;
}

.ops-rider-row--off {
  opacity: 0.68;
}

.danger-text {
  color: var(--danger) !important;
  font-weight: 800;
}

.ops-print-choice {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(240, 253, 250, 0.74);
}

button,
.button,
a.button {
  min-height: 40px;
  border-radius: 10px;
  background: var(--text);
  color: #ffffff;
  border: 1px solid var(--text);
  box-shadow: 0 14px 28px -20px rgba(15, 23, 42, 0.65);
  font-weight: 800;
}

button:hover,
.button:hover,
a.button:hover {
  transform: translateY(-1px);
  filter: none;
  background: #020617;
  box-shadow: 0 18px 30px -22px rgba(15, 23, 42, 0.75);
}

.dashboard-hero .button {
  background: #ffffff;
  color: var(--text);
  border-color: #ffffff;
}

.ghost-button,
.context-bar__btn.ghost,
a.ghost-button {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--text);
  background: #ffffff;
  box-shadow: none;
  font-weight: 800;
}

.dashboard-hero .ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

button.danger,
.danger {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 14px 28px -20px rgba(185, 28, 28, 0.65);
}

select,
input,
textarea {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.ops-column {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  box-shadow: none;
}

.ops-column::before {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.ops-column__head .badge {
  background: var(--text);
  color: #ffffff;
}

.order-card {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  border-left: 6px solid #94a3b8;
}

.dashboard-shell .ops-board,
.ops-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  overflow: visible;
  padding-bottom: 8px;
  align-items: start;
}

.dashboard-shell .ops-column,
.ops-column {
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
}

.ops-column:not(.has-visible-cards) {
  display: none;
}

.ops-column__list {
  max-height: min(70vh, 760px);
  overflow: auto;
  padding-right: 2px;
}

.ops-cleanup-note {
  flex: 1 1 100%;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.rush-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.rush-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.rush-panel__head h3 {
  margin: 0;
}

.rush-table {
  display: grid;
  gap: 4px;
  max-height: 460px;
  overflow: auto;
}

.rush-row {
  display: grid;
  grid-template-columns: 0.8fr 0.7fr 0.7fr 1fr 1fr 1.4fr;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
  font-size: 12px;
}

.rush-row--head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
}

.rush-row strong,
.rush-row small {
  display: block;
}

.rush-row small {
  color: #64748b;
  font-size: 10px;
}

.rush-row--head small {
  color: #cbd5e1;
}

.rush-row--pending {
  border-left: 4px solid #94a3b8;
}

.rush-row--started {
  border-left: 4px solid #f59e0b;
}

.rush-row--ready {
  border-left: 4px solid #16a34a;
}

.future-orders-panel {
  display: grid;
  gap: 12px;
}

.future-orders-panel.ops-secondary-panel {
  display: grid;
}

.future-order-groups {
  display: grid;
  gap: 10px;
}

.future-order-group {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.future-order-group__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.future-order-group__head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.future-order-list {
  display: grid;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.future-order-row {
  display: grid;
  grid-template-columns: 0.45fr 0.95fr 1.05fr minmax(220px, 1.5fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  color: #0f172a;
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
}

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

.future-order-row:hover {
  background: #f8fafc;
}

.future-order-row--head {
  min-height: 36px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.future-order-row--head span,
.future-order-row--head small,
.future-order-row--head strong {
  color: #ffffff;
}

.future-order-row--reservation {
  grid-template-columns: 0.55fr 0.9fr 1.1fr minmax(180px, 1.4fr);
}

.future-order-row strong,
.future-order-row small {
  display: block;
}

.future-order-row small {
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
}

.future-order-row__amount {
  font-weight: 900;
  color: #0f766e;
  text-align: right;
}

.future-order-row__items {
  min-width: 0;
  color: #334155;
  font-weight: 800;
}

.future-order-row__items,
.future-order-row span {
  min-width: 0;
}

.future-order-row__items,
.future-order-row span:not(.future-order-row__amount) {
  overflow-wrap: anywhere;
}

.ops-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.orders-history-table {
  min-width: 980px;
}

.orders-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.orders-history-table td {
  vertical-align: top;
}

.order-link {
  font-weight: 900;
  color: #0f766e;
}

.order-card.compact {
  padding: 9px;
  gap: 7px;
}

.order-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.order-card__head > div:first-child,
.order-card__identity {
  min-width: 0;
}

.order-card__head h3 {
  line-height: 1.15;
}

.order-card__identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.turn-number {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--turn-color, #111827);
  color: var(--turn-color-text, #ffffff);
  border: 2px solid color-mix(in srgb, var(--turn-color, #111827) 72%, #000000);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--turn-color, #111827) 24%, transparent);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.order-card__title {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.turn-label,
.technical-order-id {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.turn-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.turn-label i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: var(--turn-color, #111827);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--turn-color, #111827) 18%, transparent);
}

.turn-color-chip {
  --turn-color: #111827;
  --turn-color-text: #ffffff;
}

.future-route-card__orders .turn-color-chip,
.future-order-turn.turn-color-chip,
.rush-turn.turn-color-chip {
  border-left: 5px solid var(--turn-color);
  background: color-mix(in srgb, var(--turn-color) 9%, #ffffff);
}

.future-route-card__orders .turn-color-chip b,
.future-order-turn.turn-color-chip strong,
.rush-turn.turn-color-chip strong {
  color: var(--turn-color-text);
  background: var(--turn-color);
  border-radius: 7px;
  padding: 3px 7px;
  min-width: 30px;
  text-align: center;
}

.turn-color-chip--compact {
  display: inline-grid !important;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 4px 7px !important;
  border-radius: 8px;
  background: var(--turn-color) !important;
  color: var(--turn-color-text) !important;
  border: 2px solid color-mix(in srgb, var(--turn-color) 72%, #000000) !important;
}

.technical-order-id {
  font-size: 9px;
  color: #94a3b8;
}

.order-due-stack {
  display: grid;
  gap: 4px;
  justify-items: end;
  flex: 0 0 auto;
  max-width: 142px;
}

.order-due-box {
  min-width: 116px;
  border-radius: 8px;
  padding: 7px 9px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  text-align: right;
  line-height: 1.1;
}

.order-due-box span,
.order-due-box small,
.order-card__assistant span {
  display: block;
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-due-box strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.order-due-box--service {
  background: var(--accent-wash);
  border-color: rgba(15, 118, 110, 0.15);
}

.order-card[data-fulfillment="PICKUP"] .order-due-box--service {
  background: rgba(254, 240, 138, 0.62);
  border-color: rgba(202, 138, 4, 0.22);
}

.order-due-box--route {
  background: #ffffff;
}

.order-card__assistant {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.13);
}

.order-card__assistant strong {
  color: #0f766e;
  font-size: 12px;
  line-height: 1.25;
}

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

.order-card[data-status-group="NEW"] {
  border-left-color: #ef4444;
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.68), #ffffff 30%);
}

.order-card[data-status-group="KITCHEN"] {
  border-left-color: #f97316;
  background: linear-gradient(90deg, rgba(255, 237, 213, 0.78), #ffffff 30%);
}

.order-card[data-status-group="READY"] {
  border-left-color: #2563eb;
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.78), #ffffff 30%);
}

.order-card[data-status-group="ASSIGNED"] {
  border-left-color: #7c3aed;
  background: linear-gradient(90deg, rgba(237, 233, 254, 0.72), #ffffff 30%);
}

.order-card[data-status-group="ROUTE"] {
  border-left-color: #0f766e;
  background: linear-gradient(90deg, rgba(204, 251, 241, 0.72), #ffffff 30%);
}

.order-card[data-status-group="DONE"] {
  border-left-color: #16a34a;
  background: linear-gradient(90deg, rgba(220, 252, 231, 0.62), #ffffff 30%);
}

.order-card[data-fulfillment="PICKUP"] {
  border-left-color: #a16207;
  border-top: 3px solid #facc15;
  background: linear-gradient(90deg, rgba(254, 249, 195, 0.7), #ffffff 32%);
}

.order-card[data-fulfillment="PICKUP"][data-status-group="READY"] {
  border-left-color: #ca8a04;
  background: linear-gradient(90deg, rgba(254, 240, 138, 0.82), #ffffff 32%);
}

.order-card[data-fulfillment="PICKUP"][data-status-group="DONE"] {
  border-left-color: #65a30d;
  border-top-color: #bef264;
  background: linear-gradient(90deg, rgba(236, 252, 203, 0.7), #ffffff 32%);
}

.order-card[data-fulfillment="DELIVERY"] {
  border-bottom: 3px solid rgba(15, 118, 110, 0.16);
}

.order-card.is-scheduled-due {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22), 0 10px 22px rgba(15, 23, 42, 0.05);
}

.order-card.is-scheduled-late {
  border-left-color: #dc2626;
  background: linear-gradient(90deg, rgba(254, 202, 202, 0.72), #ffffff 34%);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2), 0 12px 24px rgba(127, 29, 29, 0.08);
}

.order-card.is-scheduled-expired {
  border-left-color: #7f1d1d;
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.18), #ffffff 36%);
  opacity: 0.88;
}

.dashboard-shell .order-card:hover,
.order-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.08);
}

.status-pill,
.pill {
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.pill-delivery {
  background: var(--accent-wash);
  color: var(--accent-strong);
}

.pill-pickup {
  background: rgba(254, 240, 138, 0.8);
  color: #854d0e;
  border-color: rgba(202, 138, 4, 0.22);
}

.pill-phone {
  background: rgba(219, 234, 254, 0.9);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.2);
}

.pill-ok {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.pill-warn {
  background: var(--warning-soft);
  color: #9a3412;
}

.order-timer {
  background: var(--accent-wash);
  color: var(--accent-strong);
  border: 1px solid rgba(15, 118, 110, 0.12);
  display: grid;
  gap: 1px;
  min-width: 88px;
  max-width: 110px;
  text-align: right;
  line-height: 1.1;
  white-space: normal;
}

.order-card[data-fulfillment="PICKUP"] .order-timer {
  background: rgba(254, 240, 138, 0.62);
  color: #854d0e;
  border-color: rgba(202, 138, 4, 0.22);
}

.order-card[data-fulfillment="PICKUP"] .order-timer.is-pickup-late {
  background: rgba(251, 146, 60, 0.2);
  color: #9a3412;
  border-color: rgba(234, 88, 12, 0.25);
}

.order-card[data-fulfillment="DELIVERY"] .order-timer.is-late {
  background: rgba(239, 68, 68, 0.18);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.22);
}

.order-time-stack {
  display: grid;
  gap: 3px;
  justify-items: end;
  flex: 0 0 auto;
}

.order-timer span,
.order-total-age {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.order-timer strong,
.order-total-age strong {
  font-size: 11px;
  color: inherit;
}

.order-total-age {
  text-align: right;
  text-transform: none;
}

.order-card__ops {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 10px;
  color: #475569;
  max-height: 48px;
  overflow: hidden;
}

.order-card__ops span {
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  padding: 3px 6px;
}

.order-food-safety {
  border: 2px solid #b42318;
  border-radius: 14px;
  background: #fff4f1;
}

.order-food-safety-revision {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 2px solid #b42318;
  border-radius: 14px;
  background: #fff4f1;
}

.order-detail-card > .order-card__food-safety {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 11px 13px;
  border: 3px solid #b42318;
  border-left-width: 9px;
  border-radius: 11px;
  background: #fff1ed;
  color: #5f110c;
}

.order-detail-card > .order-card__food-safety strong,
.order-detail-card > .order-card__food-safety b {
  font-weight: 900;
}

.order-detail-card > .order-card__food-safety.is-invalid {
  border-color: #7f1d1d;
  background: #fee2e2;
  color: #450a0a;
}

.order-food-safety__allergens,
.order-food-safety__lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.order-food-safety__allergens label,
.order-food-safety__lines label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #e6a59f;
  border-radius: 9px;
  background: #fffdf8;
  color: #431407;
  font-weight: 750;
}

.pill-scheduled {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.pill-packages {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.pill-packages.is-heavy {
  background: rgba(124, 58, 237, 0.14);
  color: #6d28d9;
}

.pill-distance--near {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.pill-distance--mid {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.pill-distance--far {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.pill-route-group {
  background: rgba(14, 165, 233, 0.14);
  color: #075985;
}

.pill-route-time {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.pill-route-neighbor {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.pill-route-corridor {
  background: rgba(249, 115, 22, 0.16);
  color: #9a3412;
}

.pill-kitchen--pending {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.pill-kitchen--started {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.pill-kitchen--ready {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.pill-kitchen-target {
  background: rgba(14, 165, 233, 0.12);
  color: #075985;
}

.time-state {
  font-weight: 800;
}

.time-state--late {
  color: #dc2626;
}

.time-state--urgent {
  color: #ea580c;
}

.time-state--soon {
  color: #b45309;
}

.time-state--ok {
  color: #047857;
}

.ops-group-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

.ops-group-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
}

.ops-group-card__head,
.ops-group-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ops-group-card__head {
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.1);
}

.ops-group-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.ops-group-row {
  padding: 8px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.8);
}

.ops-group-row span {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.ops-group-orders {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.ops-group-orders a {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 4px 7px;
  color: #111827;
  text-decoration: none;
  font-weight: 800;
  background: #ffffff;
}

.ops-shell--primary {
  border-color: rgba(17, 24, 39, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 246, 0.94));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.ops-shell--primary .ops-header {
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 12px;
}

.ops-shell--primary .ops-header h2 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.02;
}

.ops-shell--primary .ops-actions .button,
.ops-shell--primary .ops-actions .ghost-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 11px 18px;
}

.ops-toolbar {
  border-radius: 8px;
  border-color: rgba(17, 24, 39, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}

.ops-filters .chip {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  background: #ffffff;
}

.ops-filters .chip.is-active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.ops-search {
  min-height: 42px;
  border-radius: 8px;
  background: #ffffff;
}

.rush-panel,
.ops-group-card {
  border-radius: 8px;
  border-color: rgba(17, 24, 39, 0.1);
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.rush-panel__head h3,
.ops-group-card__head strong {
  font-size: 18px;
}

.rush-row {
  min-height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #fbfcfb;
}

.rush-row:not(.rush-row--head):hover {
  background: #eef8f6;
}

.rush-row--head {
  min-height: 34px;
  background: #111827;
  border-color: #111827;
}

.ops-group-row {
  min-height: 50px;
  background: #fbfcfb;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.ops-group-orders a:hover {
  border-color: rgba(15, 118, 110, 0.35);
  color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
}

.dashboard-shell .ops-column,
.ops-column {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: none;
}

.ops-column__head {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
}

.order-card {
  border-radius: 8px;
  border-left-width: 4px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.order-card__head h3 {
  font-size: 18px;
}

.turn-number {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
  font-size: 36px;
}

.order-due-stack {
  min-width: 122px;
}

.order-due-box {
  min-width: 118px;
}

.order-timer,
.order-total-age {
  min-width: 106px;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.order-timer span,
.order-total-age {
  font-size: 9px;
}

.order-timer strong,
.order-total-age strong {
  font-size: 12px;
}

.order-card__actions button,
.order-card__actions .button,
.order-card__actions .ghost-button,
.primary-actions button,
.primary-actions .button {
  min-height: 38px;
  border-radius: 8px;
}

.pill,
.status-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}

.order-card__details {
  line-height: 1.35;
  display: grid;
  gap: 3px;
}

.order-card__details div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card__actions,
.primary-actions,
.order-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-card__actions {
  flex-direction: column;
}

.primary-actions button,
.primary-actions .button,
.order-card__links .ghost-button.small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.1;
}

.order-card details.order-details {
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
  padding-top: 6px;
}

.order-card details.order-details summary {
  cursor: pointer;
  font-weight: 800;
}

.insight-card {
  background: #ffffff;
}

.insight-label {
  color: #94a3b8;
  letter-spacing: 0.12em;
}

.context-bar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ops-secondary-panel {
  display: none;
}

.future-orders-panel.ops-secondary-panel {
  display: grid;
}

.quick-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.quick-category-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
}

.quick-category-card__form {
  grid-template-columns: minmax(150px, 1.3fr) repeat(3, minmax(76px, 0.7fr));
  gap: 8px;
}

.shift-config-row {
  align-items: end;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.75);
}

.wizard-config-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #ffffff;
}

.wizard-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.wizard-module-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 6px 10px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.8);
}

.wizard-module-card strong,
.wizard-module-card span {
  grid-column: 2;
}

.wizard-module-card span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
}

.wizard-module-card.is-active {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.08);
}

.wizard-module-card--future {
  border-style: dashed;
}

.is-module-disabled {
  opacity: 0.48;
}

.wizard-split {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(280px, 1.15fr);
  gap: 12px;
}

.wizard-station-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-home {
  display: grid;
  gap: 16px;
}

.admin-header--focused {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
  align-items: end;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.admin-header--focused h1 {
  margin: 8px 0 6px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.02;
}

.admin-search input {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fbfcfb;
}

.admin-focus-panel,
.admin-maintenance-plan,
.admin-operating-model,
.admin-playbooks,
.admin-module-section {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.05);
}

.admin-focus-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.admin-maintenance-plan {
  padding: 16px;
}

.admin-operating-model {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.6fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.admin-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.admin-status-pill small {
  color: #64748b;
  font-weight: 800;
}

.admin-status-pill.is-on {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
}

.admin-status-pill.is-off {
  opacity: 0.72;
}

.admin-playbooks {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-playbooks__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

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

.admin-playbook-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0) 44%),
    #fbfcfb;
}

.admin-playbook-card__head {
  display: grid;
  gap: 8px;
}

.admin-playbook-card h3 {
  margin: 0;
  font-size: 18px;
}

.admin-playbook-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.42;
}

.admin-playbook-tags,
.admin-playbook-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-playbook-tags span {
  border-radius: 999px;
  padding: 4px 7px;
  background: #eef2f7;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-playbook-steps {
  align-self: end;
}

.admin-playbook-steps a {
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(15, 118, 110, 0.07);
  color: #0f766e;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.admin-playbook-steps a:hover {
  background: rgba(15, 118, 110, 0.12);
}

.admin-maintenance-plan__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.admin-review-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.admin-review-steps span {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 800;
  color: #334155;
}

.admin-module-groups {
  display: grid;
  gap: 14px;
}

.admin-module-section {
  padding: 14px;
}

.admin-module-section__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.1);
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.admin-module-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 13px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 8px;
  background: #fbfcfb;
  color: #111827;
  text-decoration: none;
}

.admin-module-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.06);
}

.admin-module-card--priority {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.07);
}

.admin-module-card--unavailable,
.admin-module-card--unavailable:hover {
  border-style: dashed;
  border-color: rgba(100, 116, 139, 0.3);
  background: #f4f1e9;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.86;
  transform: none;
}

.admin-module-card--unavailable .admin-module-card__top span {
  background: #64748b;
}

.admin-module-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin-module-card__top strong {
  font-size: 16px;
}

.admin-module-card__top span {
  align-self: flex-start;
  border-radius: 999px;
  padding: 3px 7px;
  background: #111827;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}

.admin-module-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.38;
}

.product-config-hub {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.product-config-hub__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 16px;
  align-items: end;
}

.product-config-hub__head h2 {
  margin: 8px 0 6px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.02;
}

.product-config-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.product-config-stats div {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f8fafc;
}

.product-config-stats strong {
  font-size: 24px;
  line-height: 1;
}

.product-config-stats span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.product-config-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.product-config-tabs a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  font-weight: 800;
}

.product-config-tabs a:hover {
  border-color: rgba(15, 118, 110, 0.34);
  background: rgba(15, 118, 110, 0.07);
  color: #0f766e;
}

.product-config-note {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
  color: #134e4a;
}

.product-config-drawer {
  overflow: hidden;
}

.product-config-drawer > summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.product-config-drawer > summary::-webkit-details-marker {
  display: none;
}

.product-config-drawer > summary strong {
  display: block;
  font-size: 18px;
}

.product-config-drawer > summary small {
  display: block;
  margin-top: 3px;
  color: #64748b;
}

.product-config-drawer[open] > summary {
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.1);
}

.product-create-panel {
  border-color: rgba(15, 118, 110, 0.18);
}

.product-create-panel > h2 {
  font-size: 24px;
}

/* Operativa densa para turno con muchas comandas. */
.app-shell.app-shell-focus .site-header,
.app-shell.app-shell-focus .context-bar {
  display: none !important;
}

.app-shell.app-shell-focus .content,
.app-shell.app-shell-focus .app-shell-main,
.app-shell.app-shell-focus .app-shell-frames,
.app-shell.app-shell-focus .app-shell-frame {
  height: 100vh;
  height: 100dvh;
}

.app-frame.ops-fullscreen .content {
  padding: 8px;
}

.dashboard-shell {
  gap: 10px;
}

.dashboard-shell > .dashboard-hero,
.dashboard-shell > .work-start-panel {
  display: none;
}

.ops-workbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.ops-workbar__main,
.ops-workbar__metrics,
.ops-workbar__tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ops-workbar__main {
  justify-content: space-between;
}

.ops-workbar__main strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.ops-workbar .eyebrow {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ops-workbar__tabs button,
.ops-workbar__tabs a,
.ops-focus-toggle {
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 7px 10px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

.ops-workbar__tabs button.is-active,
.ops-focus-toggle.is-active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.ops-workbar__metrics {
  justify-content: flex-start;
}

.ops-workbar__metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.ops-workbar__metrics b {
  color: #0f172a;
  font-size: 16px;
}

.ops-live-state {
  display: inline-flex;
  align-items: center !important;
  gap: 5px;
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0;
  font-weight: 950 !important;
}

.ops-live-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.12);
}

.ops-live-state[data-state="loading"] {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe;
}

.ops-live-state[data-state="error"] {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border-color: #fecaca;
}

body.ops-fullscreen {
  overflow: hidden;
  background: #eef2f7;
}

body.ops-fullscreen .dashboard-shell {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  gap: 0;
}

body.ops-fullscreen .ops-workbar {
  position: fixed !important;
  inset: 0 0 auto 0;
  z-index: 1001;
  margin: 0 !important;
  border-radius: 0;
  border-width: 0 0 1px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

body.ops-fullscreen .ops-workbar__main {
  display: none;
}

body.ops-fullscreen .ops-workbar__metrics {
  justify-content: space-between;
}

body.ops-fullscreen .ops-shell--primary {
  position: fixed;
  inset: 54px 0 0 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  padding: 6px !important;
  border: 0;
  border-radius: 0 !important;
  background: #eef2f7;
  overflow: hidden;
}

body.ops-fullscreen .ops-shell--primary .ops-header,
body.ops-fullscreen .rush-panel,
body.ops-fullscreen .ops-group-strip,
body.ops-fullscreen .ops-secondary-panel,
body.ops-fullscreen .dashboard-insights,
body.ops-fullscreen .dashboard-row,
body.ops-fullscreen .work-start-panel,
body.ops-fullscreen .dashboard-hero {
  display: none !important;
}

body.ops-fullscreen .ops-toolbar {
  margin: 0 !important;
  padding: 6px !important;
  border-radius: 8px;
}

body.ops-fullscreen .ops-board {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  grid-template-columns: repeat(5, minmax(210px, 1fr)) !important;
  gap: 6px !important;
}

body.ops-fullscreen .ops-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  padding: 5px !important;
  border-radius: 8px;
  background: #ffffff !important;
}

body.ops-fullscreen .ops-column__head {
  position: static !important;
  min-height: 30px;
  padding: 5px 6px;
}

body.ops-fullscreen .ops-column__list {
  min-height: 0;
  max-height: none !important;
  overflow: auto !important;
  padding-right: 2px;
}

body.ops-fullscreen .order-card.compact {
  padding: 6px !important;
  gap: 5px !important;
}

body.ops-fullscreen .turn-number {
  width: 38px !important;
  height: 38px !important;
  flex-basis: 38px !important;
  font-size: 23px !important;
}

body.ops-fullscreen .order-card__assistant,
body.ops-fullscreen .order-card__details,
body.ops-fullscreen .order-card__links,
body.ops-fullscreen .order-card__meta .pill:nth-child(n+5) {
  display: none !important;
}

body.ops-fullscreen .order-card__items {
  padding: 5px 6px !important;
}

body.ops-fullscreen .order-card__actions {
  padding-top: 4px !important;
}

body.ops-fullscreen .primary-actions {
  grid-template-columns: 1fr !important;
}

.ops-view-section:not(.is-active) {
  display: none !important;
}

.ops-view-section.is-active {
  display: block;
}

.future-orders-panel.ops-view-section.is-active {
  display: grid;
}

.dashboard-shell .ops-shell--primary {
  padding: 10px;
  min-height: calc(100vh - 116px);
}

.dashboard-shell .ops-shell--primary .ops-header {
  display: none;
}

.dashboard-shell .ops-toolbar {
  position: sticky;
  top: 74px;
  z-index: 35;
  gap: 7px;
  padding: 7px;
  margin-bottom: 7px;
}

.dashboard-shell .ops-filters {
  gap: 5px;
}

.dashboard-shell .ops-filters .chip {
  min-height: 31px;
  padding: 6px 9px;
  font-size: 12px;
}

.dashboard-shell .ops-search {
  min-height: 34px;
}

.dashboard-shell .rush-panel {
  gap: 6px;
  margin: 6px 0 8px;
  padding: 8px;
}

.dashboard-shell .rush-panel__head p {
  display: none;
}

.dashboard-shell .rush-panel__head h3 {
  font-size: 15px;
}

.dashboard-shell .rush-table {
  max-height: 172px;
}

.dashboard-shell .rush-row {
  min-height: 30px;
  grid-template-columns: 0.45fr 0.55fr 0.65fr 0.8fr 0.8fr 1.15fr;
  padding: 5px 7px;
  font-size: 11px;
}

.dashboard-shell .rush-row small {
  font-size: 9px;
}

.dashboard-shell .ops-group-strip {
  display: none;
}

.dashboard-shell .ops-board {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.dashboard-shell .ops-column {
  padding: 6px;
  border-radius: 9px;
}

.dashboard-shell .ops-column__head {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
}

.dashboard-shell .ops-column__list {
  max-height: calc(100vh - 330px);
}

.dashboard-shell .order-card.compact {
  padding: 7px;
  gap: 5px;
  border-left-width: 4px;
  box-shadow: none;
}

.dashboard-shell .order-card__head {
  gap: 6px;
}

.dashboard-shell .order-card__identity {
  gap: 7px;
}

.dashboard-shell .turn-number {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  font-size: 26px;
}

.dashboard-shell .turn-label {
  font-size: 9px;
}

.dashboard-shell .technical-order-id,
.dashboard-shell .order-due-box--route,
.dashboard-shell .order-card__ops {
  display: none;
}

.dashboard-shell .order-card__title {
  gap: 3px;
}

.dashboard-shell .status-pill {
  min-height: 22px;
  padding: 3px 7px;
  font-size: 11px;
}

.dashboard-shell .order-due-stack {
  min-width: 88px;
  max-width: 98px;
}

.dashboard-shell .order-due-box {
  min-width: 88px;
  padding: 5px 6px;
}

.dashboard-shell .order-due-box span,
.dashboard-shell .order-due-box small {
  font-size: 8px;
}

.dashboard-shell .order-due-box strong {
  font-size: 13px;
}

.dashboard-shell .order-card__meta {
  gap: 4px;
}

.dashboard-shell .pill {
  min-height: 20px;
  padding: 3px 6px;
  font-size: 10px;
}

.dashboard-shell .pill-scheduled {
  display: none;
}

.dashboard-shell .order-card__assistant {
  padding: 5px 7px;
}

.dashboard-shell .order-card__assistant span {
  display: none;
}

.dashboard-shell .order-card__assistant strong {
  font-size: 11px;
  line-height: 1.2;
}

.dashboard-shell .order-card__details {
  font-size: 11px;
  line-height: 1.25;
}

.dashboard-shell .order-card__actions {
  gap: 5px;
}

.dashboard-shell .primary-actions,
.dashboard-shell .primary-actions form,
.dashboard-shell .primary-actions .row {
  gap: 5px;
}

.dashboard-shell .order-card__actions button,
.dashboard-shell .order-card__actions .button,
.dashboard-shell .order-card__actions .ghost-button,
.dashboard-shell .primary-actions button,
.dashboard-shell .primary-actions .button {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 11px;
}

.dashboard-shell .order-card__links {
  display: none;
}

.dashboard-shell .order-details .order-card__links {
  display: flex;
}

.dashboard-shell .order-card details.order-details {
  padding-top: 3px;
}

.dashboard-shell .order-card details.order-details summary {
  font-size: 11px;
}

.order-details__meta {
  display: grid;
  gap: 3px;
  padding: 5px 0;
  color: #475569;
  font-size: 11px;
}

.order-details__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Segunda pasada: mesa operativa real, con productos y mapa dentro de la cola. */
.dashboard-shell > .ops-workbar {
  order: 1 !important;
}

.dashboard-shell > .ops-shell--primary {
  order: 2 !important;
}

.dashboard-shell > .ops-view-section:not(.ops-shell--primary) {
  order: 3;
}

.dashboard-shell > .alert {
  order: 4;
}

.dashboard-shell .ops-workbar {
  margin: 0 0 4px;
  padding: 8px 10px;
}

.dashboard-shell .ops-toolbar {
  position: static;
  top: auto;
  margin: 0 0 8px;
  box-shadow: none;
}

.dashboard-shell .ops-shell--primary {
  min-height: 0;
  padding: 8px;
}

.dashboard-shell .ops-board {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: 8px;
}

.dashboard-shell .ops-column__list {
  max-height: none;
  overflow: visible;
  display: grid;
  gap: 7px;
}

.dashboard-shell .ops-column {
  background: rgba(248, 250, 252, 0.72);
}

.dashboard-shell .order-card.compact {
  gap: 6px;
  min-height: 0;
}

.dashboard-shell .order-card__head {
  align-items: center;
}

.dashboard-shell .order-due-stack {
  min-width: 82px;
  max-width: 88px;
}

.dashboard-shell .order-card__meta .pill-distance,
.dashboard-shell .order-card__meta .pill-route-group,
.dashboard-shell .order-card__meta .pill-route-neighbor,
.dashboard-shell .order-card__meta .pill-route-corridor,
.dashboard-shell .order-card__meta .pill-route-time,
.dashboard-shell .order-card__meta .pill-packages {
  display: none;
}

.dashboard-shell .order-card__items {
  display: grid;
  gap: 4px;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.dashboard-shell .order-item-line {
  display: grid;
  gap: 1px;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.2;
}

.dashboard-shell .order-item-line strong {
  font-size: 12px;
  font-weight: 950;
}

.dashboard-shell .order-item-line span,
.dashboard-shell .order-item-line--more {
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-shell .order-card__allergens {
  padding: 6px 7px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-shell .order-card__allergens strong {
  font-weight: 950;
}

.dashboard-shell .order-card__details {
  display: none;
}

.dashboard-shell .order-card__actions {
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
  padding-top: 5px;
}

.dashboard-shell .primary-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
}

.dashboard-shell .primary-actions form,
.dashboard-shell .primary-actions .row {
  min-width: 0;
}

.dashboard-shell .primary-actions select {
  max-width: 100%;
}

.ops-delivery-map {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #ffffff;
}

.ops-delivery-map__head,
.ops-delivery-layout {
  display: grid;
  gap: 10px;
}

.ops-delivery-map__head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.ops-delivery-map__head h3,
.ops-route-panel h4 {
  margin: 0;
}

.ops-delivery-layout {
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.45fr);
}

.ops-map-panel {
  order: 2;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: #f8fafc;
}

.ops-map-panel .map-toolbar {
  padding: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.ops-map-panel #orders-map {
  height: 460px;
  min-height: 460px;
}

.ops-route-panel {
  order: 1;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.ops-route-list,
.ops-rider-map-list {
  display: grid;
  gap: 6px;
  max-height: 238px;
  overflow: auto;
}

.ops-route-list--routes {
  max-height: 330px;
}

.ops-route-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 64px;
  gap: 7px;
  align-items: center;
  padding: 7px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
}

.ops-route-row__id {
  display: grid;
  place-items: center;
  min-height: 32px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-weight: 950;
}

.ops-route-row strong,
.ops-route-row small,
.ops-rider-map-row strong,
.ops-rider-map-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-route-row small,
.ops-rider-map-row span,
.ops-route-row__eta small {
  color: #64748b;
  font-size: 11px;
}

.ops-route-row__eta {
  text-align: right;
  font-weight: 950;
}

.ops-route-card {
  display: grid;
  gap: 8px;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
  outline: none;
}

.ops-route-card[data-map-route-card] {
  cursor: pointer;
}

.ops-route-card[data-map-route-card]:hover,
.ops-route-card[data-map-route-card]:focus-visible {
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.13);
}

.ops-route-card.is-selected {
  border-color: rgba(249, 115, 22, 0.82);
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 62%);
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.2);
  transform: translateY(-1px);
}

.ops-route-card.is-selected .ops-route-row__id {
  background: #f97316;
}

.ops-route-card.is-selected .ops-route-card__action {
  border-color: rgba(249, 115, 22, 0.24);
  background: #ffedd5;
  color: #9a3412;
}

.ops-route-card.is-route-ghost {
  opacity: 0.46;
  filter: saturate(0.55);
}

.ops-route-card.is-route-ghost:hover,
.ops-route-card.is-route-ghost:focus-visible {
  opacity: 0.72;
  filter: saturate(0.82);
}

.ops-route-card__head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
}

.ops-route-card__head strong,
.ops-route-card__head small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-route-card__head small {
  color: #64748b;
  font-size: 11px;
}

.ops-route-card__action {
  padding: 6px 8px;
  border-radius: 8px;
  background: #eef8f7;
  border: 1px solid rgba(15, 118, 110, 0.14);
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
}

.ops-route-focus-button {
  min-height: 30px;
  border: 1px solid rgba(249, 115, 22, 0.24);
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.ops-route-card.is-selected .ops-route-focus-button {
  background: #f97316;
  color: #ffffff;
  border-color: #f97316;
}

.ops-route-card__orders {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ops-route-card__load {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.ops-route-card__load span,
.ops-route-card__load small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 10px;
  font-weight: 950;
}

.ops-route-card__load small {
  color: #64748b;
  background: #ffffff;
}

.ops-route-card__orders span,
.ops-route-stop-chip > span,
.map-info__list li::marker {
  color: #0f766e;
}

.ops-route-stop-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ops-route-card.is-selected .ops-route-stop-chip > span {
  background: #ffedd5;
  border-color: rgba(249, 115, 22, 0.28);
  color: #9a3412;
}

.ops-route-card__orders span,
.ops-route-stop-chip > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 28px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid rgba(15, 118, 110, 0.16);
  font-size: 12px;
  font-weight: 950;
}

.ops-route-stop-chip form {
  margin: 0;
}

.ops-route-stop-chip button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 950;
  cursor: pointer;
}

.ops-route-card__orders span b,
.ops-route-stop-chip > span b {
  color: #0f172a;
  font-size: 11px;
}

.ops-route-card__orders span small,
.ops-route-stop-chip > span small {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
}

.ops-route-stop-chip__detail {
  flex-basis: 100%;
  justify-content: flex-start !important;
  white-space: normal !important;
  line-height: 1.18;
}

.ops-route-carry-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 950;
  cursor: pointer;
}

.ops-route-carry-toggle input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #2563eb;
}

.ops-route-carry-toggle input:disabled + em {
  color: #94a3b8;
}

.ops-route-stop-chip.is-carry-waiting .ops-route-carry-toggle {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.22);
  color: #64748b;
  cursor: not-allowed;
}

.ops-route-stop-chip.is-carry-ready .ops-route-carry-toggle {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.18);
  color: #15803d;
}

.ops-route-carry-toggle em {
  font-style: normal;
}

.ops-route-card__form,
.ops-group-route-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.ops-route-card__form select,
.ops-route-card__form input,
.ops-group-route-form select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.13);
  background: #ffffff;
  padding: 0 8px;
  font: inherit;
  font-weight: 800;
}

.ops-route-card__form button,
.ops-group-route-form button {
  min-height: 34px;
  border-radius: 8px;
  border: 0;
  background: #111827;
  color: #ffffff;
  padding: 0 10px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.ops-route-card__form--manual {
  margin-bottom: 8px;
}

.ops-quick-rider-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ops-quick-rider-form input,
.ops-quick-rider-form button {
  min-height: 34px;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
}

.ops-quick-rider-form input {
  border: 1px solid rgba(15, 23, 42, 0.13);
  padding: 0 8px;
}

.ops-quick-rider-form button {
  border: 0;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
}

.ops-pickup-rescue {
  margin-bottom: 10px;
  padding: 9px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid rgba(249, 115, 22, 0.18);
}

.ops-dispatch-capacity {
  margin-bottom: 10px;
  padding: 9px;
  border-radius: 12px;
  background: #eef2ff;
  border: 1px solid rgba(79, 70, 229, 0.18);
}

.ops-dispatch-capacity summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.ops-dispatch-capacity summary::-webkit-details-marker {
  display: none;
}

.ops-dispatch-capacity summary strong,
.ops-dispatch-capacity summary small {
  display: block;
}

.ops-dispatch-capacity summary strong {
  color: #3730a3;
  font-weight: 950;
}

.ops-dispatch-capacity summary small {
  color: #4338ca;
  font-size: 11px;
  font-weight: 850;
}

.ops-dispatch-capacity summary > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 28px;
  border-radius: 999px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
}

.ops-dispatch-capacity__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.ops-dispatch-capacity__form label {
  display: grid;
  gap: 3px;
  margin: 0;
}

.ops-dispatch-capacity__form label span {
  color: #4338ca;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ops-dispatch-capacity__form input,
.ops-dispatch-capacity__form select,
.ops-dispatch-capacity__form button {
  width: 100%;
  min-height: 32px;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
}

.ops-dispatch-capacity__form input,
.ops-dispatch-capacity__form select {
  border: 1px solid rgba(79, 70, 229, 0.18);
  background: #ffffff;
  padding: 0 8px;
}

.ops-dispatch-capacity__form button {
  grid-column: 1 / -1;
  border: 0;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
}

.ops-pickup-rescue__summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.ops-pickup-rescue__summary::-webkit-details-marker {
  display: none;
}

.ops-pickup-rescue__summary::after {
  content: "Abrir";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #ffffff;
  color: #9a3412;
  font-size: 11px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.18);
}

.ops-pickup-rescue[open] .ops-pickup-rescue__summary::after {
  content: "Cerrar";
}

.ops-pickup-rescue__summary > span,
.ops-pickup-rescue__summary strong,
.ops-pickup-rescue__summary small {
  display: block;
  min-width: 0;
}

.ops-pickup-rescue__summary > b {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #f97316;
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
}

.ops-pickup-rescue__body {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.ops-pickup-rescue__head strong,
.ops-pickup-rescue__head small,
.ops-pickup-rescue__row b,
.ops-pickup-rescue__row span,
.ops-pickup-rescue__more {
  display: block;
}

.ops-pickup-rescue__head strong,
.ops-pickup-rescue__summary strong {
  color: #9a3412;
  font-weight: 950;
}

.ops-pickup-rescue__head small,
.ops-pickup-rescue__row span,
.ops-pickup-rescue__summary small,
.ops-pickup-rescue__more {
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
}

.ops-pickup-rescue__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(249, 115, 22, 0.12);
}

.ops-pickup-rescue__row b {
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-pickup-rescue__actions {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.ops-pickup-rescue__actions form {
  margin: 0;
}

.ops-pickup-rescue__actions a,
.ops-pickup-rescue__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  background: #111827;
  color: #ffffff;
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.ops-pickup-rescue__actions a {
  background: #f97316;
}

.ops-pickup-rescue__more {
  margin: 0;
  padding: 2px 4px;
}

@media (max-width: 860px) {
  .ops-delivery-layout {
    grid-template-columns: 1fr;
  }

  .ops-route-panel,
  .ops-map-panel {
    order: initial;
  }
}

.map-info__list {
  margin: 7px 0 0;
  padding-left: 18px;
}

.map-info__list li {
  margin: 2px 0;
}

.ops-rider-map-row {
  padding: 7px;
  border-radius: 8px;
  background: #eef8f6;
  border: 1px solid rgba(15, 118, 110, 0.12);
}

/* Tercera pasada: tablero operativo legible en hora punta. */
.dashboard-shell > .ops-workbar {
  order: 1 !important;
}

.dashboard-shell > .ops-shell--primary {
  order: 2 !important;
}

.dashboard-shell .ops-workbar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 0 6px;
  padding: 8px 10px;
}

.dashboard-shell .ops-toolbar {
  position: static !important;
  top: auto !important;
  z-index: auto;
  border-radius: 8px;
  margin: 0 0 8px;
}

.dashboard-shell .rush-panel {
  display: grid !important;
  margin: 0 0 10px;
  padding: 8px;
  border-radius: 8px;
}

.dashboard-shell .rush-table {
  max-height: 260px;
  overflow: auto;
}

.dashboard-shell .rush-row {
  grid-template-columns: 54px 96px minmax(240px, 1.8fr) minmax(170px, 0.9fr) minmax(170px, 0.9fr) minmax(170px, 1fr);
  min-height: 42px;
  padding: 7px 8px;
  gap: 8px;
}

.dashboard-shell .rush-row > span {
  min-width: 0;
}

.dashboard-shell .rush-row--head {
  min-height: 34px;
}

.rush-item-line {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.rush-item-line + .rush-item-line {
  margin-top: 2px;
}

.rush-item-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 950;
}

.rush-item-line span,
.rush-item-line--more {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9a3412;
  font-size: 10px;
  font-weight: 850;
}

.dashboard-shell .ops-board {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)) !important;
  gap: 10px;
  width: 100%;
}

.dashboard-shell .ops-column {
  min-width: 0;
  padding: 7px;
}

.dashboard-shell .ops-column__list {
  max-height: none !important;
  overflow: visible !important;
}

.dashboard-shell .order-card.compact {
  padding: 8px;
  gap: 6px;
}

.dashboard-shell .order-card__items {
  padding: 7px 8px;
  background: #ffffff;
}

.dashboard-shell .order-item-line strong {
  font-size: 13px;
}

.dashboard-shell .order-item-line span,
.dashboard-shell .order-item-line--more {
  font-size: 11px;
}

.dashboard-shell .order-card__meta {
  gap: 4px;
}

.dashboard-shell .order-card__meta .pill:nth-child(n+5) {
  display: none;
}

.dashboard-shell .order-card__actions {
  padding-top: 6px;
}

.dashboard-shell .ops-delivery-map {
  margin-top: 12px;
  border-radius: 8px;
}

.dashboard-shell .ops-map-panel #orders-map {
  height: min(44vh, 430px);
  min-height: 320px;
}

/* Cuarta pasada: pantalla de trabajo de restaurante, prioriza densidad y lectura global. */
@media (min-width: 1180px) {
  .dashboard-shell .ops-shell--primary {
    padding: 6px;
    border-radius: 8px;
  }

  .dashboard-shell .ops-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    align-items: center;
    padding: 6px;
    background: #ffffff;
  }

  .dashboard-shell .ops-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .dashboard-shell .ops-filters .chip {
    white-space: nowrap;
  }

  .dashboard-shell .ops-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .dashboard-shell .rush-panel {
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
  }

  .dashboard-shell .rush-table {
    max-height: 220px;
  }

  .dashboard-shell .ops-board {
    grid-template-columns: repeat(5, minmax(210px, 1fr)) !important;
    gap: 8px;
  }

  .dashboard-shell .ops-column {
    padding: 6px;
    background: #ffffff;
  }

  .dashboard-shell .ops-column__head {
    position: sticky;
    top: 0;
    z-index: 2;
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0;
    background: #ffffff;
  }

  .dashboard-shell .ops-column__list {
    max-height: calc(100vh - 430px) !important;
    overflow: auto !important;
    padding-right: 2px;
  }

  .dashboard-shell .order-card.compact {
    padding: 7px;
    border-radius: 8px;
    box-shadow: none;
  }

  .dashboard-shell .turn-number {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 7px;
    font-size: 25px;
  }

  .dashboard-shell .order-due-stack {
    min-width: 78px;
    max-width: 84px;
  }

  .dashboard-shell .order-due-box {
    min-width: 78px;
  }

  .dashboard-shell .order-card__items {
    padding: 6px;
  }

  .dashboard-shell .order-card__assistant {
    display: none;
  }

  .dashboard-shell .order-card__actions {
    padding-top: 5px;
  }

  .dashboard-shell .primary-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-shell .primary-actions button,
  .dashboard-shell .primary-actions .button,
  .dashboard-shell .primary-actions select {
    width: 100%;
  }
}

@media (min-width: 1480px) {
  .dashboard-shell .ops-board {
    grid-template-columns: repeat(6, minmax(210px, 1fr)) !important;
  }
}

@media (min-width: 1180px) {
  .dashboard-shell .ops-delivery-layout {
    grid-template-columns: minmax(320px, 0.85fr) minmax(0, 2.15fr);
  }

  .dashboard-shell .ops-map-panel #orders-map {
    height: min(56vh, 620px);
    min-height: 460px;
  }

  .dashboard-shell .ops-route-list,
  .dashboard-shell .ops-rider-map-list {
    max-height: 310px;
  }

  .map-layout {
    grid-template-columns: minmax(0, 2.4fr) minmax(300px, 0.85fr);
  }

  #orders-map-full {
    width: 100%;
    height: min(64vh, 680px);
    min-height: 520px;
    border-radius: 10px;
    border: 1px solid var(--border);
  }
}

.admin-hero,
.pack-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px 22px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.admin-hero h1,
.pack-hero h1 {
  margin: 4px 0;
  letter-spacing: 0;
}

.admin-hero p,
.pack-hero p {
  margin: 0;
}

.pack-hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(98px, 1fr));
  gap: 8px;
  min-width: min(100%, 440px);
}

.pack-hero__metrics span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.pack-hero__metrics small {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.pack-hero__metrics strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.05;
}

.web-editor-hub {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: start;
  margin: 0 0 16px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.web-editor-hub h2,
.admin-anchor-title h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.web-editor-hub p {
  margin: 6px 0 0;
}

.web-editor-hub__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.web-editor-hub__actions .button,
.web-editor-hub__actions .ghost-button {
  min-height: 40px;
}

.web-editor-hub__status {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.web-editor-hub__status span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.web-editor-hub__status small {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.web-editor-hub__status strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-anchor-title {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 14px 2px 2px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.pack-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 14px;
  align-items: start;
}

.pack-main,
.pack-side,
.pack-item-list {
  display: grid;
  gap: 12px;
}

.pack-side {
  position: sticky;
  top: 12px;
}

.pack-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.pack-card__head,
.ingredient-control-panel__head,
.ingredient-admin__head,
.ingredient-card__top,
.ingredient-card__actions,
.ingredient-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pack-card h2,
.ingredient-control-panel h2,
.ingredient-admin h2 {
  margin: 0;
}

.pack-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.pack-item strong {
  font-size: 18px;
  line-height: 1.15;
}

.pack-item__mods,
.pack-item__allergens,
.pack-print-options,
.ingredient-allergen-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pack-item__mods span,
.pack-item__allergens span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid rgba(234, 88, 12, 0.16);
  font-size: 12px;
  font-weight: 850;
}

.pack-item__allergens small {
  width: 100%;
  color: #64748b;
  font-weight: 900;
  text-transform: uppercase;
}

.pack-address {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
}

.pack-pay-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.pack-package-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pack-package-summary strong {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 26px;
}

.pack-package-summary span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 850;
}

.pack-card--finish {
  border-color: rgba(20, 184, 166, 0.22);
}

.pack-card--finish .stack {
  gap: 10px;
}

.pack-card--finish input[name^="bag_content_"] {
  min-height: 44px;
  font-weight: 850;
  color: #0f172a;
  background: #ffffff;
}

.pack-checklist {
  display: grid;
  gap: 8px;
  margin: 2px 0;
  padding: 11px;
  border: 1px solid rgba(5, 150, 105, .24);
  border-radius: 10px;
  background: #f0fdf4;
}

.pack-checklist legend {
  padding: 0 5px;
  color: #166534;
  font-size: 12px;
  font-weight: 950;
}

.pack-card--finish .pack-check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(22, 101, 52, .14);
  border-radius: 8px;
  background: #fff;
}

.pack-check-row input {
  width: 22px;
  height: 22px;
}

.pack-check-row span {
  display: grid;
  gap: 2px;
}

.pack-check-row small {
  color: #64748b;
  font-weight: 750;
}

.pack-card--finish #bag-item-pool .ghost-button {
  min-height: 32px;
  border-radius: 8px;
  font-size: 12px;
}

.pack-card--finish #bag-unassigned-hint {
  min-height: 18px;
  font-weight: 850;
}

/* Quinta pasada: mantener mapa estable y tablero sin tarjetas pisadas. */
.dashboard-shell .ops-workbar__main > div:first-child {
  display: none;
}

.dashboard-shell .ops-workbar__main {
  justify-content: flex-end;
}

.dashboard-shell .ops-board,
.dashboard-shell .ops-column,
.dashboard-shell .ops-column__list {
  align-items: start;
}

.dashboard-shell .ops-column__list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
}

.dashboard-shell .order-card.compact {
  position: relative;
  min-height: 0;
}

@media (min-width: 1180px) {
  body:not(.ops-fullscreen) .dashboard-shell .ops-column__list {
    max-height: none !important;
    overflow: visible !important;
  }
}

body.ops-fullscreen .dashboard-shell .ops-column__list {
  max-height: calc(100vh - 250px) !important;
  overflow: auto !important;
}

.ingredient-control-panel,
.ingredient-admin {
  margin-top: 14px;
}

.ingredient-create-grid,
.ingredient-card__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.ingredient-advanced {
  grid-column: 1 / -1;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  background: #f8fafc;
}

.ingredient-advanced summary {
  cursor: pointer;
  font-weight: 900;
}

.ingredient-alert-toggle {
  align-self: end;
  padding: 10px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid rgba(234, 88, 12, 0.16);
}

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

.ingredient-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: #ffffff;
}

.ingredient-card.is-off {
  border-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.68), #ffffff 46%);
}

.ingredient-card__form {
  display: grid;
  gap: 10px;
}

.ingredient-card__top {
  justify-content: flex-start;
}

.ingredient-card__top > div:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ingredient-card__top strong,
.ingredient-card__top span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ingredient-card__top span {
  color: #64748b;
  font-size: 12px;
}

.ingredient-thumb {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 950;
  overflow: hidden;
}

.ingredient-thumb img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.ingredient-card__actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.ingredient-card__footer {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.status-ok {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.22);
}

.status-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.24);
}

.status-danger {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.22);
}

@media (max-width: 760px) {
  .site-header {
    padding: 12px;
  }

  .site-header--menu-first .main-nav {
    width: 100%;
  }

  .nav-group {
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
  }

  .content {
    padding: 14px;
  }

  .dashboard-hero {
    padding: 16px;
  }

  .insight-panel,
  .dashboard-insights {
    display: none;
  }

  .quick-category-card__form {
    grid-template-columns: 1fr 1fr;
  }

  .future-order-group__head,
  .future-order-row {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .pack-hero,
  .pack-layout,
  .web-editor-hub,
  .web-editor-hub__status {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .pack-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .pack-hero__metrics,
  .pack-layout {
    min-width: 0;
  }

  .web-editor-hub__actions {
    justify-content: flex-start;
  }

  .pack-side {
    position: static;
  }

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

  .future-order-group__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .future-order-row__amount {
    text-align: left;
  }

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

  .admin-header--focused,
  .admin-focus-panel,
  .admin-operating-model,
  .admin-maintenance-plan__head,
  .admin-playbooks__head,
  .product-config-hub__head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .product-config-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-config-note,
  .product-config-drawer > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 8px;
    backdrop-filter: blur(10px);
  }

  .ops-filters {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
  }

  .ops-tools {
    width: 100%;
  }

  .ops-search {
    flex: 1 1 100%;
    min-width: 0;
  }

  .rush-table {
    max-height: 62vh;
  }

  .rush-row {
    grid-template-columns: 0.8fr 0.7fr 0.7fr 1fr;
  }

  .rush-row span:nth-child(5),
  .rush-row span:nth-child(6) {
    display: none;
  }

  .order-card__head {
    align-items: stretch;
  }

  .turn-number {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    font-size: 31px;
  }

  .order-due-stack {
    max-width: 128px;
    min-width: 110px;
  }

  .order-due-box {
    min-width: 110px;
    padding: 6px 7px;
  }

  .ops-command-center,
  .ops-flow-grid,
  .ops-group-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-shell .ops-board,
  .ops-board {
    display: block;
    overflow: visible;
  }

  .ops-column__list {
    max-height: 62vh;
  }

  .ops-column {
    display: none;
    min-width: 0;
    margin-bottom: 10px;
  }

  .ops-column.has-visible-cards:not(.is-filtered-out),
  .ops-column.has-visible-cards[data-column] {
    display: block;
  }

  .ops-column.is-filtered-out {
    display: none;
  }

  .ops-rider-row {
    align-items: flex-start;
  }
}

/* Zestia OS recipe/configuration clarity layer */
.recipe-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  background: linear-gradient(135deg, rgba(240, 253, 250, .88), #fff);
}

.recipe-hero h1 {
  margin: 2px 0 0;
}

.recipe-workbench {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.recipe-product-panel {
  position: sticky;
  top: 74px;
  padding: 12px;
}

.recipe-product-panel__head {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.recipe-product-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 2px;
}

.recipe-product-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e5edf4;
  border-radius: 10px;
  color: #111827;
  text-decoration: none;
  background: #fff;
}

.recipe-product-link:hover,
.recipe-product-link.is-active {
  border-color: rgba(15, 118, 110, .4);
  background: #f0fdfa;
}

.recipe-product-link.needs-recipe {
  border-color: #fecaca;
  background: #fff7f7;
}

.recipe-product-link strong,
.recipe-product-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-product-link small {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.recipe-product-link em {
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.recipe-product-link.needs-recipe em {
  background: #fee2e2;
  color: #991b1b;
}

.recipe-picker-form {
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
}

.recipe-current-card__main,
.recipe-table-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recipe-current-card h2,
.recipe-table-card h2,
.recipe-add-card h2 {
  margin: 0;
  font-size: 22px;
}

.recipe-add-card {
  display: grid;
  gap: 10px;
}

.recipe-add-form {
  grid-template-columns: minmax(220px, 1.7fr) minmax(100px, .5fr) repeat(2, minmax(130px, .6fr)) auto;
  align-items: end;
}

.recipe-add-form .full {
  grid-column: 1 / -1;
}

.recipe-table-card {
  padding: 12px;
}

.recipe-table-card__head {
  margin-bottom: 10px;
}

.recipe-table td small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.recipe-table input[type="number"] {
  width: 110px;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.recipe-row-actions {
  text-align: right;
  white-space: nowrap;
}

.recipe-save-row {
  margin-top: 10px;
}

.recipe-empty-state {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--ops-radius);
  background: #f8fafc;
}

.recipe-empty-state--large {
  min-height: 160px;
  align-content: center;
}

.product-summary__badges .badge.danger,
.badge.danger {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.product-summary__badges .badge.ok,
.badge.ok {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 980px) {
  .recipe-hero,
  .recipe-current-card__main,
  .recipe-table-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .recipe-workbench {
    grid-template-columns: 1fr;
  }

  .recipe-product-panel {
    position: static;
  }

  .recipe-product-list {
    max-height: 260px;
  }

  .recipe-picker-form,
  .recipe-add-form {
    grid-template-columns: 1fr;
  }
}

/* Pedido manual: los datos pasan a una banda compacta y la pantalla se dedica a carta + carrito. */
@media (min-width: 981px) {
  body:has(.order-form) .order-builder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
    grid-template-areas:
      "details details"
      "menu cart";
    grid-auto-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-height: calc(100dvh - 190px);
    align-items: stretch;
  }

  body:has(.order-form) .order-panel {
    grid-area: details;
    position: static;
    max-height: none;
    overflow: visible;
  }

  body:has(.order-form) .order-panel .order-details {
    display: grid;
    grid-template-columns: minmax(180px, .75fr) minmax(260px, 1fr) minmax(320px, 1.25fr) minmax(300px, 1.15fr);
    gap: 10px;
    padding: 10px;
  }

  body:has(.order-form) .order-panel .form-section {
    min-height: 0;
    padding: 10px;
  }

  body:has(.order-form) .order-panel .form-section > p.muted {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.25;
  }

  body:has(.order-form) .order-panel .manual-address {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:has(.order-form) .order-menu {
    grid-area: menu;
    min-height: 0;
    align-content: stretch;
  }

  body:has(.order-form) .order-cart {
    grid-area: cart;
    position: sticky;
    height: calc(100dvh - 210px);
    max-height: calc(100dvh - 210px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body:has(.order-form) .order-cart .cart-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  body:has(.order-form) .order-cart .order-footer {
    flex: 0 0 auto;
  }

  body:has(.order-form) .quick-extras {
    max-height: 150px;
  }
}

/* Sexta pasada: reparto como pantalla propia, sin destruir el mapa en directo. */
.dashboard-shell .ops-delivery-map.ops-view-section.is-active {
  display: grid;
}

.dashboard-shell .ops-delivery-map {
  margin-top: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
}

.ops-delivery-layout--control {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.72fr) minmax(280px, 0.86fr);
  gap: 8px;
  min-height: calc(100vh - 180px);
  align-items: stretch;
}

.ops-route-panel--planner,
.ops-map-panel--main,
.ops-rider-control-panel {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: none;
}

.ops-route-panel--planner,
.ops-rider-control-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  padding: 10px;
  overflow: hidden;
}

.ops-panel-title {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

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

.ops-panel-title p {
  margin: 0;
  font-size: 12px;
}

.ops-route-panel--planner .ops-route-list,
.ops-route-panel--planner .ops-route-list--routes,
.ops-rider-control-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.ops-route-card {
  box-shadow: none;
}

.ops-route-card--candidate {
  border-left: 5px solid #0f766e;
}

.ops-route-card--active {
  border-left: 5px solid #4f46e5;
}

.ops-route-card__head {
  grid-template-columns: 44px minmax(0, 1fr) 62px;
}

.ops-route-card__action {
  font-size: 12px;
  line-height: 1.25;
}

.ops-route-card__form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ops-map-panel--main {
  order: initial;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #eef2f7;
}

.ops-map-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.ops-map-panel__head h3 {
  margin: 0;
  font-size: 18px;
}

.ops-map-panel__head p {
  margin: 1px 0 0;
}

.ops-map-road-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #ecfdf5;
  color: #065f46;
  font-size: 12px;
  font-weight: 950;
}

.ops-map-road-status[data-state="warning"] {
  background: #fff7ed;
  color: #9a3412;
}

.ops-map-road-status span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ops-map-road-status__warn {
  color: #b45309;
}

.ops-route-trace-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ops-route-trace-badge.is-road {
  background: #dcfce7;
  color: #166534;
}

.ops-route-trace-badge.is-estimated {
  background: #ffedd5;
  color: #9a3412;
}

.ops-map-panel--main #orders-map,
.dashboard-shell .ops-map-panel--main #orders-map {
  width: 100%;
  height: calc(100vh - 294px);
  min-height: 520px;
  border: 0;
}

.ops-map-panel--main .map-hint {
  margin: 0;
  padding: 8px 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 850;
}

.ops-rider-control-list {
  grid-template-columns: 1fr;
}

.ops-rider-control-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.ops-rider-control-card.needs-drop {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff7f7;
}

.ops-rider-control-card__top,
.ops-rider-control-card__meta,
.ops-rider-control-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ops-rider-control-card__top strong,
.ops-rider-control-card__top span {
  display: block;
}

.ops-rider-control-card__top span,
.ops-rider-control-card__meta {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.ops-rider-control-card__top b {
  color: #0f172a;
  font-size: 18px;
  white-space: nowrap;
}

.ops-rider-control-card__meta {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.ops-rider-control-card__meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ops-rider-control-card__actions {
  justify-content: flex-start;
}

.danger-text {
  color: #b91c1c !important;
  background: #fee2e2 !important;
}

.cash-modal[hidden] {
  display: none !important;
}

.cash-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  place-items: center;
  padding: 18px;
}

.cash-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.cash-modal__dialog {
  position: relative;
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.3);
}

.cash-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cash-modal__head h3 {
  margin: 2px 0;
}

.cash-modal form {
  display: grid;
  gap: 12px;
}

.cash-modal input,
.cash-modal select {
  min-height: 42px;
}

.cash-modal button[type="submit"] {
  min-height: 44px;
  border-radius: 8px;
}

body.ops-fullscreen .site-header,
body.ops-fullscreen #context-bar {
  display: none !important;
}

body.ops-fullscreen .content {
  padding: 0 !important;
}

body.ops-fullscreen .dashboard-shell .ops-delivery-map.ops-view-section.is-active {
  position: fixed;
  inset: 54px 0 0 0;
  z-index: 1000;
  margin: 0;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: #eef2f7;
  overflow: hidden;
}

body.ops-fullscreen .ops-delivery-layout--control {
  min-height: 0;
  height: 100%;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.82fr) minmax(270px, 0.78fr);
}

body.ops-fullscreen .ops-map-panel--main #orders-map,
body.ops-fullscreen .dashboard-shell .ops-map-panel--main #orders-map {
  height: 100%;
  min-height: 0;
}

body.ops-fullscreen .ops-map-panel--main {
  height: calc(100vh - 66px);
  height: calc(100dvh - 66px);
}

body.ops-fullscreen .ops-route-panel--planner,
body.ops-fullscreen .ops-rider-control-panel {
  height: calc(100vh - 66px);
  height: calc(100dvh - 66px);
}

body.ops-fullscreen .ops-map-panel__head,
body.ops-fullscreen .ops-panel-title {
  padding: 8px;
}

body.ops-fullscreen .ops-panel-title p,
body.ops-fullscreen .ops-map-panel__head p {
  display: none;
}

/* Septima pasada: la pantalla completa tambien es navegable. */
body.ops-fullscreen .ops-workbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 78px;
  padding: 8px 10px !important;
  background: rgba(255, 255, 255, 0.97);
}

body.ops-fullscreen .ops-workbar__main {
  display: flex !important;
  align-items: center;
  min-width: 0;
}

body.ops-fullscreen .ops-workbar__main > div:first-child {
  display: none;
}

body.ops-fullscreen .ops-workbar__tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 2px;
}

body.ops-fullscreen .ops-workbar__tabs button,
body.ops-fullscreen .ops-workbar__tabs a {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  flex: 0 0 auto;
}

body.ops-fullscreen .ops-workbar__metrics {
  flex-wrap: nowrap;
  gap: 6px;
  min-width: max-content;
}

body.ops-fullscreen .ops-workbar__metrics span:not(.ops-live-state) {
  min-height: 34px;
  padding: 0 9px;
}

body.ops-fullscreen .ops-shell--primary,
body.ops-fullscreen .dashboard-shell .ops-delivery-map.ops-view-section.is-active {
  inset: 78px 0 0 0;
}

body.ops-fullscreen .ops-map-panel--main,
body.ops-fullscreen .ops-route-panel--planner,
body.ops-fullscreen .ops-rider-control-panel {
  height: calc(100vh - 90px);
  height: calc(100dvh - 90px);
}

/* Sexta pasada: tarjetas de trabajo mas densas, sin pisarse. */
.dashboard-shell .ops-board {
  grid-auto-flow: row;
  grid-auto-rows: minmax(0, auto);
}

.dashboard-shell .ops-column {
  overflow: hidden;
}

.dashboard-shell .ops-column__list {
  overscroll-behavior: contain;
}

.dashboard-shell .order-card.compact {
  overflow: hidden;
}

.dashboard-shell .order-card__items {
  max-height: 94px;
  overflow: hidden;
}

.dashboard-shell .order-card__actions {
  display: grid;
  grid-template-columns: 1fr;
}

body.ops-fullscreen .dashboard-shell .order-card__items {
  max-height: 74px;
}

body.ops-fullscreen .dashboard-shell .ops-board {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
}

/* Sexta pasada: montaje profesional, bultos y bolsas como datos operativos. */
.pack-hero {
  align-items: center;
  margin-bottom: 12px;
  padding: 16px 18px;
}

.pack-hero h1 {
  font-size: clamp(28px, 3vw, 42px);
}

.pack-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}

.pack-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.pack-stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
}

.pack-stepper li > span {
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 950;
}

.pack-stepper li div {
  display: grid;
  min-width: 0;
}

.pack-stepper li strong,
.pack-stepper li small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-stepper li strong {
  color: #0f172a;
  font-size: 12px;
}

.pack-stepper li small {
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
}

.pack-stepper li.is-active {
  border-color: rgba(37, 99, 235, .34);
  background: #eff6ff;
}

.pack-stepper li.is-active > span {
  background: #2563eb;
  color: #fff;
}

.pack-stepper li.is-complete {
  border-color: rgba(5, 150, 105, .3);
  background: #ecfdf5;
}

.pack-stepper li.is-complete > span {
  background: #059669;
  color: #fff;
}

.pack-card--items {
  background: #f8fafc;
}

.pack-item-list {
  gap: 8px;
}

.pack-item {
  grid-template-columns: minmax(0, 1fr);
  padding: 10px 12px;
  background: #ffffff;
}

.pack-item__line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.pack-item__qty {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 15px;
}

.pack-item__check {
  padding: 5px 8px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.pack-item strong {
  font-size: 17px;
}

.pack-card--finish {
  position: relative;
  border-color: rgba(20, 184, 166, 0.28);
  background: linear-gradient(180deg, #ffffff, #f8fffd);
}

.pack-card--finish label {
  display: grid;
  gap: 6px;
  font-weight: 900;
}

.pack-card--finish label > span,
.pack-card--finish .stack > span {
  color: #334155;
  font-size: 12px;
  font-weight: 950;
}

.pack-card--finish #bags-count-input {
  max-width: 150px;
  font-size: 20px;
  font-weight: 950;
}

.pack-card--finish #bag-item-pool {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
}

.pack-card--finish #bag-item-pool .ghost-button {
  justify-content: flex-start;
  min-height: 36px;
  background: #ffffff;
}

.pack-card--finish #bag-item-pool .ghost-button.is-assigned {
  border-color: rgba(22, 163, 74, 0.26);
  background: #ecfdf5;
  color: #166534;
}

.pack-card--finish #bag-contents-container {
  display: grid;
  gap: 10px;
}

.pack-card--finish #bag-contents-container label {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.pack-card--finish #bag-contents-container label > span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}

.pack-card--finish input[name^="bag_content_"] {
  min-height: 48px;
  border-color: rgba(15, 23, 42, 0.12);
}

.pack-print-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pack-print-options label {
  min-height: 38px;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.pack-card--finish button[type="submit"] {
  min-height: 48px;
  font-size: 16px;
}

@media (max-width: 1180px) {
  .ops-delivery-layout--control,
  body.ops-fullscreen .ops-delivery-layout--control {
    grid-template-columns: 1fr;
  }

  .ops-map-panel--main #orders-map,
  .dashboard-shell .ops-map-panel--main #orders-map {
    height: 58vh;
    min-height: 420px;
  }

  body.ops-fullscreen .ops-route-panel--planner,
  body.ops-fullscreen .ops-rider-control-panel,
  body.ops-fullscreen .ops-map-panel--main {
    height: auto;
  }
}

@media (max-width: 720px) {
  .pack-stepper {
    grid-template-columns: 1fr;
  }

  .pack-stepper li {
    min-height: 44px;
  }

  .pack-item__check {
    display: none;
  }
}

/* Septima pasada: cualquier vista operativa debe funcionar tambien en pantalla completa. */
body.ops-fullscreen .dashboard-shell .ops-view-section.is-active:not(.ops-shell--primary):not(.ops-delivery-map) {
  position: fixed;
  inset: 78px 0 0 0;
  z-index: 1000;
  margin: 0;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: #eef2f7;
  overflow: auto;
}

/* Octava pasada: programados como plan operativo, no como tabla administrativa. */
.future-orders-panel--ops {
  gap: 14px;
  padding: 14px 16px;
  border-color: rgba(15, 23, 42, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
}

.future-orders-head {
  align-items: flex-start;
  gap: 14px;
}

.future-orders-head h2 {
  margin: 2px 0 0;
}

.future-orders-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.future-order-kpi {
  display: grid;
  gap: 5px;
  min-height: 94px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.future-order-kpi span,
.future-order-kpi small {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.future-order-kpi span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.future-order-kpi strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1.1;
}

.future-map-groups {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 58%, #fff7ed 100%);
}

.future-map-groups__head,
.future-route-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.future-map-groups__head strong,
.future-route-card__top strong {
  display: block;
  color: #0f172a;
  font-weight: 950;
}

.future-map-groups__head span,
.future-route-card__top span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.future-route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.future-route-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.future-route-card__orders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.future-route-card__orders a {
  display: inline-grid;
  min-width: 52px;
  gap: 1px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
}

.future-route-card__orders b {
  font-size: 15px;
  line-height: 1;
}

.future-route-card__orders small {
  max-width: 100px;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.future-order-group {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.future-order-group__head {
  background: #111827;
  color: #ffffff;
}

.future-order-group__head span {
  color: rgba(255, 255, 255, 0.72);
}

.future-order-list {
  gap: 8px;
  padding: 10px;
  border: 0;
  background: #f8fafc;
}

.future-order-row--card {
  grid-template-columns: 72px minmax(120px, 0.85fr) minmax(150px, 1fr) minmax(260px, 1.55fr) auto;
  min-height: 76px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.future-order-row--card:hover {
  border-color: rgba(20, 184, 166, 0.28);
  background: #ffffff;
}

.future-order-turn {
  display: grid;
  place-items: center;
  align-self: stretch;
  padding: 6px;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  text-align: center;
}

.future-order-turn strong {
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.future-order-turn small {
  color: rgba(255, 255, 255, 0.74);
}

.future-order-service strong,
.future-order-client strong {
  font-size: 16px;
}

.future-order-row__items small {
  color: #0f766e;
  font-weight: 900;
}

.future-order-row__amount {
  padding-left: 10px;
  font-size: 18px;
}

.ops-route-card--candidate {
  border-color: rgba(20, 184, 166, 0.22);
  background: linear-gradient(180deg, #ffffff, #f0fdfa);
}

.ops-route-card--active {
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(180deg, #ffffff, #eff6ff);
}

.ops-route-card__head .ops-route-row__id {
  color: #ffffff;
}

.map-info strong {
  color: #0f172a;
}

@media (max-width: 1120px) {
  .future-order-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .future-order-row--card {
    grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr);
  }

  .future-order-row__items,
  .future-order-row__amount {
    grid-column: 2 / -1;
  }
}

@media (max-width: 720px) {
  .future-orders-head,
  .future-map-groups__head {
    display: grid;
  }

  .future-orders-head__actions {
    justify-content: flex-start;
  }

  .future-order-overview {
    grid-template-columns: 1fr;
  }

  .future-order-row--card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .future-order-service,
  .future-order-client,
  .future-order-row__items,
  .future-order-row__amount {
    grid-column: 2 / -1;
  }

  .future-order-row__amount {
    text-align: left;
    padding-left: 0;
  }
}

@media (max-width: 980px) {
  body.ops-fullscreen .ops-workbar {
    grid-template-columns: 1fr;
    min-height: 116px;
  }

  body.ops-fullscreen .ops-shell--primary,
  body.ops-fullscreen .dashboard-shell .ops-delivery-map.ops-view-section.is-active,
  body.ops-fullscreen .dashboard-shell .ops-view-section.is-active:not(.ops-shell--primary):not(.ops-delivery-map) {
    inset: 116px 0 0 0;
  }
}

/* Septima pasada: detalle de comanda como ficha operativa. */
.order-detail-shell {
  display: grid;
  gap: 14px;
}

.order-detail-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 0.95fr) auto;
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.order-detail-hero__main h1 {
  margin: 4px 0 6px;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 0.95;
  letter-spacing: 0;
}

.order-detail-hero__main p {
  margin: 0;
  color: #475569;
  font-weight: 800;
}

.order-detail-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.order-detail-hero__stats article,
.package-summary-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 8px;
  background: #fff;
}

.order-detail-hero__stats span,
.package-summary-grid span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.order-detail-hero__stats strong,
.package-summary-grid strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.order-detail-actions {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 150px;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 14px;
  align-items: start;
}

.order-detail-main,
.order-detail-side {
  display: grid;
  gap: 14px;
}

.order-detail-card {
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.055);
}

.order-detail-card h2,
.order-detail-card__head h2 {
  margin: 0;
  font-size: 22px;
}

.order-detail-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.order-detail-card__head p {
  margin: 3px 0 0;
  color: #64748b;
}

.order-lines-pro {
  display: grid;
  gap: 8px;
}

.order-line-pro {
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.order-line-pro__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-line-pro__title strong {
  font-size: 20px;
}

.order-line-pro__title span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 900;
}

.order-line-pro__mods,
.allergen-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.order-line-pro__mods span,
.allergen-chip-list span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 900;
}

.order-line-pro__mods .is-remove {
  background: #fee2e2;
  color: #991b1b;
}

.order-line-pro__mods .is-extra {
  background: #dcfce7;
  color: #166534;
}

.package-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.package-code-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.package-code-list article {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.package-code-list b {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.package-code-list strong,
.package-code-list span {
  display: block;
}

.package-code-list span {
  color: #64748b;
  font-weight: 800;
}

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

.station-card {
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.station-card__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.station-card ul,
.timeline-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

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

.detail-list div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f7;
}

.detail-list dt {
  color: #64748b;
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
  font-weight: 900;
}

.order-address {
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 18px;
  font-weight: 950;
}

.order-note-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.order-action-stack {
  display: grid;
  gap: 9px;
}

.order-action-stack form,
.order-action-stack button,
.order-action-stack a {
  width: 100%;
}

.timeline-list li {
  margin-bottom: 7px;
}

.timeline-list strong,
.timeline-list span {
  display: block;
}

.timeline-list span {
  color: #475569;
}

@media (max-width: 1120px) {
  .order-detail-hero,
  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .order-detail-hero__stats,
  .package-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ops-guide-button {
  border: 1px solid #d7e2ef;
  background: #ffffff;
  color: #111827;
  box-shadow: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 950;
}

.ops-guide[hidden] {
  display: none !important;
}

.ops-guide {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
}

.ops-guide__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
}

.ops-guide__spotlight {
  position: absolute;
  z-index: 1;
  border: 3px solid #ffffff;
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(37, 111, 108, 0.92), 0 22px 46px rgba(15, 23, 42, 0.24);
  pointer-events: none;
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.ops-guide__spotlight[hidden] {
  display: none;
}

.ops-guide__panel {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  border: 1px solid #d9e4f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
  padding: 20px;
}

.ops-guide__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.ops-guide__head h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.05;
}

.ops-guide__progress {
  height: 8px;
  margin: 18px 0;
  border-radius: 999px;
  background: #e5edf5;
  overflow: hidden;
}

.ops-guide__progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #256f6c;
  transition: width 0.2s ease;
}

.ops-guide__panel p {
  margin: 0;
  color: #334155;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 750;
}

.ops-guide__hint {
  min-height: 42px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #eef8f6;
  color: #155e59;
  font-size: 15px;
  font-weight: 900;
}

.ops-guide__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.ops-guide__actions button {
  min-width: 120px;
}

.ops-guide__actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ops-guide-target {
  position: relative;
  z-index: 3;
  outline: 3px solid #256f6c;
  outline-offset: 4px;
  box-shadow: 0 0 0 9px rgba(37, 111, 108, 0.16), 0 18px 40px rgba(15, 23, 42, 0.18);
}

.ops-guide-click-pulse {
  animation: opsGuideClickPulse 0.88s ease-out;
}

.ops-guide__actions .is-active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

@keyframes opsGuideClickPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.42);
  }
  45% {
    transform: scale(0.96);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.12);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@media (max-width: 720px) {
  .ops-guide {
    align-items: end;
    padding: 12px;
  }

  .ops-guide__panel {
    padding: 16px;
  }

  .ops-guide__head {
    display: grid;
  }

  .ops-guide__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Release polish: alta de pedidos como puesto de venta real. */
body:has(.order-form) {
  background: #eef2f7;
}

body:has(.order-form) .content {
  width: 100%;
  max-width: none;
  padding: 16px 24px 28px;
}

body:has(.order-form) .page-header {
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body:has(.order-form) .page-header h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

body:has(.order-form) .order-lookup {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

body:has(.order-form) .order-builder {
  grid-template-columns: minmax(300px, 350px) minmax(520px, 1fr) minmax(310px, 360px);
  gap: 14px;
}

body:has(.order-form) .order-panel,
body:has(.order-form) .order-cart {
  top: 14px;
  max-height: calc(100vh - 28px);
  border-radius: 8px;
}

body:has(.order-form) .order-details,
body:has(.order-form) .order-cart {
  border: 1px solid rgba(203, 213, 225, 0.92);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

body:has(.order-form) .form-section {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(203, 213, 225, 0.7);
}

body:has(.order-form) .order-menu {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

body:has(.order-form) .menu-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

body:has(.order-form) .menu-toolbar h2 {
  margin: 0;
  font-size: 21px;
}

body:has(.order-form) .category-nav {
  position: sticky;
  top: 78px;
  z-index: 28;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  margin: 0;
  padding: 8px;
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

body:has(.order-form) .category-pill {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
}

body:has(.order-form) .menu-section {
  scroll-margin-top: 150px;
}

body:has(.order-form) .section-header {
  margin: 4px 0 8px;
  padding: 0 2px;
}

body:has(.order-form) .section-header h3 {
  font-size: 18px;
}

body:has(.order-form) .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

body:has(.order-form) .product-card {
  min-width: 0;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

body:has(.order-form) .product-body {
  padding: 12px;
  gap: 8px;
}

body:has(.order-form) .product-title {
  align-items: flex-start;
}

body:has(.order-form) .product-title h3 {
  font-size: 16px;
  line-height: 1.18;
}

body:has(.order-form) .price {
  color: #0f766e;
  white-space: nowrap;
}

body:has(.order-form) .quick-extras {
  max-height: 212px;
  overflow: auto;
  border-radius: 8px;
  background: #f8fafc;
}

body:has(.order-form) .quick-extras__option {
  border-radius: 8px;
  padding: 5px 8px;
}

body:has(.order-form) .qty-stepper,
body:has(.order-form) .qty-btn,
body:has(.order-form) .add-selection,
body:has(.order-form) .customize {
  border-radius: 8px;
}

body:has(.order-form) .product-actions {
  gap: 8px;
}

body:has(.order-form) .order-cart {
  padding: 16px;
  background: #ffffff;
}

body:has(.order-form) .order-cart .order-footer {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 30%);
}

@media (min-width: 1320px) {
  body:has(.order-form) .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 1180px) {
  body:has(.order-form) .order-builder {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.2fr);
  }

  body:has(.order-form) .order-cart {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
}

@media (max-width: 980px) {
  body:has(.order-form) .content {
    padding: 10px;
  }

  body:has(.order-form) {
    overflow-x: hidden;
  }

  body:has(.order-form) .page-header {
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  body:has(.order-form) .page-header h1 {
    font-size: 20px;
  }

  body:has(.order-form) .page-header .muted,
  body:has(.order-form) .order-lookup {
    display: none;
  }

  body:has(.order-form) .order-builder {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body:has(.order-form) .order-panel,
  body:has(.order-form) .order-menu,
  body:has(.order-form) .order-cart {
    width: 100%;
    min-width: 0;
  }

  body:has(.order-form) .order-panel,
  body:has(.order-form) .order-cart {
    max-height: none;
    overflow: visible;
  }

  body:has(.order-form) .mobile-order-wizard {
    top: 8px;
    border-radius: 8px;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  }

  body:has(.order-form) .mobile-order-wizard__bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  body:has(.order-form) .mobile-order-wizard__summary {
    text-align: left;
    font-weight: 800;
    color: #0f172a;
  }

  body:has(.order-form) .mobile-order-wizard__cart-button {
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 900;
    white-space: nowrap;
  }

  body:has(.order-form) .menu-toolbar,
  body:has(.order-form) .category-nav {
    position: static;
  }

  body:has(.order-form) .menu-toolbar {
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  body:has(.order-form) .menu-toolbar h2 {
    font-size: 18px;
  }

  body:has(.order-form) .menu-toolbar p,
  body:has(.order-form) .menu-search .muted {
    display: none;
  }

  body:has(.order-form) .menu-search,
  body:has(.order-form) .menu-actions {
    width: 100%;
  }

  body:has(.order-form) .menu-search input {
    min-width: 0;
    width: 100%;
  }

  body:has(.order-form) .category-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0;
    padding: 7px;
    scroll-snap-type: x proximity;
  }

  body:has(.order-form) .category-pill {
    scroll-snap-align: start;
  }

  body:has(.order-form) .product-grid {
    grid-template-columns: 1fr;
  }

  body:has(.order-form) .product-card {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  }

  body:has(.order-form) .product-body {
    padding: 10px;
  }

  body:has(.order-form) .product-desc,
  body:has(.order-form) .badges {
    display: none;
  }

  body:has(.order-form) .quick-extras {
    max-height: 154px;
  }

  body:has(.order-form) .quick-extras__options {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body:has(.order-form) .quick-extras__option {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body:has(.order-form) .product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  body:has(.order-form) .product-actions .qty-field {
    grid-column: 1 / -1;
  }

  body:has(.order-form) .qty-stepper {
    width: 100%;
    justify-content: space-between;
  }

  body:has(.order-form) .qty-stepper input {
    flex: 1;
    min-width: 0;
  }

  body:has(.order-form) .add-selection,
  body:has(.order-form) .toggle-customize {
    min-height: 44px;
    width: 100%;
  }

  body:has(.order-form) .customize {
    max-height: 50vh;
    overflow: auto;
  }

  body:has(.order-form) .order-cart {
    padding: 14px;
  }

  body:has(.order-form) .order-cart .cart-list {
    max-height: 46vh;
    overflow: auto;
  }

  body:has(.order-form) .order-cart .order-footer {
    position: sticky;
    bottom: 0;
  }

  body:has(.order-form) .order-cart .order-footer button {
    min-height: 50px;
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  body:has(.order-form) .mobile-order-wizard__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body:has(.order-form) .mobile-order-wizard__step {
    min-height: 38px;
    padding: 0 4px;
    font-size: 11px;
    letter-spacing: 0;
  }

  body:has(.order-form) .mobile-order-wizard__bar {
    grid-template-columns: 1fr;
  }

  body:has(.order-form) .page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body:has(.order-form) .product-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body:has(.order-form) .product-title h3 {
    overflow-wrap: anywhere;
  }
}

.admin-pro-hero--offers {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(17, 94, 89, 0.92));
}

.offer-release-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.offer-release-card,
.offer-admin-card,
.offer-rule-card {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.offer-release-card {
  padding: 18px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.offer-release-card h2,
.offer-rule-card h3 {
  margin: 6px 0;
  letter-spacing: 0;
}

.offer-admin-card {
  padding: 18px;
}

.offer-rule-form {
  display: grid;
  gap: 16px;
}

.offer-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

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

.offer-form-wide {
  grid-column: 1 / -1;
}

.offer-rule-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.offer-rule-form input,
.offer-rule-form select {
  width: 100%;
  min-height: 42px;
}

.offer-rule-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr);
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(240, 253, 250, 0.58);
}

.offer-rule-panel--commerce {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.offer-rule-panel--activation {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  background:
    linear-gradient(135deg, rgba(238, 242, 255, 0.92), rgba(240, 253, 250, 0.78));
  border-color: rgba(79, 70, 229, 0.2);
}

.offer-rule-panel > div {
  min-width: 0;
}

.offer-days-block {
  display: grid;
  gap: 6px;
}

.offer-days-block p {
  margin: 0;
}

.offer-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.offer-days label,
.toggle-line {
  display: inline-flex;
  align-items: center;
}

.offer-days label {
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #334155;
  font-size: 12px;
}

.offer-days input,
.toggle-line input {
  width: auto;
  min-height: 0;
}

.toggle-line {
  align-self: end;
  flex-direction: row;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.inline-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.offer-list-section {
  margin-top: 20px;
}

.offer-rule-list {
  display: grid;
  gap: 14px;
}

.offer-family-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.offer-family-section__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.offer-family-section__head h3 {
  margin: 0 0 4px;
}

.offer-rule-card {
  padding: 16px;
}

.offer-rule-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.offer-rule-card__head > div {
  min-width: 0;
}

.offer-rule-card__head form {
  flex: 0 0 auto;
}

.offer-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0 16px;
}

.offer-summary-grid span {
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.offer-condition-line {
  display: inline-flex;
  max-width: 100%;
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .offer-rule-panel {
    grid-template-columns: 1fr;
  }

  .offer-rule-card__head {
    display: grid;
  }
}

/* Ajustes moviles finales para caja y operaciones. */
@media (max-width: 720px) {
  body.app-shell {
    min-width: 0;
    overflow-x: hidden;
    background: #f8fafc;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 10px;
  }

  .brand {
    min-width: 0;
    font-size: 16px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 7px;
  }

  .nav-toggle {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #dbe3ee;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .main-nav {
    grid-column: 1 / -1;
    width: 100%;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    padding-top: 4px;
  }

  .nav-open .main-nav {
    display: flex;
  }

  .nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    padding: 6px;
    border-radius: 10px;
    background: #ffffff;
  }

  .nav-label {
    position: static;
    grid-column: 1 / -1;
    padding: 2px 4px;
    background: transparent;
  }

  .main-nav a,
  .nav-meta .chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 38px;
    padding: 8px 9px;
    border-radius: 8px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }

  .nav-meta {
    margin-left: 0;
  }

  .context-bar {
    display: grid;
    gap: 8px;
    padding: 8px 10px;
    overflow: visible;
    background: #f8fafc;
  }

  .context-bar[hidden] {
    display: none;
  }

  .context-bar__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
    min-width: 0;
    gap: 7px;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
  }

  .context-bar__item strong,
  .context-bar__meta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .context-bar__btn {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 7px;
  }

  .app-shell .content,
  .app-shell-main,
  .app-shell-frames,
  .app-shell-frame {
    min-width: 0;
  }

  .app-shell-frame {
    background: #f8fafc;
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    gap: 10px;
  }

  .dashboard-shell .ops-workbar {
    display: grid;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
  }

  .dashboard-shell .ops-workbar__main,
  .dashboard-shell .ops-workbar__metrics,
  .dashboard-shell .ops-workbar__tabs {
    min-width: 0;
  }

  .dashboard-shell .ops-workbar__main {
    display: grid;
    gap: 6px;
  }

  .dashboard-shell .ops-workbar__metrics,
  .dashboard-shell .ops-workbar__tabs,
  .dashboard-shell .ops-toolbar,
  .dashboard-shell .ops-filters {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .dashboard-shell .ops-workbar__tabs button,
  .dashboard-shell .ops-workbar__tabs a {
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 8px;
  }

  .dashboard-shell .ops-shell--primary {
    padding: 8px;
    border-radius: 10px;
  }

  .dashboard-shell .ops-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-shell .ops-column {
    display: block;
    margin: 0;
    border-radius: 10px;
  }

  .dashboard-shell .ops-column:not(.has-visible-cards) {
    display: none;
  }

  .dashboard-shell .ops-column__list {
    max-height: none;
    overflow: visible;
  }

  .dashboard-shell .order-card.compact {
    padding: 9px;
    border-radius: 10px;
  }

  .dashboard-shell .order-card__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
  }

  .dashboard-shell .order-due-stack {
    min-width: 92px;
    max-width: 98px;
  }

  .dashboard-shell .order-card__actions,
  .dashboard-shell .primary-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .dashboard-shell .order-card__actions button,
  .dashboard-shell .order-card__actions .button,
  .dashboard-shell .order-card__actions .ghost-button,
  .dashboard-shell .primary-actions button,
  .dashboard-shell .primary-actions .button,
  .dashboard-shell .primary-actions select {
    min-height: 40px;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .order-detail-shell,
  .order-detail-card,
  .order-detail-hero {
    min-width: 0;
  }

  .order-detail-hero {
    padding: 12px;
  }

  .order-detail-hero__stats,
  .package-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .order-detail-actions,
  .package-code-list,
  .station-grid,
  .detail-list div {
    grid-template-columns: 1fr;
  }

  .order-line-pro__title {
    display: grid;
    gap: 6px;
  }
}

/* Administracion pro: menu de app, metricas reales y sonidos */
.sound-toggle {
  min-height: 36px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  padding: 0 13px;
  background: #e6fffb;
  color: #0f766e;
  font-weight: 900;
  cursor: pointer;
}

.sound-toggle.is-off {
  background: #f8fafc;
  color: #64748b;
}

.admin-home--pro {
  max-width: 1500px;
  gap: 18px;
}

.admin-pro-console,
.admin-delivered-model,
.admin-config-workspace,
.admin-sounds-panel,
.admin-real-metrics,
.admin-readiness {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

.admin-pro-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 18px;
  align-items: end;
  padding: 18px;
}

.admin-pro-console h1,
.admin-real-metrics h2,
.admin-readiness h2 {
  margin: 4px 0 6px;
}

.lucia-command {
  display: grid;
  gap: 8px;
}

.lucia-command label {
  font-weight: 900;
  color: #0f766e;
}

.lucia-command > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lucia-command input {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.lucia-command button {
  min-height: 46px;
}

.admin-delivered-model {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.admin-config-workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  overflow: hidden;
}

.admin-config-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.admin-config-menu__head {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-config-menu__head input {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.admin-config-menu__item {
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.admin-config-menu__item span {
  font-weight: 900;
}

.admin-config-menu__item small {
  color: #64748b;
}

.admin-config-menu__item.is-active {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
}

.admin-config-panels {
  min-width: 0;
  padding: 18px;
}

.admin-config-panel {
  display: none;
}

.admin-config-panel.is-active {
  display: grid;
  gap: 16px;
}

.admin-config-panel__head,
.admin-real-metrics__head,
.admin-readiness__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.admin-config-panel .admin-module-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.admin-config-panel .admin-module-card {
  min-height: 118px;
  border-radius: 8px;
  box-shadow: none;
}

.admin-sounds-panel,
.admin-real-metrics,
.admin-readiness {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.admin-sound-grid,
.admin-insight-summary,
.admin-insight-columns {
  display: grid;
  gap: 10px;
}

.admin-sound-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.admin-sound-grid button {
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 13px;
  background: #f8fafc;
  color: #111827;
}

.admin-sound-grid button span {
  color: #64748b;
  font-size: 13px;
}

.admin-insight-summary {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.admin-insight-stat,
.admin-insight-row {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  text-decoration: none;
}

.admin-insight-stat {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.admin-insight-stat strong {
  font-size: 30px;
  line-height: 1;
}

.admin-insight-stat span,
.admin-insight-row strong {
  font-weight: 900;
}

.admin-insight-stat small,
.admin-insight-row small {
  color: #64748b;
}

.admin-insight-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-insight-box {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-insight-box h3 {
  margin: 0 0 4px;
}

.admin-insight-row {
  display: grid;
  gap: 3px;
  padding: 12px;
}

.admin-insight-row span {
  color: #0f766e;
  font-weight: 900;
}

@media (max-width: 980px) {
  .admin-pro-console,
  .admin-delivered-model,
  .admin-config-workspace,
  .admin-insight-columns {
    grid-template-columns: 1fr;
  }

  .admin-config-menu {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
}

.ops-assistant {
  bottom: 18px;
  position: fixed;
  right: 18px;
  pointer-events: none;
  z-index: 2147483000;
}

.ops-assistant__toggle,
.ops-assistant__panel,
.ops-assistant__input-row,
.ops-assistant__status,
.ops-assistant__switch,
.ops-assistant__manual,
.ops-assistant__suggestions button,
.ops-assistant__mic,
.ops-assistant__panel header button {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
}

.ops-assistant__toggle {
  align-items: center;
  background: #0f172a;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
  color: #fff;
  display: flex;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  pointer-events: auto;
}

.ops-assistant__toggle span {
  background: #e2e8f0;
  border-radius: 999px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
}

.ops-assistant.is-enabled .ops-assistant__toggle span {
  background: #bbf7d0;
  color: #14532d;
}

.ops-assistant__toggle strong {
  font-size: 15px;
}

.ops-assistant__panel {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
  max-width: calc(100vw - 28px);
  padding: 14px;
  pointer-events: auto;
  width: 390px;
}

.ops-assistant__panel[hidden] {
  display: none;
}

.ops-assistant__panel header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.ops-assistant__panel header span {
  color: #64748b;
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ops-assistant__panel header strong {
  color: #0f172a;
  font-size: 18px;
}

.ops-assistant__state {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

.ops-assistant__switch {
  align-items: center;
  background: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
}

.ops-assistant__switch input {
  accent-color: #14b8a6;
  height: 18px;
  width: 18px;
}

.ops-assistant__switch span {
  color: #334155;
  font-weight: 900;
}

.ops-assistant.is-enabled .ops-assistant__switch {
  background: #ecfdf5;
  border-color: rgba(20, 184, 166, 0.32);
}

.ops-assistant.is-enabled .ops-assistant__switch span {
  color: #115e59;
}

.ops-assistant__panel header button,
.ops-assistant__suggestions button,
.ops-assistant__input-row button {
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-weight: 900;
  min-height: 38px;
  padding: 8px 10px;
}

.ops-assistant__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-assistant__suggestions button {
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.ops-assistant__status {
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  min-height: 46px;
  padding: 10px;
}

.ops-assistant__status[data-tone="ok"] {
  background: #ecfdf5;
  border-color: rgba(20, 184, 166, 0.32);
  color: #115e59;
}

.ops-assistant__status[data-tone="warn"] {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.42);
  color: #92400e;
}

.ops-assistant__status[data-tone="thinking"] {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.24);
  color: #1d4ed8;
}

.ops-assistant__transcript {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  max-height: 260px;
  min-height: 130px;
  overflow: auto;
  padding: 10px;
}

.ops-assistant__line {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  color: #334155;
  font-size: 14px;
  line-height: 1.35;
  padding: 8px 10px;
}

.ops-assistant__line.is-user {
  background: #0f172a;
  color: #fff;
}

.ops-assistant__line.is-ok {
  border-color: rgba(20, 184, 166, 0.35);
  color: #115e59;
}

.ops-assistant__line.is-warn {
  border-color: rgba(245, 158, 11, 0.45);
  color: #92400e;
}

.ops-assistant__line.is-thinking,
.ops-assistant__line.is-guide {
  color: #475569;
}

.ops-assistant__input-row {
  align-items: center;
  background: #fff;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 8px;
}

.ops-assistant__input-row input {
  border: 0;
  color: #0f172a;
  font: inherit;
  min-height: 38px;
  min-width: 0;
  outline: 0;
}

.ops-assistant__input-row button[data-assistant-send] {
  background: #0f172a;
  color: #fff;
}

.ops-assistant__manual {
  background: #fff;
  color: #334155;
  padding: 8px;
}

.ops-assistant__manual summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.ops-assistant__manual .ops-assistant__input-row {
  border: 0;
  margin-top: 8px;
  padding: 0;
}

.ops-assistant__mic {
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  min-height: 42px;
  padding: 8px 12px;
}

.ops-assistant__mic.is-listening {
  background: #ccfbf1;
  border-color: #14b8a6;
  color: #115e59;
}

.ops-assistant.is-listening .ops-assistant__toggle span {
  background: #bbf7d0;
  color: #14532d;
}

@media (max-width: 680px) {
  .ops-assistant {
    bottom: 10px;
    left: 10px;
    right: 10px;
  }

  .ops-assistant__panel {
    width: auto;
  }

  .ops-assistant__state {
    grid-template-columns: 1fr;
  }

  .ops-assistant__mic,
  .ops-assistant__switch {
    justify-content: center;
    width: 100%;
  }

  .ops-assistant__toggle {
    justify-content: center;
    width: 100%;
  }
}

/* Release candidate polish: negocio operativo */
html {
  -webkit-text-size-adjust: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  backdrop-filter: blur(18px);
}

.brand span,
.main-nav a,
.nav-meta .chip,
.sound-toggle {
  min-width: 0;
}

.brand span,
.main-nav a {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-meta {
  flex-wrap: wrap;
}

.content {
  max-width: 100%;
}

.admin-home--pro {
  padding-bottom: 34px;
}

.admin-home--pro .muted {
  max-width: 760px;
}

.admin-pro-console {
  background:
    linear-gradient(90deg, rgba(204, 251, 241, 0.42), rgba(255, 255, 255, 0) 44%),
    #ffffff;
}

.admin-pro-console__intro p,
.admin-delivered-model p,
.admin-config-panel__desc,
.admin-sounds-panel p,
.admin-real-metrics__head p {
  font-size: 14px;
  line-height: 1.35;
}

.admin-config-workspace {
  min-height: 520px;
}

.admin-config-menu__item {
  position: relative;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.admin-config-menu__item::before {
  background: transparent;
  border-radius: 999px;
  bottom: 10px;
  content: "";
  left: 8px;
  position: absolute;
  top: 10px;
  width: 3px;
}

.admin-config-menu__item.is-active::before {
  background: #0f766e;
}

.admin-config-menu__item span,
.admin-module-card__top strong,
.admin-readiness-card strong,
.admin-insight-stat span {
  overflow-wrap: anywhere;
}

.admin-config-panel__head .badge {
  flex: 0 0 auto;
}

.admin-config-panel .admin-module-card {
  display: grid;
  gap: 10px;
  min-height: 104px;
  padding: 15px;
}

.admin-module-card__top {
  align-items: start;
}

.admin-module-card p {
  margin: 0;
}

.admin-module-card:hover,
.admin-readiness-card:hover,
.admin-insight-stat:hover,
.admin-insight-row:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.admin-sound-grid button {
  cursor: pointer;
  min-height: 86px;
}

.admin-sound-grid button:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: #ffffff;
}

.admin-real-metrics,
.admin-readiness,
.admin-sounds-panel {
  scroll-margin-top: 115px;
}

.ops-assistant__line.is-guide {
  background: #ecfeff;
  border-color: rgba(20, 184, 166, 0.28);
}

.future-orders-panel--ops {
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

.future-order-row--card {
  align-items: stretch;
}

.future-order-row--card > * {
  min-width: 0;
}

.future-order-row__items {
  overflow-wrap: anywhere;
}

@media (min-width: 1180px) {
  .admin-config-panel .admin-module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-group {
    flex: 0 0 auto;
  }

  .admin-pro-console {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .admin-config-workspace {
    min-height: 0;
  }

  .admin-config-menu {
    display: flex;
    overflow-x: auto;
  }

  .admin-config-menu__head {
    flex: 0 0 260px;
    margin-bottom: 0;
  }

  .admin-config-menu__item {
    flex: 0 0 190px;
  }

  .admin-config-menu__item::before {
    bottom: auto;
    height: 3px;
    left: 12px;
    right: 12px;
    top: auto;
    width: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: sticky;
  }

  .admin-home--pro {
    gap: 12px;
  }

  .admin-pro-console,
  .admin-delivered-model,
  .admin-config-panels,
  .admin-sounds-panel,
  .admin-real-metrics,
  .admin-readiness {
    padding: 12px;
  }

  .admin-pro-console h1 {
    font-size: clamp(32px, 10vw, 46px);
    line-height: 0.98;
  }

  .lucia-command > div {
    grid-template-columns: 1fr;
  }

  .admin-status-strip,
  .admin-sound-grid,
  .admin-insight-summary,
  .admin-readiness-grid {
    grid-template-columns: 1fr;
  }

  .admin-config-menu {
    padding: 10px;
  }

  .admin-config-menu__head,
  .admin-config-menu__item {
    flex-basis: 82vw;
  }

  .admin-config-panel__head,
  .admin-real-metrics__head,
  .admin-readiness__head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-config-panel .admin-module-grid,
  .admin-config-panel .admin-module-card {
    grid-template-columns: 1fr;
  }

  .admin-config-panel .admin-module-card {
    min-height: 0;
  }

  .future-order-row--card {
    grid-template-columns: 1fr;
  }
}

/* Release polish: riders, comandas access and order navigation. */
.admin-riders-page {
  display: grid;
  gap: 14px;
}

.admin-riders-head {
  align-items: flex-start;
}

.admin-riders-actions {
  align-items: center;
}

.admin-riders-actions .ghost-button,
.order-panel-return {
  min-height: 40px;
  text-decoration: none;
}

.admin-riders-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-riders-page .summary-card {
  min-height: 78px;
  padding: 14px;
  border-radius: 8px;
  box-shadow: none;
}

.admin-riders-page .summary-card strong {
  font-size: clamp(24px, 2vw, 32px);
  letter-spacing: 0;
}

.rider-create-card--compact {
  padding: 0 !important;
  overflow: hidden;
  border-color: #dce4ef;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.rider-create-card--compact > summary,
.rider-section > summary {
  list-style: none;
}

.rider-create-card--compact > summary::-webkit-details-marker,
.rider-section > summary::-webkit-details-marker,
.form-accordion > summary::-webkit-details-marker {
  display: none;
}

.rider-create-card--compact > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
}

.rider-create-card--compact > summary::after,
.rider-section > summary::after {
  content: "Abrir";
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rider-create-card--compact[open] > summary::after,
.rider-section[open] > summary::after {
  content: "Cerrar";
}

.rider-create-card--compact > summary:focus,
.rider-section > summary:focus,
.form-accordion > summary:focus {
  outline: none;
}

.rider-create-card--compact > summary:focus-visible,
.rider-section > summary:focus-visible,
.form-accordion > summary:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(45, 138, 130, 0.28);
}

.rider-create-card--compact > summary h2,
.admin-riders-list__head h2 {
  margin: 0;
}

.rider-create-card--compact > summary p {
  margin: 4px 0 0;
}

.rider-create-card--compact[open] > summary,
.rider-section[open] > summary {
  border-bottom: 1px solid #e2e8f0;
}

.rider-create-card--compact > form {
  padding: 16px 18px 18px;
}

.admin-rider-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-rider-form > label {
  grid-column: span 2;
  min-width: 0;
}

.admin-rider-form > .toggle {
  grid-column: span 1;
  align-self: end;
  min-height: 42px;
}

.admin-rider-form > .full {
  grid-column: 1 / -1;
}

.admin-rider-form input,
.admin-rider-form select {
  min-height: 40px;
  min-width: 0;
}

.admin-rider-form--nested {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.admin-rider-form--nested > label {
  grid-column: span 1;
}

.admin-rider-form--cash {
  grid-template-columns: minmax(0, 1fr) 150px;
  align-content: start;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-rider-form--cash > label {
  grid-column: span 1;
}

.admin-rider-form--cash > .full,
.admin-rider-form--cash > button {
  grid-column: 1 / -1;
}

.admin-riders-list {
  display: grid;
  gap: 10px;
}

.admin-riders-list__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.admin-riders-list__head p {
  margin: 4px 0 0;
}

.admin-riders-list .ledger-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.rider-grid--admin {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.rider-card--admin {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-color: #dce4ef;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.045);
}

.rider-card--admin .rider-card__top {
  align-items: flex-start;
  gap: 12px;
}

.rider-card--admin h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.rider-card--admin .rider-card__meta {
  margin-top: 5px;
}

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

.rider-snapshot {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.rider-snapshot span,
.rider-credentials span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rider-snapshot strong,
.rider-credentials strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.rider-card__movement {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.rider-card__sections {
  display: grid;
  gap: 8px;
}

.rider-section {
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.rider-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  color: #0f172a;
  cursor: pointer;
  font-weight: 900;
}

.rider-section > form,
.rider-section .rider-cash-actions,
.rider-section .rider-cash-grid,
.rider-section .rider-credentials,
.rider-section .rider-qr-block,
.rider-section > p {
  padding-left: 14px;
  padding-right: 14px;
}

.rider-section > form {
  padding-top: 14px;
  padding-bottom: 14px;
}

.rider-cash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

.rider-cash-actions button,
.admin-rider-form--cash button {
  min-height: 40px;
}

.rider-cash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 14px;
}

.rider-credentials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 14px;
}

.rider-credentials > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.rider-qr-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
  padding-bottom: 14px;
}

.rider-qr-block img {
  width: 144px;
  height: 144px;
  object-fit: contain;
}

.admin-ready-orders {
  border-radius: 8px;
}

.ops-live-riders {
  padding: 14px;
}

.ops-live-riders__head {
  margin-bottom: 8px;
}

.ops-rider-row {
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.ops-live-riders .ops-rider-row + .ops-rider-row {
  margin-top: 8px;
}

.ops-rider-row--route,
.ops-rider-row--assigned,
.ops-rider-row--online,
.ops-rider-row--warn,
.ops-rider-row--off {
  padding-left: 10px;
}

.ops-rider-control-card {
  border-color: #dce4ef;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.ops-rider-control-card__top b {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f7f4;
  color: #24756f;
  font-size: 14px;
}

.ops-rider-control-card__actions .ghost-button,
.ops-rider-control-card__actions button {
  min-height: 36px;
  border-radius: 8px;
}

/* Release polish: cleaner client-facing phone and staff operations. */
.telephony-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  border-color: #dce4ef;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
}

.telephony-window-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.telephony-window-tabs .chip.is-active {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #134e4a;
}

.telephony-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.telephony-assistant-panel {
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.telephony-assistant-rules {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.telephony-assistant-rules article {
  min-height: 76px;
}

.telephony-summary {
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr) minmax(220px, 0.8fr);
}

.telephony-card,
.telephony-row,
.agents-admin .card,
.agent-row,
.agent-create-panel,
.access-policy,
.extension-row {
  border-radius: 8px !important;
}

.telephony-row {
  min-height: 58px;
}

.telephony-collapse > summary {
  align-items: center;
}

.agents-admin {
  max-width: 100%;
}

.agents-admin .access-hero {
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.78), rgba(255, 255, 255, 0.96));
}

.agents-admin .agent-create-panel > summary,
.agents-admin .agent-row__summary {
  min-height: 58px;
}

.agents-admin .agent-row__summary {
  grid-template-columns: minmax(190px, 1.2fr) minmax(110px, 0.55fr) minmax(130px, 0.7fr) minmax(180px, 1fr) auto;
}

.agents-admin .agent-detail {
  background: #f8fafc;
}

.agents-admin .agent-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.agents-admin .agent-form-wide {
  grid-column: 1 / -1;
}

.agents-admin .extensions-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 1100px) {
  .telephony-kpis,
  .telephony-assistant-rules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .telephony-tools,
  .telephony-summary,
  .agents-admin .agent-form-grid,
  .agents-admin .extensions-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-riders-kpis,
  .rider-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-rider-form > label,
  .admin-rider-form > .toggle {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .admin-riders-head,
  .admin-riders-list__head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-riders-actions,
  .rider-cash-actions {
    justify-content: flex-start;
  }

  .admin-riders-kpis,
  .telephony-kpis,
  .telephony-assistant-rules,
  .rider-snapshot-grid,
  .admin-rider-form,
  .admin-rider-form--nested,
  .rider-cash-grid,
  .rider-credentials,
  .agents-admin .agent-row__summary {
    grid-template-columns: 1fr;
  }

  .admin-rider-form > label,
  .admin-rider-form--nested > label,
  .admin-rider-form--cash > label,
  .admin-rider-form > .toggle {
    grid-column: 1 / -1;
  }

  .rider-card--admin .rider-card__top {
    align-items: stretch;
    flex-direction: column;
  }

  .rider-qr-block {
    align-items: flex-start;
    flex-direction: column;
  }

}

/* Zestia OS compact operations layer */
:root {
  --ops-bg: #f6f8fb;
  --ops-surface: #ffffff;
  --ops-surface-soft: #f9fafb;
  --ops-border: #dbe3ee;
  --ops-border-strong: #c8d3e2;
  --ops-text: #111827;
  --ops-muted: #64748b;
  --ops-brand: #0f766e;
  --ops-brand-strong: #115e59;
  --ops-radius: 10px;
  --ops-radius-sm: 8px;
  --ops-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

body.app-shell,
body.app-frame {
  background: var(--ops-bg);
  color: var(--ops-text);
  letter-spacing: 0;
}

.app-shell .site-header,
.app-frame .site-header {
  min-height: 56px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--ops-border);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
  backdrop-filter: blur(10px);
}

.app-shell .content,
.app-frame .content {
  width: 100%;
  max-width: none;
  padding: 14px 18px 72px;
}

.app-shell-main {
  min-height: calc(100vh - 56px);
}

.app-shell .main-nav {
  gap: 8px;
  align-items: center;
}

.app-shell .nav-group {
  min-height: 38px;
  gap: 4px;
  padding: 4px;
  border-color: var(--ops-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
}

.app-shell .nav-group a,
.app-shell .nav-group .chip,
.app-shell .sound-toggle {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
}

.app-shell .nav-label {
  padding: 0 6px;
  font-size: 9px;
  letter-spacing: .04em;
}

.app-shell .nav-meta {
  margin-left: auto;
}

.context-bar {
  gap: 8px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--ops-border);
  background: #fff;
}

.context-bar__item {
  min-height: 42px;
  padding: 7px 10px;
  border-radius: var(--ops-radius);
  box-shadow: none;
}

.context-bar__btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: var(--ops-radius-sm);
}

:where(.content) h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.15vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

:where(.content) h2 {
  margin: 0 0 8px;
  font-size: clamp(19px, 1.45vw, 25px);
  line-height: 1.12;
  letter-spacing: 0;
}

:where(.content) h3 {
  margin: 0 0 7px;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: 0;
}

:where(.content) p,
.muted {
  line-height: 1.38;
}

:where(.content) .eyebrow,
:where(.content) .kicker,
:where(.content) .section-label,
:where(.content) .metric-label {
  font-size: 11px;
  letter-spacing: .06em;
}

:where(.card, .panel, .section-card, .admin-card, .form-card, .summary-card, .report-card, .ticket-card, .access-card),
:where(.orders-hero, .access-hero, .telephony-hero, .customers-hero, .reports-hero, .admin-riders-head, .kpi-card) {
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  background: var(--ops-surface);
  box-shadow: var(--ops-shadow);
}

:where(.card, .panel, .section-card, .admin-card, .form-card, .summary-card, .report-card, .access-card) {
  padding: 14px;
}

:where(.orders-hero, .access-hero, .telephony-hero, .customers-hero, .reports-hero, .admin-riders-head) {
  padding: 16px 18px;
  margin-bottom: 14px;
}

:where(.grid, .stack, .toolbar, .actions, .filters, .filter-grid, .admin-grid, .form-grid, .kpi-grid, .metric-grid, .summary-grid, .report-grid) {
  gap: 10px;
}

:where(form, .filters, .filter-panel, .admin-rider-form, .telephony-tools, .orders-history-filters) {
  align-items: end;
}

:where(label) {
  gap: 5px;
  font-size: 12px;
  font-weight: 750;
  color: #334155;
}

:where(input, select, textarea) {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: var(--ops-radius-sm);
  border-color: var(--ops-border);
  background: #fff;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: none;
}

:where(textarea) {
  min-height: 78px;
}

:where(input:focus, select:focus, textarea:focus) {
  border-color: rgba(15, 118, 110, .65);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
  outline: none;
}

:where(button, .button, .btn, .ghost, .ghost-button, .context-bar__btn) {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: var(--ops-radius-sm);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

:where(.button.small, .btn.small, .ghost-button.small) {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}

.ops-empty-state {
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  border: 1px dashed var(--ops-border);
  border-radius: var(--ops-radius);
  background: #ffffff;
  color: var(--ops-muted);
  text-align: center;
}

.ops-empty-state strong {
  color: var(--ops-text);
  font-size: 20px;
}

.ops-empty-state .button {
  margin-top: 4px;
}

:where(table) {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  background: #fff;
}

:where(th) {
  padding: 9px 10px;
  background: #101827;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

:where(td) {
  padding: 9px 10px;
  border-top: 1px solid #edf2f7;
  font-size: 14px;
  vertical-align: top;
}

:where(tbody tr:nth-child(even)) {
  background: #f8fafc;
}

.pill,
.chip,
.badge,
.status-pill,
.ledger-badge {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-riders-kpis,
.telephony-kpis,
.reports-kpis,
.orders-summary-grid,
.rider-snapshot-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-riders-kpis > *,
.telephony-kpis > *,
.reports-kpis > *,
.orders-summary-grid > *,
.rider-snapshot-grid > * {
  min-height: 84px;
  padding: 12px 14px;
  border-radius: var(--ops-radius);
}

.admin-riders-kpis strong,
.telephony-kpis strong,
.reports-kpis strong,
.orders-summary-grid strong,
.rider-snapshot-grid strong {
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1;
}

.admin-rider-form {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  padding: 14px;
  border-radius: var(--ops-radius);
}

.admin-rider-form > button,
.admin-rider-form .form-actions {
  align-self: end;
}

.rider-card--admin {
  padding: 14px;
  border-radius: var(--ops-radius);
  box-shadow: var(--ops-shadow);
}

.rider-card--admin h3 {
  font-size: 18px;
}

.rider-card--admin .rider-card__meta,
.rider-card--admin p {
  font-size: 13px;
}

.order-new-layout,
.orders-layout,
.telephony-layout,
.admin-layout {
  gap: 12px;
}

.order-cart,
.cart-panel,
.summary-panel {
  position: sticky;
  top: 74px;
}

.orders-history-filters,
.report-filters,
.telephony-filters {
  padding: 14px;
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  background: #fff;
}

.ops-assistant {
  right: 18px;
  bottom: 18px;
}

.ops-assistant__toggle {
  min-height: 44px;
  border-radius: var(--ops-radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}

.ops-assistant__panel {
  border-radius: var(--ops-radius);
}

@media (max-width: 1180px) {
  .admin-riders-kpis,
  .telephony-kpis,
  .reports-kpis,
  .orders-summary-grid,
  .rider-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .app-shell .content,
  .app-frame .content {
    padding: 10px 10px 76px;
  }

  .app-shell .site-header {
    padding: 8px 10px;
  }

  .app-shell .nav-group {
    border-radius: var(--ops-radius);
  }

  .admin-riders-kpis,
  .telephony-kpis,
  .reports-kpis,
  .orders-summary-grid,
  .rider-snapshot-grid,
  .admin-rider-form {
    grid-template-columns: 1fr;
  }

  :where(.card, .panel, .section-card, .admin-card, .form-card, .summary-card, .report-card, .access-card),
  :where(.orders-hero, .access-hero, .telephony-hero, .customers-hero, .reports-hero, .admin-riders-head) {
    padding: 12px;
  }
}

/* Zestia OS operations visual refinement v2. */
.app-shell .content,
.app-frame .content {
  padding-top: 14px;
  background:
    linear-gradient(180deg, #f4f7fb 0%, #f8fafc 140px, #f8fafc 100%);
}

.content > h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 2.35vw, 36px);
  line-height: 1.03;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.page-header h1,
.page-header--compact h1 {
  margin: 0;
  font-size: clamp(28px, 2.45vw, 38px);
  line-height: 1;
}

.page-header p {
  margin: 4px 0 0;
  max-width: 640px;
}

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

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

.summary-card {
  min-height: 70px;
  padding: 10px 12px;
  align-content: center;
  gap: 2px;
}

.summary-card span {
  font-size: 11px;
  letter-spacing: .05em;
}

.summary-card strong {
  font-size: clamp(22px, 1.7vw, 28px);
  line-height: 1;
}

.table-card {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--ops-border);
  background: #fff;
  box-shadow: var(--ops-shadow);
}

.table-card .table {
  border: 0;
  border-radius: 0;
}

.table-card .row.wrap {
  gap: 7px;
}

.table-card .button,
.table-card button,
.table-card .danger {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
}

.product-config-hub {
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.product-config-hub__head {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
}

.product-config-hub__head h2 {
  margin: 3px 0 0;
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1;
}

.product-config-stats {
  gap: 7px;
}

.product-config-stats div {
  min-height: 52px;
  padding: 8px 9px;
}

.product-config-stats strong {
  font-size: 20px;
}

.product-config-stats span {
  font-size: 11px;
}

.product-config-tabs {
  gap: 7px;
}

.product-config-tabs a {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 14px;
}

.product-operating-map {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(560px, 1.28fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  margin: 10px 0 12px;
  padding: 16px !important;
  border-radius: 8px !important;
  background:
    linear-gradient(90deg, rgba(255, 251, 235, .82), rgba(236, 253, 245, .84)),
    #fff !important;
}

.product-operating-map .section-kicker {
  margin: 0 0 6px;
  font-size: 14px;
}

.product-operating-map h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.1vw, 34px) !important;
  line-height: 1.05;
}

.product-operating-map p {
  max-width: 620px;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.operating-type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.operating-type-grid article {
  min-height: 86px;
  padding: 10px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
}

.operating-type-grid article strong {
  font-size: 14px;
  line-height: 1.2;
}

.operating-type-grid article span {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.32;
}

.product-config-drawer {
  padding: 0 !important;
}

.product-config-drawer > summary {
  min-height: 48px;
  padding: 0 14px;
}

.product-config-drawer > summary strong {
  font-size: 16px;
}

.product-config-drawer[open] {
  padding-bottom: 12px !important;
}

.product-config-drawer[open] > summary {
  margin-bottom: 12px;
  border-bottom-color: #e2e8f0;
}

.product-config-drawer[open] > form,
.product-config-drawer[open] > .quick-category-grid,
.product-config-drawer[open] > p {
  margin-left: 14px;
  margin-right: 14px;
}

#listado-productos > .row.wrap.space-between {
  align-items: center;
  margin: 2px 0 8px;
}

#listado-productos h2 {
  margin: 0;
  font-size: 22px;
}

.product-listing {
  gap: 8px;
}

.product-listing > .card:not(.product-card) {
  min-height: 48px;
  padding: 10px 12px;
}

.product-listing > .row {
  min-height: 28px;
  padding-left: 4px;
}

.product-card {
  padding: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .035) !important;
}

.product-summary--card {
  min-height: 72px;
  padding: 9px 12px;
  gap: 14px;
}

.product-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  box-shadow: none;
}

.product-summary__identity .stack {
  gap: 2px;
}

.product-summary__identity strong {
  font-size: 17px;
}

.product-summary__identity .muted {
  font-size: 13px;
}

.product-summary__badges {
  gap: 7px;
}

.product-summary__badges .badge {
  min-height: 25px;
  padding: 5px 8px;
  font-size: 12px;
}

.product-card__body {
  padding: 12px;
  border-top: 1px solid #e8edf3;
  background: #f8fafc;
}

.product-card__body .product-step {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.product-card__body .product-step h3,
.product-create-panel .product-step h3 {
  margin: 0;
  font-size: 16px;
}

.product-create-panel {
  padding: 14px !important;
}

.product-create-panel > h2 {
  margin-top: 0;
  font-size: 22px;
}

.stock-workspace {
  gap: 12px;
}

.stock-hero {
  min-height: 132px;
  padding: 18px 20px !important;
  border-radius: 8px !important;
  background:
    linear-gradient(100deg, rgba(15, 23, 42, .94), rgba(20, 83, 79, .82)),
    #111827 !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08) !important;
}

.stock-hero h1 {
  margin: 2px 0 6px;
  font-size: clamp(30px, 3vw, 42px) !important;
  line-height: 1;
}

.stock-hero p {
  max-width: 680px;
  font-size: 15px;
  line-height: 1.35;
}

.beverage-library-field {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid #d9e4e8;
  border-radius: 10px;
  background:
    radial-gradient(circle at 8% 8%, rgba(14, 165, 233, .08), transparent 42%),
    #f8fbfc;
}

.beverage-library-field.is-selected {
  border-color: rgba(8, 145, 178, .45);
  background:
    radial-gradient(circle at 8% 8%, rgba(34, 211, 238, .14), transparent 44%),
    #f4fbfc;
}

.beverage-library-field__preview {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.beverage-library-field__preview strong,
.beverage-library-field__preview small {
  display: block;
}

.beverage-library-field__preview strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beverage-library-field__preview small {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.beverage-library-field__image {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(8, 145, 178, .16);
  border-radius: 9px;
  background:
    linear-gradient(45deg, #ecf2f4 25%, transparent 25%),
    linear-gradient(-45deg, #ecf2f4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ecf2f4 75%),
    linear-gradient(-45deg, transparent 75%, #ecf2f4 75%),
    #fff;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
}

.beverage-library-field__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.beverage-library-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  max-height: min(900px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .34);
}

.beverage-library-dialog[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.beverage-library-dialog::backdrop {
  background: rgba(2, 8, 23, .68);
  backdrop-filter: blur(7px);
}

.beverage-library-dialog__head {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 16px;
  color: #eafcff;
  background:
    radial-gradient(circle at 18% 10%, rgba(34, 211, 238, .18), transparent 34%),
    linear-gradient(115deg, #06161d, #0b2730);
}

.beverage-library-dialog__head h2 {
  margin: 4px 0 5px;
  color: #fff;
  font-size: clamp(25px, 2.6vw, 36px);
  line-height: 1.02;
}

.beverage-library-dialog__head p {
  max-width: 660px;
  margin: 0;
  color: #b9d5dc;
  font-size: 14px;
  line-height: 1.45;
}

.beverage-library-dialog__head .eyebrow {
  color: #67e8f9;
}

.beverage-library-dialog__head .ghost-button {
  border-color: rgba(165, 243, 252, .38);
  color: #eaffff;
  background: rgba(255, 255, 255, .06);
}

.beverage-library-dialog__tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 18px;
  border-bottom: 1px solid #dce5e9;
  background: #fff;
}

.beverage-library-dialog__tools label {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.beverage-library-dialog__tools input,
.beverage-library-dialog__tools select {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
}

.beverage-library-dialog__count {
  align-self: center;
  min-width: 100px;
  color: #0e7490;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.beverage-library-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: max-content;
  gap: 10px;
  align-content: start;
  padding: 16px 18px 22px;
  overflow: auto;
}

.beverage-library-card {
  display: grid;
  grid-template-rows: 148px auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9e4e8;
  border-radius: 11px;
  color: #0f172a;
  text-align: left;
  background: #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .035);
  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

/* The operational shell applies a compact minimum to every button after this
   stylesheet. These cards are visual choices, so their media must never be
   collapsed to the height of a normal action button. */
body.app-frame.page-admin-products
  .beverage-library-dialog
  .beverage-library-card {
  min-height: 220px;
}

body.app-frame.page-admin-products
  .beverage-library-dialog
  .beverage-library-dialog__head
  h2 {
  color: #fff;
}

.beverage-library-card:hover,
.beverage-library-card:focus-visible {
  z-index: 1;
  border-color: #0891b2;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(8, 145, 178, .13);
}

.beverage-library-card__media {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 52%, rgba(34, 211, 238, .11), transparent 46%),
    #07171d;
}

.beverage-library-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.beverage-library-card__copy {
  display: block;
  min-width: 0;
  padding: 10px 11px 11px;
}

.beverage-library-card__copy strong,
.beverage-library-card__copy small {
  display: block;
}

.beverage-library-card__copy strong {
  display: -webkit-box;
  min-height: 34px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.beverage-library-card__copy small {
  margin-top: 5px;
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beverage-library-dialog__notice {
  margin: 0;
  padding: 10px 18px 12px;
  border-top: 1px solid #dce5e9;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
  background: #fff;
}

.beverage-library-empty {
  grid-column: 1 / -1;
  min-height: 180px;
  margin: 0;
  padding: 32px;
  place-content: center;
  border: 1px dashed #b8c8cf;
  border-radius: 12px;
  color: #526478;
  text-align: center;
  background: #fff;
}

.beverage-library-empty:not([hidden]) {
  display: grid;
}

@media (max-width: 980px) {
  .beverage-library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .beverage-library-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .beverage-library-field > .row {
    width: 100%;
  }

  .beverage-library-field > .row button {
    flex: 1 1 auto;
  }

  .beverage-library-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
    border-radius: 12px;
  }

  .beverage-library-dialog__head {
    gap: 12px;
    padding: 16px 14px 13px;
  }

  .beverage-library-dialog__head h2 {
    font-size: 25px;
  }

  .beverage-library-dialog__head p {
    font-size: 12px;
  }

  .beverage-library-dialog__head .ghost-button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .beverage-library-dialog__tools {
    grid-template-columns: minmax(0, 1fr) minmax(120px, .65fr);
    gap: 9px;
    padding: 11px;
  }

  .beverage-library-dialog__count {
    grid-column: 1 / -1;
    text-align: left;
  }

  .beverage-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 11px;
  }

  .beverage-library-card {
    grid-template-rows: 126px auto;
  }

  body.app-frame.page-admin-products
    .beverage-library-dialog
    .beverage-library-card {
    min-height: 198px;
  }
}

.stock-hero__actions .ghost-button {
  min-height: 34px;
  padding: 7px 10px;
}

.stock-kpi-grid {
  gap: 10px !important;
}

.stock-kpi {
  min-height: 78px;
  padding: 12px !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035) !important;
}

.stock-kpi strong {
  font-size: 28px !important;
}

.stock-kpi small {
  font-size: 13px;
}

.stock-main-grid {
  gap: 12px !important;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .88fr) !important;
}

.stock-panel {
  padding: 14px !important;
  border-radius: 8px !important;
}

.stock-panel .section-title h2 {
  margin: 0;
  font-size: 22px;
}

.stock-panel .section-title p {
  margin-top: 4px;
}

.stock-fast-form {
  gap: 10px !important;
}

.stock-fast-form input,
.stock-fast-form select {
  min-height: 38px !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
}

.check-card {
  padding: 10px !important;
  border-radius: 8px !important;
}

.stock-move {
  padding: 10px !important;
  border-radius: 8px !important;
}

.telephony-kpis {
  gap: 8px;
}

.telephony-kpi {
  min-height: 66px !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .03);
}

.telephony-kpi span {
  font-size: 11px;
}

.telephony-kpi strong {
  font-size: 28px !important;
}

.telephony-tools {
  margin: 8px 0 10px;
  padding: 8px !important;
}

.telephony-search input {
  min-height: 36px;
}

.telephony-assistant-panel {
  grid-template-columns: minmax(260px, .84fr) minmax(520px, 1.16fr);
  gap: 14px;
  padding: 14px !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08) !important;
}

.telephony-assistant-panel h2 {
  margin: 6px 0;
  font-size: 25px;
}

.telephony-assistant-panel p {
  font-size: 14px;
  line-height: 1.35;
}

.telephony-assistant-rules {
  gap: 8px;
}

.telephony-assistant-rules article {
  min-height: 64px !important;
  padding: 10px !important;
  border-radius: 8px !important;
}

.telephony-assistant-rules article span {
  font-size: 11px;
}

.telephony-assistant-rules article strong {
  font-size: 19px;
}

.telephony-summary,
.telephony-grid {
  gap: 10px;
}

.telephony-card {
  min-height: 0;
  padding: 12px !important;
}

.telephony-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.telephony-row {
  min-height: 48px !important;
  padding: 9px 10px !important;
}

.orders-ledger {
  gap: 8px !important;
}

.ledger-head {
  min-height: 104px;
  padding: 13px 14px !important;
}

.ledger-eyebrow {
  margin-bottom: 6px !important;
  padding: 5px 8px !important;
  font-size: 11px !important;
}

.ledger-head h1 {
  font-size: clamp(26px, 2.1vw, 34px) !important;
}

.ledger-head p {
  max-width: 640px;
}

.ledger-range {
  min-width: 230px !important;
  padding: 8px 10px !important;
}

.ledger-print {
  min-height: 38px !important;
  padding-inline: 13px !important;
}

.ledger-filters {
  padding: 10px !important;
}

.ledger-filter-grid {
  gap: 8px !important;
}

.ledger-field span {
  font-size: 12px !important;
}

.ledger-field input,
.ledger-field select,
.ledger-checkbox {
  min-height: 36px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
}

.ledger-filter-actions button,
.ledger-filter-actions a {
  min-height: 36px !important;
  border-radius: 8px !important;
}

.ledger-metrics {
  gap: 10px !important;
}

.ledger-metric {
  min-height: 72px !important;
  padding: 10px 12px !important;
}

.ledger-metric strong {
  font-size: 27px !important;
}

.ledger-metric p {
  font-size: 13px !important;
}

.ledger-section {
  gap: 9px !important;
  padding: 10px !important;
}

.ledger-section h2 {
  font-size: 21px !important;
}

.ledger-badge {
  padding: 6px 10px !important;
}

.ledger-settlement {
  min-height: 68px;
  padding: 10px 12px !important;
  border-radius: 8px !important;
}

.ledger-settlement strong {
  font-size: 22px !important;
}

.ledger-empty {
  min-height: 68px !important;
  padding: 12px 14px !important;
  border-radius: 8px !important;
}

.ledger-table-wrap {
  border-radius: 8px !important;
}

.ledger-table th {
  padding: 9px 10px !important;
  font-size: 11px !important;
}

.ledger-table td {
  padding: 9px 10px !important;
  font-size: 14px !important;
}

.ledger-chip,
.ledger-status {
  padding: 5px 8px !important;
  font-size: 12px !important;
}

.app-shell .form-grid {
  gap: 9px 10px;
}

.app-shell .card > h2,
.app-frame .card > h2 {
  margin-top: 0;
  font-size: 22px;
}

.app-shell .empty-state {
  border-radius: 8px;
  padding: 12px;
}

@media (max-width: 1360px) {
  .operating-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-operating-map {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .summary-grid,
  .stock-kpi-grid,
  .ledger-metrics,
  .ledger-settlement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .stock-main-grid,
  .telephony-assistant-panel {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .stock-kpi-grid,
  .ledger-metrics,
  .ledger-settlement-grid,
  .operating-type-grid {
    grid-template-columns: 1fr !important;
  }

  .product-config-hub__head,
  .product-summary--card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

  .stock-hero,
  .ledger-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Zestia OS operations visual refinement v3: cierre limpio y carta operativa. */
.ledger-filters--collapsed {
  padding: 0 !important;
  overflow: hidden;
}

.ledger-filter-summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.ledger-filter-summary::-webkit-details-marker {
  display: none;
}

.ledger-filter-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ledger-filter-summary strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.ledger-filter-summary small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-filter-summary b {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  white-space: nowrap;
}

.ledger-filters--collapsed[open] .ledger-filter-summary {
  border-bottom: 1px solid #e6edf5;
}

.ledger-filters--collapsed[open] .ledger-filter-summary b {
  background: #101828;
  color: #fff;
}

.ledger-filters--collapsed .ledger-filter-form {
  padding: 10px;
}

.orders-ledger .ledger-section {
  margin-top: 0;
}

.orders-ledger .ledger-table-wrap--orders {
  box-shadow: 0 10px 24px rgba(15, 23, 42, .035);
}

.orders-ledger .ledger-table td:nth-child(8) {
  max-width: 420px;
  line-height: 1.35;
}

#listado-productos .product-category-row {
  padding: 8px 12px !important;
  border-left: 3px solid #0f766e;
  background: linear-gradient(90deg, rgba(240, 253, 250, .82), #fff);
}

#listado-productos .product-category-row h3 {
  margin: 0;
  font-size: 18px;
}

#listado-productos .product-subcategory-row {
  min-height: 26px;
  padding: 0 4px;
}

#listado-productos .product-subcategory-row .muted {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

#listado-productos .product-card {
  border-left: 3px solid transparent;
}

#listado-productos .product-card:has(.badge.danger) {
  border-left-color: #dc2626;
}

#listado-productos .product-card:has(.badge.ok) {
  border-left-color: #16a34a;
}

#listado-productos .product-summary--card {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(320px, 1.1fr) minmax(260px, .9fr) auto;
  align-items: center;
  min-height: 66px;
}

#listado-productos .product-summary__identity {
  min-width: 0;
}

#listado-productos .product-summary__identity strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-summary__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.product-summary__facts span {
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.product-summary__facts small {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}

.product-summary__facts strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.1;
}

.product-summary__facts em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#listado-productos .product-summary__badges {
  justify-content: flex-start;
}

#listado-productos .product-card:has(.badge.danger) {
  border-left-color: #dc2626;
}

.product-summary__edit {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.product-card[open] .product-summary__edit {
  background: #0f766e;
}

.product-card[open] .product-summary--card {
  border-bottom: 1px solid #e6edf5;
}

@media (max-width: 1280px) {
  #listado-productos .product-summary--card {
    grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr);
  }

  #listado-productos .product-summary__badges,
  .product-summary__edit {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  #listado-productos .product-summary--card {
    grid-template-columns: 1fr;
  }

  .product-summary__facts {
    grid-template-columns: 1fr;
  }

  .ledger-filter-summary {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 12px;
  }
}

/* Clean edit surfaces: collapsed by default, operational when opened. */
.admin-page-title--compact {
  margin: 0 0 10px;
  font-size: clamp(26px, 2.1vw, 34px);
  line-height: 1;
  letter-spacing: 0;
}

.admin-hero .admin-page-title--compact {
  margin-bottom: 6px;
}

.product-operating-map--collapsed,
.product-create-panel--drawer,
.category-create--compact,
.category-item--details,
.ingredient-control-panel--compact,
.ingredient-card--details {
  overflow: hidden;
}

.product-operating-map--collapsed > summary,
.product-create-panel--drawer > summary,
.category-create--compact > summary,
.category-item--details > summary,
.ingredient-control-panel--compact > summary,
.ingredient-card--details > summary {
  list-style: none;
  cursor: pointer;
}

.product-operating-map--collapsed > summary::-webkit-details-marker,
.product-create-panel--drawer > summary::-webkit-details-marker,
.category-create--compact > summary::-webkit-details-marker,
.category-item--details > summary::-webkit-details-marker,
.ingredient-control-panel--compact > summary::-webkit-details-marker,
.ingredient-card--details > summary::-webkit-details-marker {
  display: none;
}

.product-operating-map--collapsed {
  display: block !important;
  padding: 0 !important;
  border: 1px solid #d9e4ee !important;
  border-radius: 10px !important;
  background: #fff !important;
}

.product-operating-map--collapsed > summary,
.product-create-summary,
.category-create__summary,
.ingredient-control-summary {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
}

.ingredient-control-summary {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.product-operating-map--collapsed > summary span:first-child,
.product-create-summary > span:first-child,
.category-create__summary > span:first-child,
.ingredient-control-summary > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-operating-map--collapsed > summary strong,
.product-create-summary strong,
.category-create__summary strong,
.ingredient-control-summary strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.1;
}

.product-operating-map--collapsed > summary small,
.product-create-summary small,
.category-create__summary small,
.ingredient-control-summary small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.product-operating-map--collapsed[open] > summary,
.product-create-panel--drawer[open] > summary,
.category-create--compact[open] > summary,
.ingredient-control-panel--compact[open] > summary {
  border-bottom: 1px solid #e6edf5;
}

.product-operating-map__body {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(360px, 1.3fr);
  gap: 14px;
  padding: 14px;
}

.product-operating-map__body h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 2vw, 30px) !important;
  line-height: 1;
}

.product-operating-map__body .operating-type-grid {
  gap: 10px;
}

.product-create-panel--drawer {
  padding: 0 !important;
}

.product-create-panel__body {
  padding: 12px;
}

.product-create-panel--drawer:not([open]) {
  box-shadow: 0 8px 18px rgba(15, 23, 42, .035);
}

.category-create--compact {
  display: block !important;
  padding: 0 !important;
  gap: 0 !important;
}

.category-create__body {
  padding: 12px;
}

.category-create__body > .category-form {
  margin-top: 10px;
}

.category-list {
  gap: 10px !important;
}

.category-list > h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.category-item--details {
  display: block !important;
  padding: 0 !important;
  border-color: #dfe7ef !important;
  background: #fff !important;
}

.category-item--details > .category-item__summary-row {
  grid-template-columns: 64px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 76px;
  padding: 10px 12px;
}

.category-item--details .category-thumb {
  width: 58px !important;
  height: 58px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.category-item--details .category-item__summary h3 {
  margin: 0 0 5px !important;
  font-size: 17px !important;
  line-height: 1.1;
}

.category-item--details .category-badges {
  margin: 0 !important;
  gap: 5px !important;
}

.category-item--details .badge {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
}

.category-item--details[open] > .category-item__summary-row {
  border-bottom: 1px solid #e6edf5;
}

.category-item__body {
  padding: 12px;
}

.category-item--details .category-form > .category-item__head {
  display: none !important;
}

.category-item--details .category-item__grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
}

.category-item--details .category-days {
  padding: 10px !important;
}

.category-item--details .category-links {
  margin-top: 0 !important;
}

.ingredient-control-panel--compact {
  padding: 0 !important;
}

.ingredient-control-panel__body {
  padding: 12px;
}

.ingredient-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.ingredient-summary-metrics b {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.ingredient-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.ingredient-card--details {
  display: block !important;
  padding: 0 !important;
  border-color: #dfe7ef !important;
  background: #fff !important;
}

.ingredient-card--details > .ingredient-card__summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, auto) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px 12px;
}

.ingredient-card--details[open] > .ingredient-card__summary {
  border-bottom: 1px solid #e6edf5;
}

.ingredient-card--details .ingredient-card__summary .ingredient-card__top {
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.ingredient-card--details .ingredient-thumb {
  width: 44px !important;
  height: 44px !important;
  border-radius: 10px !important;
}

.ingredient-card__body {
  padding: 12px;
}

.ingredient-card--details .ingredient-card__form {
  gap: 10px !important;
}

.ingredient-card--details .ingredient-card__form > .ingredient-card__top {
  display: none !important;
}

.ingredient-card--details .ingredient-card__fields {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

.ingredient-card--details .ingredient-card__footer {
  margin-top: 10px;
  padding-top: 10px;
}

.ingredient-card--details .inline-form {
  margin-top: 8px;
}

/* Help and guided tour refresh */
.ops-guide {
  place-items: center;
  padding: clamp(14px, 2vw, 26px);
}

.ops-guide__backdrop {
  z-index: 0;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.ops-guide__spotlight {
  z-index: 2;
  border: 2px solid #ffffff;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.28),
    0 0 0 5px rgba(37, 111, 108, 0.55),
    0 18px 42px rgba(15, 23, 42, 0.16);
}

.ops-guide__panel {
  z-index: 4;
  width: min(520px, calc(100vw - 28px));
  padding: 18px;
  border-radius: 10px;
  border-color: #dbe4ee;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.ops-guide__head {
  align-items: start;
}

.ops-guide__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ops-guide__counter {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #cfe4e1;
  border-radius: 999px;
  background: #eef8f6;
  color: #1f6862;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ops-guide__head h2 {
  margin-top: 3px;
  font-size: clamp(24px, 2vw, 30px);
  letter-spacing: 0;
}

.ops-guide__progress {
  height: 7px;
  margin: 14px 0;
}

.ops-guide__panel p {
  font-size: 16px;
  line-height: 1.42;
}

.ops-guide__hint {
  min-height: auto;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #cfe4e1;
  border-radius: 8px;
}

.ops-guide-target {
  outline: 0 !important;
  box-shadow: none !important;
}

.help-manual-shell {
  max-width: min(1340px, calc(100vw - 32px));
  margin-inline: auto;
  gap: 12px;
}

.help-hero--manual {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 4px;
  padding: 18px 20px;
  border-radius: 10px;
  border-color: #dbe4ee;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.help-hero--manual h1 {
  margin: 4px 0 6px;
  font-size: clamp(30px, 2.6vw, 42px);
  line-height: 1;
}

.help-hero--manual p {
  max-width: 780px;
  font-size: 15px;
}

.help-hero-actions {
  max-width: 620px;
  gap: 7px;
}

.help-hero-actions a {
  min-height: 36px;
  padding-inline: 12px;
  border-radius: 7px;
  font-size: 14px;
}

.help-quick-grid {
  gap: 8px;
}

.help-quick-grid article {
  min-height: 84px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: none;
}

.help-quick-grid strong {
  font-size: 14px;
}

.help-quick-grid span {
  font-size: 12.5px;
}

.help-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
}

.help-toc {
  top: 82px;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  box-shadow: none;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.help-toc a {
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.help-manual {
  gap: 10px;
}

.help-section {
  grid-template-columns: minmax(0, 1.05fr) minmax(290px, 0.85fr);
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  box-shadow: none;
}

.help-section__copy {
  gap: 8px;
}

.help-step {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 13px;
}

.help-section h2 {
  font-size: 22px;
  line-height: 1.08;
}

.help-section p,
.help-steps li,
.help-rule,
.help-warning,
.help-call-rules span,
.help-decision-grid span {
  font-size: 14px;
}

.help-steps {
  gap: 6px;
}

.help-rule,
.help-warning {
  padding: 10px;
  border-radius: 8px;
}

.help-shot {
  min-height: auto;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.help-shot figcaption {
  font-size: 11px;
}

.help-shot__board em {
  font-size: 24px;
}

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

.mock-map-layout {
  min-height: 190px;
}

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

@media (max-width: 900px) {
  .product-operating-map__body,
  .ingredient-control-summary,
  .ingredient-card--details > .ingredient-card__summary,
  .help-hero--manual,
  .help-layout,
  .help-section {
    grid-template-columns: 1fr;
  }

  .help-manual-shell {
    max-width: calc(100vw - 20px);
  }

  .help-toc {
    position: static;
    max-height: none;
  }

  .help-hero-actions {
    justify-content: flex-start;
  }

  .category-item--details > .category-item__summary-row {
    grid-template-columns: 54px minmax(0, 1fr) !important;
  }

  .category-item--details > .category-item__summary-row .product-summary__edit {
    grid-column: 1 / -1;
  }
}

/* Capa final de estabilidad operativa: los laterales no deforman mapa, riders ni caja. */
.dashboard-shell .ops-delivery-map.ops-view-section.is-active {
  min-height: 0;
  overflow: hidden;
}

.ops-delivery-layout--control {
  height: calc(100vh - 180px);
  height: calc(100dvh - 180px);
  min-height: 620px;
  max-height: calc(100dvh - 120px);
  overflow: hidden;
}

.ops-route-panel--planner,
.ops-rider-control-panel {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  contain: layout paint;
}

.ops-route-panel--planner > .ops-panel-title,
.ops-route-panel--planner > .ops-pickup-rescue,
.ops-route-panel--planner > .ops-route-card__form,
.ops-rider-control-panel > .ops-panel-title,
.ops-rider-control-panel > .ops-quick-rider-form {
  flex: 0 0 auto;
}

.ops-route-panel--planner .ops-route-list,
.ops-route-panel--planner .ops-route-list--routes,
.ops-rider-control-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.ops-map-panel--main {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  contain: layout paint;
}

.ops-map-panel__head,
.ops-map-road-status,
.ops-map-panel--main .map-hint {
  flex: 0 0 auto;
}

.ops-map-panel--main #orders-map,
.dashboard-shell .ops-map-panel--main #orders-map {
  flex: 1 1 auto;
  width: 100%;
  height: auto !important;
  min-height: 0;
}

.cash-os-layout {
  min-height: 620px;
  overflow: hidden;
  align-items: stretch;
}

.cash-os-registers,
.cash-rider-liquidation {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.admin-riders-page {
  min-width: 0;
}

.rider-grid--admin {
  align-items: start;
}

.rider-card--admin,
.rider-section {
  min-width: 0;
}

.rider-card--admin .rider-card__meta,
.rider-snapshot strong,
.rider-credentials strong {
  overflow-wrap: anywhere;
}

/* Reparto: más espacio real para plan de salida y lectura de cargas. */
.ops-delivery-layout--control {
  grid-template-columns: minmax(250px, 0.62fr) minmax(480px, 1.28fr) minmax(420px, 1.18fr);
}

body.ops-fullscreen .ops-delivery-layout--control {
  grid-template-columns: minmax(250px, 0.58fr) minmax(520px, 1.34fr) minmax(460px, 1.22fr);
}

.ops-route-panel--planner {
  padding: 12px;
}

.ops-route-panel--planner .ops-route-list,
.ops-route-panel--planner .ops-route-list--routes {
  gap: 10px;
}

@media (max-width: 1180px) {
  .ops-delivery-layout--control,
  .cash-os-layout {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .ops-map-panel--main #orders-map,
  .dashboard-shell .ops-map-panel--main #orders-map {
    min-height: 560px;
  }
}

/* Reparto cockpit: navegación clara de capas y prioridad al plan operativo. */
.ops-delivery-layout--control {
  grid-template-columns: minmax(260px, 0.52fr) minmax(560px, 1.16fr) minmax(500px, 1.16fr);
  gap: 12px;
}

.ops-rider-control-panel {
  order: 1;
}

.ops-map-panel--main {
  order: 2;
}

.ops-route-panel--planner {
  order: 3;
}

body.ops-fullscreen .ops-delivery-layout--control {
  grid-template-columns: minmax(250px, 0.48fr) minmax(600px, 1.18fr) minmax(540px, 1.18fr);
}

.ops-map-panel__head {
  align-items: flex-start;
  padding: 12px 14px;
}

.ops-map-panel .map-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 520px;
  padding: 0;
  border: 0;
  background: transparent;
}

.ops-map-panel .map-toolbar .chip {
  min-height: 34px;
  padding: 7px 11px;
  border-color: rgba(15, 23, 42, 0.1);
}

.ops-map-panel .map-toolbar .chip[data-map-layer-toggle] {
  background: #f8fafc;
  color: #475569;
}

.ops-map-panel .map-toolbar .chip[data-map-layer-toggle].is-active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.ops-map-toolbar-separator {
  width: 1px;
  min-height: 30px;
  background: rgba(15, 23, 42, 0.12);
}

.ops-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.ops-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.ops-map-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.ops-map-dot--route {
  background: #f97316;
}

.ops-map-dot--order {
  background: #0f766e;
}

.ops-map-dot--rider {
  background: #22c55e;
}

.ops-map-dot--zone {
  background: transparent;
  border: 2px solid #0ea5e9;
}

.ops-route-panel--planner .ops-route-card__head {
  grid-template-columns: 52px minmax(0, 1fr) 76px;
  align-items: start;
}

.ops-route-panel--planner .ops-route-card__head strong,
.ops-route-panel--planner .ops-route-card__head small {
  white-space: normal;
  line-height: 1.2;
}

.ops-route-panel--planner .ops-route-card__action {
  line-height: 1.28;
}

.ops-route-panel--planner .ops-route-focus-button {
  min-height: 36px;
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.ops-route-panel--planner .ops-route-card.is-selected .ops-route-focus-button {
  background: #f97316;
  border-color: #f97316;
}

@media (max-width: 1380px) {
  .ops-delivery-layout--control,
  body.ops-fullscreen .ops-delivery-layout--control {
    grid-template-columns: minmax(230px, 0.5fr) minmax(500px, 1.12fr) minmax(440px, 1.08fr);
  }
}

/* Prioridad real: las rutas son la operativa; capacidad y rescate no deben taparlas. */
.ops-route-panel--planner > .ops-panel-title {
  order: 0;
}

.ops-route-panel--planner > .ops-route-list--routes {
  order: 10;
  flex: 1 1 auto;
  min-height: 320px;
}

.ops-route-panel--planner > .ops-route-card__form--manual {
  order: 20;
}

.ops-route-panel--planner > .ops-dispatch-capacity {
  order: 30;
}

.ops-route-panel--planner > .ops-pickup-rescue {
  order: 40;
}

.ops-route-panel--planner > .ops-dispatch-capacity,
.ops-route-panel--planner > .ops-pickup-rescue,
.ops-route-panel--planner > .ops-route-card__form--manual {
  flex: 0 0 auto;
}

.ops-route-panel--planner > .ops-dispatch-capacity:not([open]),
.ops-route-panel--planner > .ops-pickup-rescue:not([open]) {
  max-height: 66px;
}

/* Puesto operativo: la pantalla de reparto debe sentirse como una herramienta, no como una web. */
.dashboard-shell .ops-delivery-map.ops-view-section.is-active {
  gap: 6px;
  margin: 0;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: #f4f7fb;
}

.ops-delivery-layout--control {
  height: calc(100vh - 126px);
  height: calc(100dvh - 126px);
  min-height: 690px;
  max-height: none;
  grid-template-columns: clamp(220px, 15vw, 292px) minmax(620px, 1fr) clamp(430px, 27vw, 560px);
  gap: 8px;
}

.ops-route-panel--planner,
.ops-rider-control-panel,
.ops-map-panel--main {
  border-radius: 12px;
}

.ops-route-panel--planner,
.ops-rider-control-panel {
  padding: 9px;
}

.ops-panel-title {
  gap: 0;
  margin-bottom: 6px;
}

.ops-panel-title .eyebrow {
  min-height: 20px;
  padding: 4px 10px;
  font-size: 11px;
}

.ops-panel-title h3,
.ops-map-panel__head h3 {
  font-size: 18px;
  line-height: 1.05;
}

.ops-panel-title p,
.ops-map-panel__head p {
  font-size: 12px;
  line-height: 1.2;
}

.ops-map-panel__head {
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
}

.ops-map-panel .map-toolbar {
  flex-wrap: nowrap;
  max-width: none;
  gap: 5px;
}

.ops-map-panel .map-toolbar .chip {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.ops-map-legend {
  min-height: 0;
  padding: 5px 8px;
  gap: 5px;
  font-size: 10px;
}

.ops-map-legend span {
  padding: 3px 6px;
}

.ops-map-road-status {
  padding: 6px 8px;
  gap: 6px;
  font-size: 11px;
}

.ops-map-road-status span {
  padding: 4px 7px;
}

.ops-map-panel--main #orders-map,
.dashboard-shell .ops-map-panel--main #orders-map {
  height: auto !important;
  min-height: 0;
}

.ops-rider-control-card,
.ops-route-card,
.ops-dispatch-capacity,
.ops-pickup-rescue {
  border-radius: 10px;
}

.ops-rider-control-card {
  gap: 6px;
  padding: 8px;
}

.ops-rider-control-card__actions {
  gap: 6px;
}

.ops-rider-control-card__actions button,
.ops-rider-control-card__actions a,
.ops-route-focus-button,
.ops-route-card__form button,
.ops-dispatch-capacity__form button {
  min-height: 34px;
}

.ops-route-panel--planner > .ops-route-list--routes {
  min-height: 0;
}

.ops-route-card {
  padding: 8px;
}

.ops-route-panel--planner .ops-route-card__head {
  grid-template-columns: 48px minmax(0, 1fr) 62px;
  gap: 8px;
}

.ops-route-card__action,
.ops-route-card__load,
.ops-route-card__orders {
  margin-top: 6px;
}

.ops-route-card__orders {
  gap: 5px;
}

.ops-route-stop-chip {
  min-height: 34px;
}

.ops-delivery-map .delivery-risk-alert {
  margin-top: 0;
}

@media (min-width: 1700px) {
  .ops-delivery-layout--control {
    grid-template-columns: 310px minmax(760px, 1fr) 560px;
  }
}

@media (max-width: 1380px) {
  .ops-delivery-layout--control,
  body.ops-fullscreen .ops-delivery-layout--control {
    grid-template-columns: minmax(210px, 0.46fr) minmax(520px, 1fr) minmax(390px, 0.82fr);
  }
}

/* En tablet y móvil el mapa es la primera herramienta; rutas y riders quedan debajo. */
@media (max-width: 1180px) {
  .ops-delivery-layout--control {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ops-map-panel--main {
    order: 1;
  }

  .ops-route-panel--planner {
    order: 2;
  }

  .ops-rider-control-panel {
    order: 3;
  }

  .ops-map-panel .map-toolbar {
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }
}

@media (max-width: 640px) {
  .dashboard-shell .ops-delivery-map.ops-view-section.is-active {
    padding: 4px;
  }

  .ops-map-panel__head {
    display: grid;
    align-items: start;
  }

  .ops-map-panel--main #orders-map,
  .dashboard-shell .ops-map-panel--main #orders-map {
    min-height: 58dvh;
  }
}

body.ops-fullscreen .ops-delivery-layout--control {
  height: 100%;
  grid-template-columns: clamp(210px, 14vw, 280px) minmax(680px, 1fr) clamp(430px, 27vw, 580px);
}

/* Delivery: separar una sugerencia de una ruta confirmada sin perder la comanda. */
.ops-route-card[data-dispatch-state] {
  border-left: 4px solid var(--dispatch-group-color, #0f766e);
}

.ops-route-card[data-dispatch-state="suggested"] {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
}

.ops-route-card[data-dispatch-state="prepared"] {
  background: linear-gradient(135deg, #ffffff 0%, #fff9ed 100%);
}

.ops-dispatch-state {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  margin-top: 4px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ops-dispatch-state--suggested {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.ops-dispatch-state--prepared {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.ops-dispatch-state--confirmed {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.ops-route-card__orders {
  position: relative;
  display: grid;
  padding-left: 13px;
}

.ops-route-card__orders::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 3px;
  width: 3px;
  border-radius: 999px;
  background: var(--dispatch-group-color, #0f766e);
  content: "";
  opacity: 0.72;
}

.ops-dispatch-order {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #ffffff;
  color: #0f172a;
}

.ops-dispatch-order::before {
  position: absolute;
  top: 25px;
  left: -13px;
  width: 12px;
  height: 3px;
  background: var(--dispatch-group-color, #0f766e);
  content: "";
  opacity: 0.72;
}

.ops-dispatch-order.is-carry-waiting {
  background: #f8fafc;
}

.ops-dispatch-order__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.ops-dispatch-order__head > div {
  display: grid;
  min-width: 0;
}

.ops-dispatch-order__head strong,
.ops-dispatch-order__head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-dispatch-order__head strong {
  font-size: 13px;
  line-height: 1.15;
}

.ops-dispatch-order__head small {
  color: #64748b;
  font-size: 11px;
}

.ops-dispatch-order__group {
  display: inline-flex;
  min-width: 42px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--dispatch-group-color, #0f766e);
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
}

.ops-dispatch-order__status {
  max-width: 104px;
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-dispatch-order__details {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(110px, 0.8fr);
  gap: 5px 10px;
  color: #475569;
  font-size: 11px;
  line-height: 1.25;
}

.ops-dispatch-order__details span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-dispatch-order__details b {
  display: block;
  color: #0f172a;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ops-dispatch-order__address {
  grid-column: 1 / -1;
}

.ops-dispatch-order__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ops-dispatch-order__actions > a,
.ops-dispatch-order__actions button,
.ops-dispatch-order__actions .ops-route-carry-toggle {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
}

.ops-dispatch-order__actions > a {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
}

.ops-dispatch-order__actions form {
  margin: 0;
}

@media (max-width: 640px) {
  .ops-dispatch-order__head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ops-dispatch-order__status {
    grid-column: 2;
    width: fit-content;
  }

  .ops-dispatch-order__details {
    grid-template-columns: minmax(0, 1fr);
  }

  .ops-dispatch-order__address {
    grid-column: auto;
  }
}

/* Ayuda operativa v2: módulos reales, checklist persistente y guiones de formación. */
.help-section {
  scroll-margin-top: 88px;
}

.help-screen-link {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.help-screen-link:hover {
  background: #1e293b;
  color: #fff;
}

.help-permission-note {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
}

.help-screen-link:focus-visible,
.help-checklist-tool button:focus-visible,
.help-checklist input:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.help-module-summary {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid #cfe4e1;
  border-radius: 10px;
  background: linear-gradient(145deg, #f0fdfa, #ffffff);
}

.help-module-summary > strong {
  color: #0f172a;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.08;
}

.help-module-summary p,
.help-module-summary small {
  margin: 0;
  color: #475569;
  line-height: 1.45;
}

.help-module-summary small {
  padding-top: 8px;
  border-top: 1px solid #dbe4ee;
  font-weight: 800;
}

.help-checklist-tool {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.help-checklist-tool.is-complete {
  border-color: #10b981;
  background: #f0fdf4;
}

.help-checklist-tool__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.help-checklist-tool__head > div {
  display: grid;
  gap: 3px;
}

.help-checklist-tool__head strong {
  color: #0f172a;
  font-size: 18px;
}

.help-checklist-tool__head span {
  color: #475569;
  font-weight: 800;
}

.help-checklist-tool__head button {
  min-height: 44px;
  white-space: nowrap;
}

.help-checklist-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.help-checklist-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #10b981;
  transition: width 180ms ease;
}

fieldset.help-checklist {
  margin: 0;
  padding: 0;
  border: 0;
}

.help-checklist legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: #334155;
  font-weight: 900;
}

.help-checklist label {
  min-height: 54px;
  cursor: pointer;
}

.help-checklist input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 0;
  accent-color: #059669;
}

.help-recording-section .help-section__copy {
  width: 100%;
}

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

.help-recording-card {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 14px;
  border: 1px solid #dbe4ee;
  border-radius: 9px;
  background: #f8fafc;
}

.help-recording-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.help-recording-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.help-recording-card__head span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}

.help-recording-card ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
  color: #334155;
  line-height: 1.4;
}

.help-recording-card p {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid #dbe4ee;
  color: #0f5132;
}

.help-recording-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

@media (max-width: 760px) {
  .help-checklist-tool__head,
  .help-recording-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .help-checklist-tool__head button {
    width: 100%;
  }

  .help-recording-grid {
    grid-template-columns: 1fr;
  }

  .help-recording-card__head span {
    width: fit-content;
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-checklist-progress span {
    transition: none;
  }
}
