:root {
    --bg: #f4f6f9;
    --bg-soft: #eef2f7;
    --card: #ffffff;
    --card-soft: #f8fafc;

    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --sidebar-hover: #263244;

    --text: #111827;
    --text-soft: #334155;
    --muted: #64748b;
    --muted-soft: #94a3b8;

    --border: #dbe3ef;
    --border-soft: #e6edf5;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f97316;
    --accent-dark: #ea580c;

    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --sidebar-width: 278px;

    --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
}

/* =========================
   LAYOUT BASE
========================= */

.app-shell,
.layout {
    min-height: 100vh;
}

.sidebar,
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar) 0%, #0f172a 100%);
    color: #ffffff;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
}

.main,
.app-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    padding: 26px;
}

.page-content {
    max-width: 100%;
}

/* =========================
   BRAND / SIDEBAR
========================= */

.brand,
.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 22px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand strong {
    display: block;
    color: #ffffff;
    font-weight: 900;
    font-size: 17px;
    line-height: 1.1;
}

.brand small {
    display: block;
    margin-top: 3px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
}

/* =========================
   MENU
========================= */

.menu,
.app-menu {
    display: grid;
    gap: 16px;
    padding-bottom: 18px;
}

.menu-section {
    display: grid;
    gap: 5px;
}

.menu-section-title {
    display: block;
    padding: 0 10px 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.menu-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 11px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: 0.15s ease;
}

.menu-link:hover {
    color: #ffffff;
    background: var(--sidebar-hover);
}

.menu-link.active {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.22);
    box-shadow: inset 3px 0 0 #60a5fa;
}

/* =========================
   SIDEBAR FOOTER
========================= */

.sidebar-footer,
.app-sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(203, 213, 225, 0.12);
    display: grid;
    gap: 10px;
}

.session-box {
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
}

.session-box span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.session-box strong {
    display: block;
    margin-top: 4px;
    color: #ffffff;
    font-weight: 800;
}

.logout-btn {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: var(--radius-md);
    background: #334155;
    color: #ffffff;
    font-weight: 800;
}

.logout-btn:hover {
    background: #475569;
}

/* =========================
   MOBILE SHELL
========================= */

.mobile-shell-bar,
.mobile-sidebar-overlay,
.mobile-sidebar-close {
    display: none;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
}

.topbar p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.summary-line {
    margin: 6px 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.summary-line strong {
    color: var(--text);
}

.page-eyebrow,
.label-soft,
.driver-card-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e0ecff;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================
   PANELS / CARDS
========================= */

.panel,
.toolbar-card,
.scanner-card,
.stat-card,
.status-card,
.premium-card,
.box-pro-panel,
.pending-order-card,
.driver-order-card-clean,
.dispatch-detail-clean-card,
.access-denied-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.panel,
.toolbar-card,
.scanner-card,
.stat-card,
.status-card,
.premium-card,
.box-pro-panel,
.pending-order-card,
.driver-order-card-clean,
.dispatch-detail-clean-card {
    padding: 20px;
}

.panel-header,
.box-pro-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-header h2,
.box-pro-panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    line-height: 1.15;
    font-weight: 900;
}

.panel-header p,
.box-pro-panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.empty-state,
.driver-empty-state {
    padding: 34px 18px;
    text-align: center;
    color: var(--muted);
}

.empty-state h3,
.driver-empty-state h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.empty-state p,
.driver-empty-state p {
    margin: 0;
}

/* =========================
   BUTTONS
========================= */

.btn {
    border-radius: 10px !important;
    font-size: 13px;
    font-weight: 800;
}

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

.btn-dark:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-dark {
    background: #ffffff !important;
    border-color: var(--border) !important;
    color: var(--text-soft) !important;
}

.btn-outline-dark:hover {
    background: var(--bg-soft) !important;
    border-color: #cbd5e1 !important;
    color: var(--text) !important;
}

.btn-danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
}

.btn-outline-danger {
    color: var(--danger) !important;
    border-color: #fecaca !important;
}

.btn-outline-danger:hover {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

/* =========================
   FORMS
========================= */

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

.form-control,
.form-select,
textarea,
input,
select {
    border-radius: 10px !important;
    border: 1px solid var(--border) !important;
    background-color: #ffffff !important;
    color: var(--text) !important;
    font-size: 14px !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus,
select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.form-control::placeholder {
    color: #94a3b8;
}

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

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

.form-actions,
.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   TABLES
========================= */

.table-responsive {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
    color: var(--text);
    font-size: 13px;
}

.table thead th {
    background: #f8fafc;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 900;
    padding: 11px 12px;
    white-space: nowrap;
}

.table tbody td {
    background: #ffffff;
    color: var(--text);
    border-bottom: 1px solid var(--border-soft);
    padding: 11px 12px;
    vertical-align: middle;
}

.table tbody tr:hover td {
    background: #f8fafc;
}

.table small,
.text-muted {
    color: var(--muted) !important;
}

.code-pill,
.sku-cell,
.mono,
td:has(.code-pill) {
    font-family: var(--font-mono);
}

/* =========================
   BADGES / STATUS
========================= */

.badge-soft,
.code-pill,
.status-pill,
.movement-pill,
.permission-tags span {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.badge-soft {
    padding: 6px 10px;
    background: #eef2f7;
    color: var(--text-soft);
    border: 1px solid var(--border);
}

.code-pill {
    padding: 6px 10px;
    background: #eff6ff;
    color: var(--primary-dark);
    border: 1px solid #bfdbfe;
    letter-spacing: 0.02em;
}

.status-pill,
.movement-pill,
.permission-tags span {
    padding: 6px 10px;
    border: 1px solid transparent;
}

.status-available,
.status-active,
.status-picked,
.status-ready,
.status-dispatched,
.movement-inbound {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.status-reserved,
.status-in_preparation,
.status-partial,
.movement-picking_partial,
.movement-picking_full {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.status-draft,
.status-closed,
.movement-move,
.movement-return,
.movement-dispatch,
.movement-count {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.status-cancelled,
.status-blocked,
.status-waste,
.movement-waste,
.movement-adjustment {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* =========================
   ALERTS / MESSAGES
========================= */

.messages-wrapper {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.roder-alert,
.alert {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

.alert-success {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* =========================
   DASHBOARD / STATS
========================= */

.cards-grid,
.premium-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.status-grid,
.operations-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card span,
.status-card span,
.premium-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card strong,
.status-card strong,
.premium-card strong {
    display: block;
    margin-top: 9px;
    color: var(--text);
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
}

.stat-card small,
.status-card small,
.premium-card small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

.stat-card.dark,
.dark-card {
    background: linear-gradient(135deg, var(--sidebar), var(--sidebar-soft));
    color: #ffffff;
}

.stat-card.dark span,
.stat-card.dark small,
.dark-card span,
.dark-card small {
    color: #cbd5e1;
}

.stat-card.dark strong,
.dark-card strong {
    color: #ffffff;
}

.dashboard-hero,
.order-hero-card,
.order-prepare-hero,
.box-hero-card {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px;
    margin-bottom: 20px;
}

.dashboard-hero h1,
.dashboard-hero p,
.order-hero-card,
.order-prepare-hero,
.box-hero-card {
    color: #ffffff;
}

/* =========================
   QUICK ACTIONS / METRICS
========================= */

.dashboard-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
}

.quick-actions-grid,
.status-metrics,
.alert-boxes {
    display: grid;
    gap: 12px;
}

.quick-action,
.quick-action-button,
.metric-row,
.alert-box,
.stock-big {
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
}

.quick-action {
    display: block;
    color: var(--text);
    text-decoration: none;
}

.quick-action:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.quick-action strong,
.quick-action-button strong {
    display: block;
    font-weight: 900;
}

.quick-action span,
.quick-action-button span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-row span {
    color: var(--muted);
    font-weight: 800;
}

.metric-row strong {
    font-size: 24px;
    font-weight: 900;
}

.alert-box.warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-box.danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* =========================
   SCANNER
========================= */

.scanner-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
    gap: 18px;
}

.scanner-header {
    margin-bottom: 14px;
}

.scanner-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
}

.scanner-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.reader-box,
.prepare-reader-box {
    width: 100%;
    min-height: 280px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.reader-box video,
.prepare-reader-box video {
    border-radius: var(--radius-lg);
}

.manual-scan,
.prepare-manual-box {
    margin-top: 14px;
}

.manual-scan .input-group,
.prepare-manual-row {
    display: flex;
    gap: 10px;
}

.scan-message {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-weight: 800;
    border: 1px solid var(--border);
}

.scan-message-success {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

.scan-message-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.scan-message-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.scanner-mode-badge {
    margin-top: 14px;
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
}

/* =========================
   LISTS / ORDER CARDS
========================= */

.pending-orders-grid,
.driver-order-grid-clean,
.dispatch-box-list-clean,
.dispatch-evidence-list-clean,
.order-lines,
.matches-list,
.prepare-box-list,
.evidence-grid {
    display: grid;
    gap: 14px;
}

.pending-orders-grid,
.driver-order-grid-clean,
.evidence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pending-order-card,
.driver-order-card-clean {
    display: grid;
    gap: 14px;
}

.driver-order-card-clean.active {
    border-color: #bfdbfe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.06);
}

.driver-order-head-clean,
.pending-order-head,
.evidence-head,
.order-event {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.driver-order-head-clean h3,
.pending-order-head h2 {
    margin: 7px 0 2px;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
}

.driver-order-head-clean p,
.pending-order-head p {
    margin: 0;
    color: var(--muted);
}

.driver-address-box,
.driver-order-info-clean div,
.pending-order-meta div,
.dispatch-load-focus,
.order-notes,
.detail-list div,
.box-info-item,
.evidence-card,
.match-item,
.prepare-box-item,
.dispatch-box-row-clean,
.dispatch-evidence-card-clean {
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px;
}

.driver-address-box span,
.driver-order-info-clean span,
.pending-order-meta span,
.order-notes span,
.stock-big span,
.detail-list span,
.box-info-item span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.driver-address-box strong,
.driver-order-info-clean strong,
.pending-order-meta strong,
.stock-big strong,
.detail-list strong,
.box-info-item strong {
    display: block;
    color: var(--text);
    font-weight: 900;
}

.driver-address-box small,
.driver-order-info-clean small,
.pending-order-meta small,
.box-info-item small {
    display: block;
    color: var(--muted);
}

.driver-order-info-clean,
.pending-order-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.driver-order-action-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--border-soft);
    padding-top: 13px;
}

.driver-order-action-clean small {
    color: var(--muted);
}

/* =========================
   ORDER / FORM LINES
========================= */

.order-line-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 14px;
    align-items: stretch;
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
}

.order-line-main,
.order-line-fields {
    display: grid;
    gap: 12px;
}

.order-line-fields {
    grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.6fr);
}

.order-line-title span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.order-line-title strong {
    display: block;
    color: var(--text);
    font-weight: 900;
}

/* =========================
   BOX DETAIL
========================= */

.box-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.box-page-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    font-weight: 900;
}

.box-page-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.box-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.box-hero-card {
    display: grid;
    gap: 18px;
}

.box-hero-main {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.box-code-block span,
.box-hero-metrics span,
.order-hero-card span,
.order-prepare-hero span {
    display: block;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.box-code-block strong {
    display: block;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 900;
}

.box-hero-product h2 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
}

.box-hero-product p {
    margin: 4px 0 0;
    color: #cbd5e1;
}

.box-hero-metrics,
.order-hero-card,
.order-prepare-hero {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.box-hero-metrics div,
.order-hero-card div,
.order-prepare-hero div {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 14px;
}

.box-hero-metrics strong,
.order-hero-card strong,
.order-prepare-hero strong {
    display: block;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
}

.box-hero-metrics small,
.order-hero-card small,
.order-prepare-hero small {
    display: block;
    color: #cbd5e1;
}

.box-detail-pro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 18px;
    margin-bottom: 18px;
}

.box-info-grid,
.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.box-id-layout {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 12px;
}

.box-id-card {
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
}

.box-id-title {
    margin-bottom: 10px;
}

.box-id-title span {
    display: block;
    font-weight: 900;
}

.box-id-title small {
    display: block;
    color: var(--muted);
}

.box-qr-frame,
.box-barcode-frame {
    display: grid;
    place-items: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.box-qr-frame img {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.box-barcode-frame {
    min-height: 170px;
}

.box-barcode-frame img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.box-id-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.box-id-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.box-empty-code {
    background: #ffffff;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 34px 12px;
    text-align: center;
    color: var(--muted);
    font-weight: 800;
}

/* =========================
   EVIDENCE PREVIEW
========================= */

.dispatch-evidence-preview {
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.dispatch-evidence-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.dispatch-evidence-preview-header strong {
    color: var(--text);
    font-weight: 900;
}

.dispatch-evidence-preview-header small {
    color: var(--muted);
    font-family: var(--font-mono);
}

.dispatch-evidence-preview-frame {
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    overflow: hidden;
    max-height: 360px;
}

.dispatch-evidence-preview-image {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.dispatch-evidence-preview-status {
    margin-top: 8px;
    color: var(--success);
    font-weight: 800;
}

/* =========================
   DANGER / ACCESS
========================= */

.danger-zone {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.danger-zone strong {
    display: block;
    color: #991b1b;
    font-weight: 900;
}

.danger-zone p {
    margin: 4px 0 0;
    color: #7f1d1d;
}

.access-denied-card {
    max-width: 620px;
    margin: 80px auto;
    padding: 36px;
    text-align: center;
}

.access-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: #fee2e2;
    color: #991b1b;
    font-size: 32px;
    font-weight: 900;
    margin: 0 auto 18px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {
    .cards-grid,
    .premium-grid,
    .status-grid,
    .operations-grid,
    .dashboard-two-columns,
    .box-detail-pro-grid,
    .scanner-grid {
        grid-template-columns: 1fr;
    }

    .box-id-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    body {
        padding-top: 58px;
    }

    .mobile-shell-bar {
        position: fixed;
        inset: 0 0 auto 0;
        height: 58px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        background: var(--sidebar);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1200;
    }

    .mobile-menu-button {
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 12px;
        background: var(--sidebar-soft);
        color: #ffffff;
        font-size: 22px;
        line-height: 1;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-brand strong {
        display: block;
        color: #ffffff;
        font-weight: 900;
    }

    .mobile-brand small {
        display: block;
        color: #cbd5e1;
        font-size: 11px;
    }

    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        z-index: 1250;
    }

    .sidebar,
    .app-sidebar {
        width: 288px;
        transform: translateX(-105%);
        transition: transform 0.18s ease;
        z-index: 1300;
    }

    body.mobile-menu-open .sidebar,
    body.mobile-menu-open .app-sidebar {
        transform: translateX(0);
    }

    body.mobile-menu-open .mobile-sidebar-overlay {
        display: block;
    }

    .mobile-sidebar-close {
        display: grid;
        place-items: center;
        margin-left: auto;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
        font-size: 22px;
    }

    .main,
    .app-main {
        margin-left: 0;
        width: 100%;
        padding: 16px;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .topbar h1,
    .box-page-header h1 {
        font-size: 25px;
    }

    .panel,
    .toolbar-card,
    .scanner-card,
    .stat-card,
    .status-card,
    .premium-card,
    .box-pro-panel,
    .pending-order-card,
    .driver-order-card-clean,
    .dispatch-detail-clean-card {
        padding: 16px;
    }

    .form-grid,
    .box-info-grid,
    .detail-list,
    .driver-order-info-clean,
    .pending-order-meta,
    .pending-orders-grid,
    .driver-order-grid-clean,
    .evidence-grid,
    .box-hero-metrics,
    .order-hero-card,
    .order-prepare-hero,
    .order-line-card,
    .order-line-fields {
        grid-template-columns: 1fr;
    }

    .form-actions,
    .table-actions,
    .box-page-actions,
    .driver-order-action-clean,
    .prepare-manual-row,
    .manual-scan .input-group,
    .danger-zone {
        display: grid;
        grid-template-columns: 1fr;
    }

    .form-actions .btn,
    .table-actions .btn,
    .box-page-actions .btn,
    .driver-order-action-clean .btn,
    .prepare-manual-row .btn,
    .manual-scan .btn,
    .danger-zone .btn {
        width: 100%;
    }

    .table {
        min-width: 760px;
    }

    .reader-box,
    .prepare-reader-box {
        min-height: 245px;
    }

    .box-page-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .box-hero-main {
        display: grid;
        grid-template-columns: 1fr;
    }

    .box-code-block strong {
        font-size: 26px;
    }
}
/* =========================
   8.6.1 SIDEBAR ERP PREMIUM
========================= */

.sidebar,
.app-sidebar {
    background: #111827;
    padding: 16px 14px;
    border-right: 1px solid #1f2937;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.08);
}

/* Brand mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s limpio */
.brand,
.app-brand {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 4px 4px 18px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.12);
}

.brand-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    box-shadow: none;
    font-size: 20px;
}

.brand strong {
    font-size: 17px;
    font-weight: 900;
    color: #ffffff;
}

.brand small {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
}

/* MenÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Âº mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s tipo ERP */
.menu,
.app-menu {
    gap: 14px;
}

.menu-section {
    display: grid;
    gap: 4px;
}

.menu-section-title {
    padding: 0 10px 4px;
    color: #6b7280;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Links compactos */
.menu-link {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
}

.menu-link span {
    line-height: 1.2;
}

.menu-link:hover {
    background: #1f2937;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.04);
}

/* Estado activo mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s profesional */
.menu-link.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    box-shadow: none;
    font-weight: 900;
}

.menu-link.active::before {
    content: "";
    width: 4px;
    height: 20px;
    background: #2563eb;
    border-radius: 999px;
    margin-right: 8px;
}

/* Footer mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s limpio */
.sidebar-footer,
.app-sidebar-footer {
    border-top: 1px solid rgba(203, 213, 225, 0.12);
    padding-top: 12px;
    gap: 8px;
}

.session-box {
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 10px;
}

.session-box span {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.session-box strong {
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.logout-btn {
    min-height: 38px;
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
}

.logout-btn:hover {
    background: #1f2937;
    color: #ffffff;
}

/* Scroll lateral sobrio */
.sidebar::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb,
.app-sidebar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track,
.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* Mobile sidebar consistente */
@media (max-width: 900px) {
    .sidebar,
    .app-sidebar {
        background: #111827;
        width: 292px;
        padding: 16px 14px;
    }

    .mobile-shell-bar {
        background: #111827;
    }

    .mobile-menu-button {
        background: #1f2937;
        color: #ffffff;
        border-radius: 10px;
    }

    .mobile-sidebar-close {
        background: #1f2937;
        color: #ffffff;
        border-radius: 10px;
    }
}
/* =========================
   8.6.2 ERP TABLES / LISTS / FILTERS
========================= */

/* Toolbar / filtros mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s ERP */
.toolbar-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    margin-bottom: 16px;
}

.toolbar-card .form-label {
    font-size: 11px;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
}

.toolbar-card .form-control,
.toolbar-card .form-select {
    min-height: 40px;
    border-radius: 8px !important;
    font-size: 13px !important;
}

/* Tablas mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s compactas y empresariales */
.table-responsive {
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.table {
    font-size: 13px;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #dbe3ef;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    color: #111827;
    vertical-align: middle;
}

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

.table tbody tr:hover td {
    background: #f8fafc;
}

/* Columnas de cÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â³digos mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s limpias */
.code-pill {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 8px;
    padding: 5px 9px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
}

.table td .code-pill {
    white-space: nowrap;
}

/* Estados mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s sobrios */
.status-pill,
.movement-pill {
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
}

/* Acciones dentro de tablas */
.table-actions {
    gap: 6px;
}

.table-actions .btn,
.table .btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px !important;
}

/* Paneles de listado */
.panel {
    border-radius: 16px;
}

.panel-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.panel-header h2 {
    font-size: 19px;
    font-weight: 900;
    color: #111827;
}

.panel-header p {
    color: #64748b;
    font-size: 13px;
}

/* Badges contador */
.badge-soft {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 900;
}

/* Cards de pedidos / conductor */
.driver-order-card-clean,
.pending-order-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.driver-order-card-clean.active {
    border-color: #bfdbfe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.07);
}

.driver-card-label {
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 900;
}

.driver-order-head-clean h3,
.pending-order-head h2 {
    font-size: 20px;
    font-weight: 900;
    color: #111827;
}

.driver-order-head-clean p,
.pending-order-head p {
    color: #64748b;
}

.driver-address-box,
.driver-order-info-clean div,
.pending-order-meta div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.driver-address-box span,
.driver-order-info-clean span,
.pending-order-meta span {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
}

.driver-address-box strong,
.driver-order-info-clean strong,
.pending-order-meta strong {
    color: #111827;
    font-weight: 900;
}

/* Botones primarios menos genÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â©ricos */
.btn-dark {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

.btn-dark:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* AcciÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â³n secundaria */
.btn-outline-dark {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

.btn-outline-dark:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #111827 !important;
}

/* Inputs mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s limpios */
.form-control,
.form-select {
    min-height: 40px;
    border-radius: 8px !important;
}

textarea.form-control {
    min-height: 92px;
}

/* Empty states menos IA */
.empty-state,
.driver-empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 28px 18px;
}

.empty-state h3,
.driver-empty-state h3 {
    font-size: 17px;
    font-weight: 900;
}

.empty-state p,
.driver-empty-state p {
    color: #64748b;
}

/* Movimientos / trazabilidad */
.movement-pill {
    font-family: var(--font-ui);
}

.movement-inbound {
    background: #dcfce7;
    color: #166534;
}

.movement-picking_full,
.movement-picking_partial {
    background: #fef3c7;
    color: #92400e;
}

.movement-adjustment {
    background: #fee2e2;
    color: #991b1b;
}

.movement-dispatch {
    background: #dbeafe;
    color: #1e40af;
}

/* Responsive tabla ERP */
@media (max-width: 900px) {
    .toolbar-card {
        padding: 14px;
    }

    .table {
        min-width: 820px;
    }

    .panel-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .badge-soft {
        width: fit-content;
    }
}
/* =========================
   8.6.3 DASHBOARD / REPORTES ERP PREMIUM
========================= */

.erp-dashboard-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-dashboard-hero.reports {
    border-left: 5px solid #2563eb;
}

.erp-eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.erp-dashboard-hero h1 {
    margin: 0;
    color: #111827;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.erp-dashboard-hero p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}

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

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

.erp-kpi-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-kpi-card.primary {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-color: #0f172a;
    color: #ffffff;
}

.erp-kpi-card span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-kpi-card.primary span {
    color: #cbd5e1;
}

.erp-kpi-card strong {
    display: block;
    margin-top: 10px;
    color: #111827;
    font-size: 34px;
    line-height: 1;
    font-weight: 950;
}

.erp-kpi-card.primary strong {
    color: #ffffff;
}

.erp-kpi-card small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}

.erp-kpi-card.primary small {
    color: #cbd5e1;
}

.erp-control-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.erp-control-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-card-head {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.erp-card-head h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.erp-card-head p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

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

.erp-mini-grid div,
.erp-alert-stack div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-mini-grid span,
.erp-alert-stack span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-mini-grid strong,
.erp-alert-stack strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-alert-stack {
    display: grid;
    gap: 9px;
}

.erp-alert-stack .danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.erp-alert-stack .danger span,
.erp-alert-stack .danger strong {
    color: #991b1b;
}

.erp-alert-stack .warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.erp-alert-stack .warning span,
.erp-alert-stack .warning strong {
    color: #92400e;
}

.erp-alert-stack .ok {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.erp-alert-stack .ok span,
.erp-alert-stack .ok strong {
    color: #166534;
}

.erp-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    gap: 16px;
}

.erp-stock-feed,
.erp-order-feed {
    display: grid;
    gap: 10px;
}

.erp-stock-feed-item,
.erp-order-feed-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.erp-stock-feed-item strong,
.erp-order-feed-item strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-stock-feed-item small,
.erp-order-feed-item small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.erp-stock-feed-item > div:last-child {
    min-width: 86px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 9px;
    text-align: center;
}

.erp-stock-feed-item > div:last-child span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.erp-stock-feed-item > div:last-child strong {
    margin-top: 3px;
    font-size: 20px;
}

.erp-order-feed-item > div:last-child {
    display: grid;
    gap: 5px;
    justify-items: end;
}

/* Reports center */

.erp-report-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.erp-report-summary article {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 16px;
}

.erp-report-summary span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-report-summary strong {
    display: block;
    margin-top: 8px;
    color: #111827;
    font-size: 28px;
    line-height: 1;
    font-weight: 950;
}

.erp-report-summary small {
    display: block;
    margin-top: 8px;
    color: #64748b;
}

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

.erp-report-card {
    min-height: 230px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    padding: 18px;
    display: grid;
    align-content: space-between;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-report-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

.erp-report-tag {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.erp-report-card h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-report-card p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
}

.erp-report-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Responsive dashboard/reportes */
@media (max-width: 1200px) {
    .erp-kpi-grid,
    .erp-control-grid,
    .erp-report-summary,
    .erp-reports-grid,
    .erp-two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .erp-dashboard-hero {
        display: grid;
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .erp-dashboard-hero h1 {
        font-size: 25px;
    }

    .erp-hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .erp-hero-actions .btn {
        width: 100%;
    }

    .erp-mini-grid {
        grid-template-columns: 1fr;
    }

    .erp-stock-feed-item,
    .erp-order-feed-item {
        grid-template-columns: 1fr;
    }

    .erp-order-feed-item > div:last-child {
        justify-items: start;
    }

    .erp-report-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .erp-report-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.6.4 DASHBOARD CLEAN ERP
========================= */

.erp-dashboard-hero.clean {
    padding: 20px 22px;
    margin-bottom: 16px;
    min-height: auto;
}

.erp-dashboard-hero.clean h1 {
    font-size: 28px;
}

.erp-kpi-grid.compact {
    gap: 12px;
    margin-bottom: 14px;
}

.erp-kpi-grid.compact .erp-kpi-card {
    padding: 15px;
}

.erp-kpi-grid.compact .erp-kpi-card strong {
    font-size: 30px;
}

.erp-dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.6fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.erp-ops-panel {
    min-height: 100%;
}

.erp-side-stack {
    display: grid;
    gap: 16px;
}

.erp-side-card {
    padding: 16px;
}

.erp-status-chart {
    display: grid;
    gap: 11px;
}

.erp-status-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-status-row div span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-status-row div strong {
    display: block;
    margin-top: 2px;
    color: #111827;
    font-size: 22px;
    font-weight: 950;
}

.erp-status-row progress {
    width: 100%;
    height: 10px;
    appearance: none;
    -webkit-appearance: none;
}

.erp-status-row progress::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
}

.erp-status-row progress::-webkit-progress-value {
    background: #2563eb;
    border-radius: 999px;
}

.erp-status-row progress::-moz-progress-bar {
    background: #2563eb;
    border-radius: 999px;
}

.erp-status-row.success progress::-webkit-progress-value {
    background: #16a34a;
}

.erp-status-row.success progress::-moz-progress-bar {
    background: #16a34a;
}

.erp-alert-list,
.erp-inventory-snapshot,
.erp-mini-list {
    display: grid;
    gap: 9px;
}

.erp-alert-list div,
.erp-inventory-snapshot div,
.erp-mini-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.erp-alert-list div span,
.erp-inventory-snapshot div span,
.erp-mini-list div span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-alert-list div strong,
.erp-inventory-snapshot div strong,
.erp-mini-list div strong {
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-alert-list .danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.erp-alert-list .danger span,
.erp-alert-list .danger strong {
    color: #991b1b;
}

.erp-alert-list .warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.erp-alert-list .warning span,
.erp-alert-list .warning strong {
    color: #92400e;
}

.erp-alert-list .ok {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.erp-alert-list .ok span,
.erp-alert-list .ok strong {
    color: #166534;
}

.erp-activity-list {
    display: grid;
    gap: 9px;
}

.erp-activity-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.erp-activity-item strong {
    display: block;
    margin-top: 6px;
    color: #111827;
    font-weight: 950;
}

.erp-activity-item small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.erp-activity-item > div:last-child {
    display: grid;
    gap: 5px;
    justify-items: end;
}

.erp-stock-feed-item.compact {
    grid-template-columns: minmax(0, 1fr) 78px;
    padding: 11px;
}

.erp-stock-feed-item.compact > div:last-child {
    min-width: auto;
}

@media (max-width: 1200px) {
    .erp-dashboard-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .erp-status-row {
        grid-template-columns: 1fr;
    }

    .erp-activity-item {
        grid-template-columns: 1fr;
    }

    .erp-activity-item > div:last-child {
        justify-items: start;
    }
}
/* =========================
   8.6.5 PEDIDOS ERP PREMIUM
========================= */

.erp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.erp-title-block h1 {
    margin: 0;
    color: #111827;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.erp-title-block p {
    margin: 6px 0 0;
    color: #64748b;
}

.erp-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.erp-toolbar {
    margin-bottom: 14px;
}

.erp-list-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    color: #64748b;
}

.erp-list-summary strong {
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.erp-list-summary span {
    margin-left: 4px;
}

.erp-orders-mobile {
    display: none;
}

.erp-orders-table th,
.erp-orders-table td {
    white-space: nowrap;
}

.erp-customer-cell strong,
.erp-order-code strong,
.erp-product-stack strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-customer-cell small,
.erp-date-stack small,
.erp-product-stack small {
    display: block;
    color: #64748b;
}

.erp-source-pill {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 900;
}

.erp-date-stack strong {
    display: block;
    color: #111827;
}

/* Detail */

.erp-order-detail-hero {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.erp-order-detail-hero div {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-order-detail-hero span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-order-detail-hero strong {
    display: block;
    margin-top: 6px;
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.erp-cancelled-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 16px;
    display: grid;
    gap: 3px;
}

.erp-cancelled-banner strong {
    color: #991b1b;
    font-weight: 950;
}

.erp-cancelled-banner span {
    color: #7f1d1d;
}

.erp-order-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.erp-order-detail-main {
    min-width: 0;
}

.erp-order-detail-side {
    position: sticky;
    top: 18px;
}

.erp-count-pill {
    display: inline-flex;
    min-width: 36px;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 950;
}

.erp-count-pill.success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.erp-count-pill.warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.erp-custody-cell strong {
    display: block;
    color: #111827;
    font-weight: 900;
}

.erp-custody-cell small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.erp-order-summary {
    display: grid;
    gap: 9px;
}

.erp-order-summary div,
.erp-order-notes {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-order-summary span,
.erp-order-notes span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-order-summary strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

.erp-order-notes {
    margin-top: 12px;
}

.erp-order-notes p {
    margin: 5px 0 0;
    color: #334155;
}

.erp-evidence-list {
    display: grid;
    gap: 10px;
}

.erp-evidence-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 13px;
}

.erp-evidence-card strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-evidence-card small {
    display: block;
    color: #64748b;
}

.erp-evidence-card p {
    margin: 9px 0;
    color: #334155;
}

.erp-evidence-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.erp-evidence-footer span {
    color: #64748b;
    font-size: 13px;
}

.erp-evidence-upload {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 13px;
}

.erp-evidence-upload summary {
    cursor: pointer;
    color: #1d4ed8;
    font-weight: 900;
}

.erp-danger-panel {
    background: #fff7f7;
    border-color: #fecaca;
}

/* Mobile */

@media (max-width: 1200px) {
    .erp-order-detail-layout {
        grid-template-columns: 1fr;
    }

    .erp-order-detail-side {
        position: static;
    }

    .erp-order-detail-hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .erp-page-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .erp-page-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .erp-page-actions .btn,
    .erp-page-actions form,
    .erp-page-actions button {
        width: 100%;
    }

    .erp-orders-desktop {
        display: none;
    }

    .erp-orders-mobile {
        display: grid;
        gap: 14px;
    }

    .erp-order-mobile-card {
        background: #ffffff;
        border: 1px solid #dbe3ef;
        border-radius: 16px;
        padding: 15px;
        display: grid;
        gap: 14px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

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

    .erp-order-mobile-head h2 {
        margin: 8px 0 2px;
        color: #111827;
        font-size: 19px;
        font-weight: 950;
    }

    .erp-order-mobile-head p {
        margin: 0;
        color: #64748b;
    }

    .erp-order-mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .erp-order-mobile-grid div {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 10px;
    }

    .erp-order-mobile-grid span {
        display: block;
        color: #64748b;
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .erp-order-mobile-grid strong {
        display: block;
        margin-top: 3px;
        color: #111827;
        font-weight: 950;
    }

    .erp-order-mobile-actions {
        display: grid;
        gap: 9px;
    }

    .erp-order-mobile-actions .btn,
    .erp-order-mobile-actions form,
    .erp-order-mobile-actions button {
        width: 100%;
    }

    .erp-order-detail-hero {
        grid-template-columns: 1fr;
    }

    .erp-evidence-footer {
        display: grid;
        grid-template-columns: 1fr;
    }
}
/* =========================
   8.6.6 INVENTARIO ERP PREMIUM
========================= */

.erp-stock-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.erp-stock-side {
    position: sticky;
    top: 18px;
}

.erp-stock-main {
    min-width: 0;
}

.erp-inventory-table th,
.erp-inventory-table td,
.erp-movement-table th,
.erp-movement-table td {
    white-space: nowrap;
}

.erp-product-stack strong,
.erp-location-stack strong,
.erp-stock-stack strong,
.erp-date-stack strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-product-stack small,
.erp-location-stack small,
.erp-stock-stack small,
.erp-date-stack small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.erp-stock-pill,
.erp-lot-pill,
.erp-muted-pill,
.erp-user-pill,
.erp-quantity-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.erp-stock-pill {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.erp-lot-pill {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-family: var(--font-mono);
}

.erp-muted-pill {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.erp-user-pill {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.erp-quantity-pill.positive {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.erp-quantity-pill.negative {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.erp-route-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(80px, 1fr));
    gap: 6px;
}

.erp-route-stack div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 9px;
}

.erp-route-stack span {
    display: block;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-route-stack strong {
    display: block;
    color: #111827;
    font-size: 12px;
    font-weight: 950;
}

.erp-observation-cell {
    max-width: 280px;
    color: #334155;
    white-space: normal;
    line-height: 1.35;
}

.erp-movement-table .movement-pill {
    max-width: 150px;
    justify-content: center;
}

@media (max-width: 1200px) {
    .erp-stock-layout {
        grid-template-columns: 1fr;
    }

    .erp-stock-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .erp-inventory-table,
    .erp-movement-table {
        min-width: 980px;
    }

    .erp-route-stack {
        grid-template-columns: 1fr;
    }
}
/* =========================
   8.6.7 RECEPCIONES ERP PREMIUM
========================= */

.erp-reception-table th,
.erp-reception-table td {
    white-space: nowrap;
}

.erp-reception-hero {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.erp-reception-hero div {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-reception-hero span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-reception-hero strong {
    display: block;
    margin-top: 6px;
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

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

.erp-reception-summary-grid > div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-reception-summary-grid span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-reception-summary-grid strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

.erp-reception-notes {
    grid-column: 1 / -1;
}

.erp-reception-notes p {
    margin: 5px 0 0;
    color: #334155;
}

.erp-reception-item-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.3fr) 120px 150px minmax(220px, 1fr);
    gap: 12px;
    align-items: end;
}

.erp-form-check-block {
    align-self: center;
}

.erp-form-check-block .form-check {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 12px 12px 36px;
}

.erp-form-check-block .form-check-label {
    font-weight: 800;
    color: #334155;
}

.erp-reception-submit {
    align-self: end;
}

.erp-reception-form-panel {
    max-width: 1080px;
}

.erp-form-section {
    display: grid;
    gap: 16px;
}

.erp-form-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
}

.erp-form-block h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 16px;
    font-weight: 950;
}

@media (max-width: 1200px) {
    .erp-reception-hero,
    .erp-reception-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erp-reception-item-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .erp-reception-hero,
    .erp-reception-summary-grid,
    .erp-reception-item-form {
        grid-template-columns: 1fr;
    }

    .erp-reception-table {
        min-width: 980px;
    }
}
/* =========================
   8.6.8 OPERACION BODEGA ERP MOBILE
========================= */

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

.warehouse-pending-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.warehouse-pending-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.warehouse-pending-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.warehouse-pending-head h2 {
    margin: 8px 0 2px;
    color: #111827;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 950;
}

.warehouse-pending-head p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
}

.warehouse-pending-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.warehouse-pending-meta div,
.warehouse-pending-note {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
}

.warehouse-pending-meta span,
.warehouse-pending-note span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.warehouse-pending-meta strong {
    display: block;
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.warehouse-pending-meta small {
    display: block;
    color: #64748b;
}

.warehouse-pending-note p {
    margin: 4px 0 0;
    color: #334155;
}

.warehouse-pending-action {
    border-top: 1px solid #edf2f7;
    padding-top: 12px;
}

.warehouse-empty-panel {
    grid-column: 1 / -1;
}

/* Prepare */

.warehouse-prepare-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.warehouse-prepare-status div {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.warehouse-prepare-status span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.warehouse-prepare-status strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 24px;
    line-height: 1;
    font-weight: 950;
}

.warehouse-prepare-status small {
    display: block;
    margin-top: 6px;
    color: #64748b;
}

.warehouse-complete-banner {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    display: grid;
    gap: 3px;
}

.warehouse-complete-banner strong {
    color: #166534;
    font-weight: 950;
}

.warehouse-complete-banner span {
    color: #166534;
}

.warehouse-prepare-layout {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.warehouse-scan-panel {
    position: sticky;
    top: 18px;
}

.warehouse-progress-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.warehouse-progress-box div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.warehouse-progress-box span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.warehouse-progress-box strong {
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.warehouse-progress-box progress {
    width: 100%;
    height: 10px;
    appearance: none;
    -webkit-appearance: none;
}

.warehouse-progress-box progress::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
}

.warehouse-progress-box progress::-webkit-progress-value {
    background: #2563eb;
    border-radius: 999px;
}

.warehouse-progress-box progress::-moz-progress-bar {
    background: #2563eb;
    border-radius: 999px;
}

.warehouse-guide-list {
    display: grid;
    gap: 10px;
}

.warehouse-guide-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.warehouse-guide-item.prepare-box-item-done {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.warehouse-guide-product strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.warehouse-guide-product small {
    display: block;
    color: #64748b;
}

.code-pill.muted {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

/* Make existing scanner box fit ERP */
.prepare-reader-shell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px;
}

.prepare-reader-box {
    min-height: 300px;
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
}

.prepare-manual-box {
    margin-top: 14px;
}

.prepare-manual-row {
    display: flex;
    gap: 10px;
}

.scan-message {
    margin-top: 12px;
}

/* Responsive operation */
@media (max-width: 1200px) {
    .warehouse-pending-board,
    .warehouse-prepare-layout {
        grid-template-columns: 1fr;
    }

    .warehouse-scan-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .warehouse-prepare-status,
    .warehouse-pending-meta {
        grid-template-columns: 1fr;
    }

    .warehouse-guide-item {
        grid-template-columns: 1fr;
    }

    .prepare-manual-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .prepare-manual-row .btn {
        width: 100%;
    }

    .prepare-reader-box {
        min-height: 250px;
    }
}
/* =========================
   ORDER FORM CLEAN ERP
========================= */

.order-form-layout-single {
    display: block !important;
}

.order-form-layout-single .order-form-main {
    width: 100%;
    max-width: 100%;
}

.erp-order-form-clean .order-form-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-order-form-clean .order-form-card-header,
.erp-order-form-clean .order-lines-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-order-form-clean .order-form-card-header h2,
.erp-order-form-clean .order-lines-header h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-order-form-clean .order-form-card-header p,
.erp-order-form-clean .order-lines-header p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-order-form-clean .order-line-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

@media (max-width: 900px) {
    .erp-order-form-clean .order-lines-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .erp-order-form-clean .order-lines-header .btn {
        width: 100%;
    }
}
/* =========================
   8.6.9 SCANNER GENERAL ERP PREMIUM
========================= */

.erp-scanner-layout {
    display: grid;
    grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr);
    gap: 16px;
    align-items: start;
}

.erp-scanner-panel {
    position: sticky;
    top: 18px;
}

.erp-scanner-status {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.erp-scanner-status span {
    display: block;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-scanner-status strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.erp-scanner-status small {
    display: block;
    margin-top: 3px;
    color: #334155;
}

.erp-reader-shell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px;
}

.erp-reader-box,
.scanner-senior-reader-box {
    min-height: 310px;
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
}

.erp-manual-scan-box {
    margin-top: 14px;
}

.erp-manual-scan-row {
    display: flex;
    gap: 10px;
}

.erp-scanner-empty-state {
    min-height: 420px;
    display: grid;
    place-items: center;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 28px;
}

.erp-scanner-empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    font-size: 28px;
    font-weight: 950;
}

.erp-scanner-empty-state h3 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-scanner-empty-state p {
    max-width: 430px;
    margin: 8px auto 0;
    color: #64748b;
}

.erp-scanner-section-head {
    margin-bottom: 12px;
}

.erp-scanner-section-head h3 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-scanner-section-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-scanner-matches-list {
    display: grid;
    gap: 10px;
}

.erp-scanner-match-item {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 12px;
    align-items: center;
    cursor: pointer;
}

.erp-scanner-match-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.erp-scanner-match-main strong {
    display: block;
    color: #1d4ed8;
    font-family: var(--font-mono);
    font-weight: 950;
}

.erp-scanner-match-main span {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

.erp-scanner-match-main small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.erp-scanner-match-stock {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 9px;
    text-align: center;
}

.erp-scanner-match-stock strong {
    display: block;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-scanner-match-stock small {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.erp-scanner-box-title {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.erp-scanner-box-title span:first-child {
    display: block;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-scanner-box-title h3 {
    margin: 5px 0 0;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 950;
}

.erp-back-to-matches {
    margin-bottom: 12px;
}

.erp-scanner-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.erp-scanner-detail-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
}

.erp-scanner-detail-item.highlight {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.erp-scanner-detail-item span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-scanner-detail-item strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.erp-scanner-detail-item small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.erp-scanner-action-box {
    margin-top: 14px;
}

.erp-scanner-dispatch-box {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.erp-scanner-dispatch-box strong {
    display: block;
    color: #9a3412;
    font-weight: 950;
}

.erp-scanner-dispatch-box small {
    display: block;
    color: #9a3412;
}

@media (max-width: 1200px) {
    .erp-scanner-layout {
        grid-template-columns: 1fr;
    }

    .erp-scanner-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .erp-manual-scan-row,
    .erp-scanner-dispatch-box {
        display: grid;
        grid-template-columns: 1fr;
    }

    .erp-manual-scan-row .btn,
    .erp-scanner-dispatch-box .btn {
        width: 100%;
    }

    .erp-scanner-detail-grid,
    .erp-scanner-match-item {
        grid-template-columns: 1fr;
    }

    .erp-reader-box,
    .scanner-senior-reader-box {
        min-height: 250px;
    }

    .erp-scanner-empty-state {
        min-height: 300px;
    }
}
/* =========================
   8.6.10 DESPACHOS CONDUCTOR ERP MOBILE
========================= */

.driver-board {
    display: grid;
    gap: 16px;
}

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

.driver-dispatch-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 13px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.driver-dispatch-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.driver-dispatch-card.active {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.driver-dispatch-card.available {
    border-left: 5px solid #2563eb;
}

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

.driver-dispatch-head h3 {
    margin: 7px 0 2px;
    color: #111827;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 950;
    font-family: var(--font-mono);
}

.driver-dispatch-head p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.driver-card-label.warning {
    background: #fef3c7;
    color: #92400e;
}

.driver-card-label.success {
    background: #dcfce7;
    color: #166534;
}

.driver-destination-box,
.driver-dispatch-meta div,
.driver-load-progress-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.driver-destination-box span,
.driver-dispatch-meta span,
.driver-load-progress-box span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.driver-destination-box strong,
.driver-dispatch-meta strong,
.driver-load-progress-box strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

.driver-destination-box small,
.driver-dispatch-meta small {
    display: block;
    color: #64748b;
    margin-top: 2px;
}

.driver-dispatch-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.driver-load-progress-box {
    display: grid;
    gap: 8px;
}

.driver-load-progress-box > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.driver-load-progress-box progress {
    width: 100%;
    height: 10px;
    appearance: none;
    -webkit-appearance: none;
}

.driver-load-progress-box progress::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
}

.driver-load-progress-box progress::-webkit-progress-value {
    background: #2563eb;
    border-radius: 999px;
}

.driver-load-progress-box progress::-moz-progress-bar {
    background: #2563eb;
    border-radius: 999px;
}

.driver-dispatch-action {
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
}

@media (max-width: 1200px) {
    .driver-board-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .driver-dispatch-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-dispatch-meta {
        grid-template-columns: 1fr;
    }
}
/* =========================
   8.6.11 DETALLE DESPACHO ERP MOBILE
========================= */

.driver-delivery-hero {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.driver-delivery-hero div {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.driver-delivery-hero span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.driver-delivery-hero strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.driver-delivery-hero small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.driver-delivery-action-panel {
    margin-bottom: 16px;
}

.driver-step-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.driver-step-label {
    display: inline-flex;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.driver-step-card h2 {
    margin: 8px 0 4px;
    color: #111827;
    font-size: 22px;
    font-weight: 950;
}

.driver-step-card p {
    margin: 0;
    color: #64748b;
}

.driver-load-status {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-weight: 800;
}

.driver-load-status.pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.driver-load-status.success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.driver-load-status.muted {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.driver-load-progress-box-large {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.driver-load-progress-box-large div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.driver-load-progress-box-large span {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.driver-load-progress-box-large strong {
    color: #111827;
    font-size: 18px;
    font-weight: 950;
}

.driver-load-progress-box-large progress {
    width: 100%;
    height: 10px;
    appearance: none;
    -webkit-appearance: none;
}

.driver-load-progress-box-large progress::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
}

.driver-load-progress-box-large progress::-webkit-progress-value {
    background: #2563eb;
    border-radius: 999px;
}

.driver-load-progress-box-large progress::-moz-progress-bar {
    background: #2563eb;
    border-radius: 999px;
}

.driver-scan-warning {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 12px;
}

.driver-scan-warning strong {
    display: block;
    color: #1d4ed8;
    font-weight: 950;
}

.driver-scan-warning span {
    display: block;
    margin-top: 3px;
    color: #334155;
}

.driver-evidence-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
    gap: 14px;
    align-items: start;
}

.driver-evidence-upload-box,
.driver-evidence-preview-box,
.driver-comment-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 13px;
}

.driver-empty-preview {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 20px;
}

.driver-empty-preview strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.driver-empty-preview span {
    display: block;
    margin-top: 5px;
    color: #64748b;
}

.driver-detail-layout {
    display: grid;
    gap: 16px;
}

.driver-load-list {
    display: grid;
    gap: 10px;
}

.driver-load-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.driver-load-row.prepare-box-item-done {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.driver-load-product strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.driver-load-product small {
    display: block;
    color: #64748b;
}

.dispatch-evidence-card-clean {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.dispatch-evidence-main-clean strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.dispatch-evidence-main-clean small,
.dispatch-evidence-side-clean span {
    display: block;
    color: #64748b;
}

.dispatch-evidence-main-clean p {
    margin: 8px 0 0;
    color: #334155;
}

.dispatch-evidence-side-clean {
    display: grid;
    gap: 8px;
    justify-items: end;
    align-content: center;
}

@media (max-width: 1200px) {
    .driver-delivery-hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .driver-evidence-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .driver-delivery-hero,
    .driver-load-row,
    .dispatch-evidence-card-clean {
        grid-template-columns: 1fr;
    }

    .driver-step-card {
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-step-card .btn,
    .driver-step-card form {
        width: 100%;
    }

    .driver-load-progress-box-large div {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dispatch-evidence-side-clean {
        justify-items: start;
    }
}
/* =========================
   8.6.12 PRODUCTOS ERP PREMIUM
========================= */

.erp-products-table th,
.erp-products-table td {
    white-space: nowrap;
}

.erp-products-table .erp-product-stack {
    min-width: 220px;
}

.erp-category-pill,
.erp-unit-pill,
.erp-rule-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.erp-category-pill {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.erp-unit-pill {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.erp-rules-inline {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.erp-rule-pill.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.erp-rule-pill.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.erp-rule-pill.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.erp-rule-pill.muted {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Product form */

.erp-product-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.erp-product-form-main {
    min-width: 0;
}

.erp-product-form-side {
    position: sticky;
    top: 18px;
}

.erp-form-card,
.erp-product-rules-panel {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-form-card-header,
.erp-product-rules-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-form-card-header h2,
.erp-product-rules-head h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-form-card-header p,
.erp-product-rules-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-product-rules-list {
    display: grid;
    gap: 10px;
}

.erp-rule-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
}

.erp-rule-check.active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.erp-rule-check input {
    margin-top: 3px;
}

.erp-rule-check strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-rule-check small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

@media (max-width: 1200px) {
    .erp-product-form-layout {
        grid-template-columns: 1fr;
    }

    .erp-product-form-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .erp-products-table {
        min-width: 980px;
    }

    .product-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .product-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.6.13 CLIENTES ERP PREMIUM
========================= */

.erp-customers-table th,
.erp-customers-table td {
    white-space: nowrap;
}

.erp-customer-stack strong,
.erp-contact-stack strong,
.erp-address-stack strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-customer-stack small,
.erp-contact-stack small,
.erp-address-stack small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.erp-contact-stack,
.erp-address-stack {
    min-width: 170px;
}

.erp-customer-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.erp-customer-form-main {
    min-width: 0;
}

.erp-customer-form-side {
    position: sticky;
    top: 18px;
}

.erp-customer-status-panel {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-customer-status-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-customer-status-head h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-customer-status-head p {
    margin: 4px 0 0;
    color: #64748b;
}

@media (max-width: 1200px) {
    .erp-customer-form-layout {
        grid-template-columns: 1fr;
    }

    .erp-customer-form-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .erp-customers-table {
        min-width: 980px;
    }

    .customer-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .customer-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.6.14 PALLETS ERP PREMIUM
========================= */

.erp-pallets-table th,
.erp-pallets-table td {
    white-space: nowrap;
}

.erp-pallet-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.erp-pallet-form-main {
    min-width: 0;
}

.erp-pallet-form-side {
    position: sticky;
    top: 18px;
}

.erp-pallet-info-panel {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-pallet-info-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-pallet-info-head h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-pallet-info-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-pallet-info-list {
    display: grid;
    gap: 9px;
}

.erp-pallet-info-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-pallet-info-list span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-pallet-info-list strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

@media (max-width: 1200px) {
    .erp-pallet-form-layout {
        grid-template-columns: 1fr;
    }

    .erp-pallet-form-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .erp-pallets-table {
        min-width: 980px;
    }

    .pallet-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .pallet-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.6.15 BODEGAS ERP PREMIUM
========================= */

.erp-warehouses-table th,
.erp-warehouses-table td {
    white-space: nowrap;
}

.erp-warehouse-stack strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-warehouse-stack small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.erp-text-cell {
    max-width: 260px;
    color: #334155;
    white-space: normal;
    line-height: 1.35;
}

.erp-warehouse-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.erp-warehouse-form-main {
    min-width: 0;
}

.erp-warehouse-form-side {
    position: sticky;
    top: 18px;
}

.erp-warehouse-status-panel {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-warehouse-status-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-warehouse-status-head h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-warehouse-status-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-warehouse-info-list {
    display: grid;
    gap: 9px;
}

.erp-warehouse-info-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-warehouse-info-list span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-warehouse-info-list strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

@media (max-width: 1200px) {
    .erp-warehouse-form-layout {
        grid-template-columns: 1fr;
    }

    .erp-warehouse-form-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .erp-warehouses-table {
        min-width: 980px;
    }

    .warehouse-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .warehouse-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.6.16 UBICACIONES ERP PREMIUM
========================= */

.erp-locations-table th,
.erp-locations-table td {
    white-space: nowrap;
}

.erp-location-main-stack strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-location-main-stack small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.erp-location-type-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.erp-location-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(54px, 1fr));
    gap: 6px;
    min-width: 260px;
}

.erp-location-detail-grid div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 8px;
}

.erp-location-detail-grid span {
    display: block;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-location-detail-grid strong {
    display: block;
    margin-top: 3px;
    color: #111827;
    font-size: 12px;
    font-weight: 950;
}

.erp-location-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.erp-location-form-main {
    min-width: 0;
}

.erp-location-form-side {
    position: sticky;
    top: 18px;
}

.erp-location-status-panel {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-location-status-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-location-status-head h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-location-status-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-location-info-list {
    display: grid;
    gap: 9px;
}

.erp-location-info-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-location-info-list span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-location-info-list strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

.erp-location-physical-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1200px) {
    .erp-location-form-layout {
        grid-template-columns: 1fr;
    }

    .erp-location-form-side {
        position: static;
    }

    .erp-location-physical-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .erp-locations-table {
        min-width: 1100px;
    }

    .erp-location-detail-grid {
        grid-template-columns: repeat(2, minmax(54px, 1fr));
    }

    .erp-location-physical-form-grid {
        grid-template-columns: 1fr;
    }

    .location-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .location-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.6.17 USUARIOS ERP PREMIUM
========================= */

.erp-users-table th,
.erp-users-table td {
    white-space: nowrap;
}

.erp-user-identity small,
.erp-user-stack small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.erp-user-stack strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-user-company-pill,
.erp-user-role-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.erp-user-company-pill {
    background: #111827;
    color: #ffffff;
    border: 1px solid #111827;
}

.erp-user-role-pill {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.erp-user-role-pill.super {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.erp-user-permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 520px;
}

.erp-user-permission-tags span {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 8px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.erp-user-active-box {
    max-width: 460px;
}

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

.erp-permission-group-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
}

.erp-permission-group-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.erp-permission-group-header strong {
    display: block;
    color: #111827;
    font-size: 15px;
    font-weight: 950;
}

.erp-permission-group-header small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.erp-permission-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
    margin-bottom: 8px;
    cursor: pointer;
}

.erp-permission-check:last-child {
    margin-bottom: 0;
}

.erp-permission-check input {
    margin-top: 3px;
}

.erp-permission-check strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-permission-check small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

@media (max-width: 1100px) {
    .erp-user-permissions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .erp-users-table {
        min-width: 1250px;
    }

    .user-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .user-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.7.1 BOX FORM CLEAN ERP
========================= */

.erp-box-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.erp-box-form-main {
    min-width: 0;
}

.erp-box-form-side {
    position: sticky;
    top: 18px;
}

.erp-box-info-panel {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-box-info-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-box-info-head h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-box-info-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-box-info-list {
    display: grid;
    gap: 9px;
}

.erp-box-info-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-box-info-list span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-box-info-list strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

@media (max-width: 1200px) {
    .erp-box-form-layout {
        grid-template-columns: 1fr;
    }

    .erp-box-form-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .box-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .box-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.7.2 REPORTES CLEAN ERP
========================= */

.erp-report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.erp-report-kpi-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-report-kpi-card.primary {
    background: #111827;
    border-color: #111827;
}

.erp-report-kpi-card span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-report-kpi-card.primary span {
    color: #cbd5e1;
}

.erp-report-kpi-card strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 28px;
    line-height: 1;
    font-weight: 950;
}

.erp-report-kpi-card.primary strong {
    color: #ffffff;
}

.erp-report-kpi-card small {
    display: block;
    margin-top: 6px;
    color: #64748b;
}

.erp-report-kpi-card.primary small {
    color: #cbd5e1;
}

.erp-alert-report-table th,
.erp-alert-report-table td,
.erp-order-report-table th,
.erp-order-report-table td {
    white-space: nowrap;
}

.erp-lot-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

@media (max-width: 1200px) {
    .erp-report-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .erp-report-kpi-grid {
        grid-template-columns: 1fr;
    }

    .erp-alert-report-table {
        min-width: 980px;
    }

    .erp-order-report-table {
        min-width: 1150px;
    }
}
/* =========================
   8.7.3 EMPRESAS LIST CLEAN ERP
========================= */

.erp-companies-table th,
.erp-companies-table td {
    white-space: nowrap;
}

.erp-company-stack strong,
.erp-company-contact strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-company-stack small,
.erp-company-contact small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.erp-company-plan-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.erp-company-plan-pill.plan_pro,
.erp-company-plan-pill.plan_cloud_pro {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.erp-company-plan-pill.plan_enterprise {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.erp-company-metrics-mini {
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    gap: 6px;
    min-width: 240px;
}

.erp-company-metrics-mini div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 8px;
}

.erp-company-metrics-mini span {
    display: block;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-company-metrics-mini strong {
    display: block;
    margin-top: 3px;
    color: #111827;
    font-size: 14px;
    font-weight: 950;
}

@media (max-width: 900px) {
    .erp-companies-table {
        min-width: 1150px;
    }
}
/* =========================
   8.7.4 EMPRESAS FORM CLEAN ERP
========================= */

.erp-company-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.erp-company-form-main {
    min-width: 0;
}

.erp-company-form-side {
    position: sticky;
    top: 18px;
}

.erp-company-info-panel {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erp-company-info-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.erp-company-info-head h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-company-info-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.erp-company-info-list {
    display: grid;
    gap: 9px;
}

.erp-company-info-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-company-info-list span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-company-info-list strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

@media (max-width: 1200px) {
    .erp-company-form-layout {
        grid-template-columns: 1fr;
    }

    .erp-company-form-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .company-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .company-form-actions .btn {
        width: 100%;
    }
}
/* =========================
   8.7.5 EMPRESA DETAIL CLEAN ERP
========================= */

.erp-company-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr) minmax(280px, 0.7fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.erp-detail-list {
    display: grid;
    gap: 10px;
}

.erp-detail-list div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
}

.erp-detail-list span,
.erp-company-resource-grid span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erp-detail-list strong,
.erp-company-resource-grid strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

.erp-company-resource-grid {
    display: grid;
    gap: 9px;
}

.erp-company-resource-grid div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

.erp-company-resource-grid strong {
    font-size: 22px;
}

.erp-company-actions-grid {
    display: grid;
    gap: 10px;
}

.erp-company-action-card {
    width: 100%;
    display: block;
    text-align: left;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 13px;
    cursor: pointer;
}

.erp-company-action-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.erp-company-action-card.danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.erp-company-action-card.success {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.erp-company-action-card strong {
    display: block;
    color: #111827;
    font-weight: 950;
}

.erp-company-action-card span {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

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

.erp-company-detail-table th,
.erp-company-detail-table td {
    white-space: nowrap;
}

@media (max-width: 1300px) {
    .erp-company-detail-grid {
        grid-template-columns: 1fr;
    }

    .erp-company-detail-two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .erp-company-detail-table {
        min-width: 760px;
    }
}
/* =========================
   8.7.6 ACCESS + BOX DETAIL FINAL CLEAN
========================= */

.erp-access-denied-card {
    max-width: 620px;
    margin: 42px auto;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-align: center;
}

.erp-access-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 28px;
    font-weight: 950;
}

.erp-access-content h1 {
    margin: 8px 0 8px;
    color: #111827;
    font-size: 28px;
    font-weight: 950;
}

.erp-access-content p {
    margin: 0 auto;
    max-width: 460px;
    color: #64748b;
}

.erp-access-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.erp-box-detail-table th,
.erp-box-detail-table td {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .erp-access-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .erp-access-actions .btn {
        width: 100%;
    }

    .erp-box-detail-table {
        min-width: 980px;
    }
}
/* =========================
   8.7.7 BOX LIST FINAL FIX
========================= */

.erp-boxes-table th,
.erp-boxes-table td {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .erp-boxes-table {
        min-width: 1100px;
    }
}
/* =========================================================
   FIX 9.6 STAGING - Controles checkbox/radio clickeables
   Evita inputs fantasma en formularios ERP Premium.
   ========================================================= */

input[type="checkbox"],
input[type="radio"] {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    position: static !important;
    pointer-events: auto !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    z-index: 10 !important;
}

input[type="checkbox"] + label,
input[type="radio"] + label,
label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.permission-card,
.permission-row,
.form-check,
.form-switch,
.toggle-row {
    pointer-events: auto !important;
}

/* =========================================================
   FIX 9.6.11 - Estados operacionales diferenciados
   ========================================================= */

.status-pill,
.badge-status,
.order-status,
.box-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

/* Base / borrador */
.status-draft,
.status-pending,
.status-created {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

/* Disponible / activo */
.status-available,
.status-active,
.status-open {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #86efac !important;
}

/* Reservado */
.status-reserved {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

/* En preparaciÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â³n */
.status-in_preparation,
.status-preparation,
.status-preparing {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fcd34d !important;
}

/* Preparado / listo */
.status-picked,
.status-ready {
    background: #ede9fe !important;
    color: #6d28d9 !important;
    border-color: #c4b5fd !important;
}

/* En despacho / ruta */
.status-out_for_delivery,
.status-dispatch,
.status-in_dispatch {
    background: #ffedd5 !important;
    color: #c2410c !important;
    border-color: #fdba74 !important;
}

/* Despachado / completado */
.status-dispatched,
.status-delivered,
.status-completed,
.status-closed {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #94a3b8 !important;
}

/* Cancelado / anulado / error */
.status-cancelled,
.status-canceled,
.status-annulled,
.status-void,
.status-error,
.status-inactive {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}

/* Merma / daÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â±ada / bloqueada */
.status-damaged,
.status-waste,
.status-blocked,
.status-expired {
    background: #f3e8ff !important;
    color: #7e22ce !important;
    border-color: #d8b4fe !important;
}

/* =========================================================
   PRO - RendiciÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³n conductor / pago
   ========================================================= */

.driver-payment-box {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: #fff;
}

.driver-payment-box .panel-header.compact {
    margin-bottom: 12px;
}

.driver-payment-box h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.driver-payment-box p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

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

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

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PRO - Panel financiero pedido
   ========================================================= */

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

.erp-summary-item {
    border: 1px solid var(--border-color, #e5e7eb);
    background: #fff;
    padding: 14px;
}

.erp-summary-item span {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

.erp-summary-item strong {
    display: block;
    font-size: 1rem;
    color: #0f172a;
}

.erp-note-box {
    border: 1px solid var(--border-color, #e5e7eb);
    background: #f8fafc;
    padding: 14px;
}

.erp-note-box p {
    margin: 6px 0 0;
    color: #334155;
}

.status-collected {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #86efac !important;
}

.status-partial {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fcd34d !important;
}

.status-overpaid {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

.status-validated {
    background: #ede9fe !important;
    color: #6d28d9 !important;
    border-color: #c4b5fd !important;
}

.status-not_required {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #94a3b8 !important;
}

@media (max-width: 768px) {
    .erp-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PRO - Pago en listado de pedidos
   ========================================================= */

.erp-payment-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 150px;
}

.erp-payment-cell small {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.erp-payment-cell .payment-diff {
    color: #b45309;
}

/* =========================================================
   PRO - Reporte rendiciÃ³n conductores
   ========================================================= */

.erp-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.erp-status-strip span {
    border: 1px solid var(--border-color, #e5e7eb);
    background: #fff;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 700;
}

.erp-status-strip strong {
    color: #0f172a;
}

/* =========================================================
   PRO - Validación de rendición
   ========================================================= */

.payment-validation-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding-top: 12px;
}

/* =========================================================
   BLOQUE 11.3 - Estados visuales PRO / Semaforo operativo
   Fuente final de verdad visual para pills de estado.
   Mantener al final del archivo para sobrescribir estilos previos.
   ========================================================= */

/* Base pill PRO */
.status-pill,
.badge-status,
.order-status,
.box-status,
.movement-pill {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .03em !important;
    text-transform: uppercase !important;
    border: 1px solid transparent !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

/* Neutro / borrador / pendiente general */
.status-draft,
.status-created {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

/* Pedido reservado */
.status-reserved {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

/* Pedido en preparacion */
.status-in_preparation {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #f59e0b !important;
}

/* Preparado / listo para despacho */
.status-picked,
.status-ready {
    background: #e0f2fe !important;
    color: #075985 !important;
    border-color: #38bdf8 !important;
}

/* En ruta / despacho tomado */
.status-out_for_delivery {
    background: #ede9fe !important;
    color: #5b21b6 !important;
    border-color: #a78bfa !important;
}

/* Despachado / completado / cerrado */
.status-dispatched,
.status-delivered,
.status-completed,
.status-closed {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #22c55e !important;
}

/* Cancelado / inactivo / merma / bloqueado */
.status-cancelled,
.status-inactive,
.status-waste,
.status-blocked {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #f87171 !important;
}

/* Activo / disponible */
.status-active,
.status-available {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #86efac !important;
}

/* Suspendido */
.status-suspended {
    background: #ffedd5 !important;
    color: #9a3412 !important;
    border-color: #fb923c !important;
}

/* Parcial de inventario o pago */
.status-partial {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #f59e0b !important;
}

/* =========================================================
   Estados financieros / rendicion conductor
   ========================================================= */

/* Pendiente de cobro / pendiente de validacion */
.status-pending {
    background: #f8fafc !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

/* Cobrado exacto */
.status-collected {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #22c55e !important;
}

/* Pago parcial */
.status-partial {
    background: #ffedd5 !important;
    color: #9a3412 !important;
    border-color: #fb923c !important;
}

/* Sobrepago */
.status-overpaid {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #60a5fa !important;
}

/* No requiere cobro */
.status-not_required {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #94a3b8 !important;
}

/* Validado por administracion */
.status-validated {
    background: #064e3b !important;
    color: #ecfdf5 !important;
    border-color: #10b981 !important;
}

/* Diferencias monetarias visibles */
.money-negative,
.payment-difference-negative {
    color: #b91c1c !important;
    font-weight: 900 !important;
}

.money-positive,
.payment-difference-positive {
    color: #1d4ed8 !important;
    font-weight: 900 !important;
}

.money-zero,
.payment-difference-zero {
    color: #166534 !important;
    font-weight: 900 !important;
}

/* =========================================================
   AUTH / LOGIN PRO
   ========================================================= */

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 23, 42, 0.10), transparent 30%),
        linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    color: #0f172a;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(160deg, #0f172a 0%, #111827 50%, #1e293b 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
}

.auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.10), transparent 25%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,0.08), transparent 28%);
    pointer-events: none;
}

.auth-brand-wrap {
    position: relative;
    z-index: 1;
    max-width: 560px;
    width: 100%;
}

.auth-logo-block {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.auth-logo-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.auth-eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    opacity: 0.75;
}

.auth-brand-panel h1 {
    margin: 0;
    font-size: 2.35rem;
    line-height: 1.08;
    font-weight: 800;
}

.auth-brand-copy {
    margin: 0 0 34px;
    font-size: 1.02rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.82);
    max-width: 520px;
}

.auth-feature-list {
    display: grid;
    gap: 16px;
}

.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 18px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(6px);
}

.auth-feature-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #60a5fa;
    margin-top: 7px;
    flex-shrink: 0;
}

.auth-feature-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.98rem;
}

.auth-feature-item p {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.78);
}

.auth-brand-footer {
    margin-top: 34px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.64);
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 34px 32px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

.auth-card-header {
    margin-bottom: 24px;
}

.auth-card-header h2 {
    margin: 0 0 10px;
    font-size: 2rem;
    line-height: 1.1;
    color: #0f172a;
}

.auth-card-header p:last-child {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.auth-alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.92rem;
    line-height: 1.45;
}

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

.auth-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.auth-input {
    width: 100%;
    height: 52px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 0 16px;
    font-size: 0.96rem;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-submit {
    margin-top: 8px;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: #ffffff;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 14px 24px rgba(17, 24, 39, 0.18);
}

.auth-submit:hover {
    transform: translateY(-1px);
    opacity: 0.98;
}

.auth-card-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.auth-card-footer p {
    margin: 0;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.55;
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        padding: 36px 24px;
    }

    .auth-brand-panel h1 {
        font-size: 1.9rem;
    }

    .auth-form-panel {
        padding: 20px 16px 32px;
    }

    .auth-card {
        max-width: 100%;
        padding: 26px 22px;
        border-radius: 20px;
    }
}

@media (max-width: 640px) {
    .auth-logo-block {
        gap: 14px;
    }

    .auth-logo-mark {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        font-size: 1.2rem;
    }

    .auth-brand-copy {
        font-size: 0.95rem;
    }

    .auth-card-header h2 {
        font-size: 1.7rem;
    }
}

/* =========================================================
   AUTH LOGIN REFINEMENT � Desktop + Mobile PRO
   ========================================================= */

/* Mejora general desktop */
.auth-body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 30%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.10), transparent 32%),
        linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%) !important;
}

.auth-brand-panel {
    background:
        linear-gradient(160deg, #020617 0%, #0f172a 48%, #1e293b 100%) !important;
}

.auth-brand-wrap {
    max-width: 590px !important;
}

.auth-logo-mark {
    border-radius: 20px !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22) !important;
}

.auth-brand-panel h1 {
    letter-spacing: -0.04em !important;
}

.auth-brand-copy {
    color: rgba(255, 255, 255, 0.78) !important;
}

.auth-feature-item {
    border-color: rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.055) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.auth-feature-dot {
    background: linear-gradient(135deg, #38bdf8, #2563eb) !important;
}

.auth-card {
    border-radius: 26px !important;
    border: 1px solid rgba(203, 213, 225, 0.95) !important;
    box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.8) inset !important;
}

.auth-card-header h2 {
    letter-spacing: -0.035em !important;
}

.auth-input {
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
}

.auth-input:hover {
    border-color: #b6c4d8 !important;
}

.auth-input:focus {
    background: #ffffff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13) !important;
}

.auth-submit {
    background: linear-gradient(135deg, #020617 0%, #111827 58%, #1e293b 100%) !important;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.22) !important;
}

.auth-submit:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.26) !important;
}

/* Mobile: solo formulario, sin panel comercial */
@media (max-width: 980px) {
    .auth-brand-panel {
        display: none !important;
    }

    .auth-body {
        background:
            radial-gradient(circle at top, rgba(37, 99, 235, 0.09), transparent 34%),
            linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
    }

    .auth-shell {
        min-height: 100vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 18px !important;
    }

    .auth-form-panel {
        width: 100% !important;
        min-height: 100vh !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .auth-card {
        width: 100% !important;
        max-width: 440px !important;
        border-radius: 24px !important;
        padding: 32px 28px !important;
        box-shadow: 0 22px 60px rgba(15, 23, 42, 0.13) !important;
    }

    .auth-card-header {
        text-align: left !important;
        margin-bottom: 24px !important;
    }

    .auth-card-header h2 {
        font-size: 1.85rem !important;
    }

    .auth-card-header p:last-child {
        font-size: 0.96rem !important;
    }
}

@media (max-width: 520px) {
    .auth-shell {
        padding: 14px !important;
    }

    .auth-card {
        padding: 28px 22px !important;
        border-radius: 22px !important;
    }

    .auth-eyebrow {
        font-size: 0.72rem !important;
        letter-spacing: 0.13em !important;
    }

    .auth-card-header h2 {
        font-size: 1.7rem !important;
    }

    .auth-field label {
        font-size: 0.9rem !important;
    }

    .auth-input,
    .auth-submit {
        height: 50px !important;
        border-radius: 13px !important;
    }

    .auth-card-footer p {
        font-size: 0.82rem !important;
    }
}


/* Inputs monetarios en rendici?n conductor */
.driver-payment-box .js-clp-money-input {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}


/* Picking PRO: progreso compacto y mobile limpio */
.prepare-progress-box,
.prepare-progress-card,
.prepare-hero-progress,
.picking-progress-box,
.picking-progress-card,
.driver-load-progress-box,
.driver-load-progress-box-large {
    border-radius: 18px;
}

.prepare-progress-box strong,
.prepare-progress-card strong,
.prepare-hero-progress strong,
.picking-progress-box strong,
.picking-progress-card strong,
.driver-load-progress-box strong,
.driver-load-progress-box-large strong {
    font-size: 1.35rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.04em !important;
    white-space: nowrap !important;
}

.prepare-progress-box strong span,
.prepare-progress-card strong span,
.prepare-hero-progress strong span,
.picking-progress-box strong span,
.picking-progress-card strong span,
.driver-load-progress-box strong span,
.driver-load-progress-box-large strong span {
    font-size: inherit !important;
    line-height: inherit !important;
}

.prepare-progress-box strong,
.prepare-progress-card strong,
.prepare-hero-progress strong,
.picking-progress-box strong,
.picking-progress-card strong {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 4px !important;
}

@media (max-width: 768px) {
    /* Evita que el contador 0 / 1 se coma el m?vil */
    .prepare-progress-box,
    .prepare-progress-card,
    .prepare-hero-progress,
    .picking-progress-box,
    .picking-progress-card {
        padding: 16px !important;
    }

    .prepare-progress-box strong,
    .prepare-progress-card strong,
    .prepare-hero-progress strong,
    .picking-progress-box strong,
    .picking-progress-card strong,
    .driver-load-progress-box strong,
    .driver-load-progress-box-large strong {
        font-size: 1.15rem !important;
    }

    /* Si el avance superior existe, se vuelve secundario */
    .driver-delivery-hero .prepare-progress-box,
    .driver-delivery-hero .prepare-progress-card,
    .driver-delivery-hero .prepare-hero-progress,
    .driver-delivery-hero .picking-progress-box,
    .driver-delivery-hero .picking-progress-card {
        display: none !important;
    }
}


/* Warehouse picking: scanner progress compacto */
.warehouse-progress-box strong {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 5px !important;
    font-size: 1.25rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
}

.warehouse-progress-box strong span {
    font-size: inherit !important;
    line-height: inherit !important;
}

@media (max-width: 768px) {
    .warehouse-prepare-status {
        grid-template-columns: 1fr !important;
    }

    .warehouse-progress-box {
        padding: 16px !important;
    }

    .warehouse-progress-box strong {
        font-size: 1.08rem !important;
    }
}


/* Tracking cliente / WhatsApp manual */
.erp-public-tracking-panel .erp-copy-box {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    padding: 16px;
    background: #f8fafc;
}

.erp-public-tracking-panel input[readonly] {
    background: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
}


/* Tracking cliente: copy box */
.erp-public-tracking-panel .erp-copy-box textarea[readonly] {
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    resize: vertical;
}


/* Bloque 15: cola pro conductor */
.driver-route-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.driver-route-summary article {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.driver-route-summary span {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.driver-route-summary strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.driver-route-summary small {
    color: #64748b;
}

.driver-route-list {
    display: grid;
    gap: 16px;
}

.driver-route-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 22px;
    background: #ffffff;
}

.driver-route-card.active {
    border-color: rgba(37, 99, 235, 0.24);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.driver-route-number {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
    font-size: 1.05rem;
}

.driver-route-top,
.driver-available-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.driver-route-top h3,
.driver-available-top h3 {
    margin: 4px 0 2px;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.driver-route-top p,
.driver-available-top p {
    margin: 0;
    color: #64748b;
}

.driver-route-label {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.driver-route-label.warning {
    background: #fff7ed;
    color: #c2410c;
}

.driver-route-label.success {
    background: #ecfdf5;
    color: #15803d;
}

.driver-route-address {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    margin-bottom: 14px;
}

.driver-route-address.compact {
    margin-bottom: 12px;
}

.driver-route-address span,
.driver-route-progress span,
.driver-route-meta span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 4px;
}

.driver-route-address strong {
    display: block;
    color: #0f172a;
}

.driver-route-address small {
    display: block;
    color: #64748b;
    margin-top: 2px;
}

.driver-route-progress {
    margin-bottom: 14px;
}

.driver-route-progress > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.driver-route-progress progress {
    width: 100%;
    height: 10px;
    accent-color: #1d4ed8;
}

.driver-route-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.driver-route-meta > div {
    padding: 12px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.driver-route-meta strong {
    display: block;
    color: #0f172a;
}

.driver-route-meta small {
    color: #64748b;
}

.driver-route-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.driver-route-actions .btn,
.driver-take-form .btn {
    min-width: 140px;
}

.driver-take-form {
    margin: 0;
}

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

.driver-available-card {
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 22px;
    background: #ffffff;
}

@media (max-width: 900px) {
    .driver-route-summary,
    .driver-available-grid {
        grid-template-columns: 1fr;
    }

    .driver-route-card {
        grid-template-columns: 1fr;
    }

    .driver-route-number {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }

    .driver-route-meta {
        grid-template-columns: 1fr;
    }

    .driver-route-actions .btn,
    .driver-take-form,
    .driver-take-form .btn {
        width: 100%;
    }
}


.driver-route-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(37, 99, 235, 0.20);
    border-radius: 18px;
    background: #eff6ff;
}

.driver-route-control-bar strong {
    display: block;
    color: #0f172a;
    font-weight: 900;
}

.driver-route-control-bar span {
    display: block;
    color: #475569;
    font-size: 0.9rem;
    margin-top: 2px;
}

.driver-route-control-bar form {
    margin: 0;
}

@media (max-width: 760px) {
    .driver-route-control-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .driver-route-control-bar .btn {
        width: 100%;
    }
}


.driver-route-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.driver-route-control-bar .driver-route-stats span {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.18);
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 800;
    margin: 0;
}


/* Fase 3: admin rutas */
.route-admin-date-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.route-admin-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.route-admin-summary article,
.route-admin-driver-card,
.route-admin-ready-card {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.route-admin-summary span,
.route-admin-label {
    display: block;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.route-admin-summary strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.route-admin-summary small {
    color: #64748b;
}

.route-admin-driver-list {
    display: grid;
    gap: 16px;
}

.route-admin-driver-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.route-admin-driver-head h3 {
    margin: 4px 0 2px;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.route-admin-driver-head p {
    margin: 0;
    color: #64748b;
}

.route-admin-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.route-admin-status.success {
    background: #ecfdf5;
    color: #15803d;
}

.route-admin-status.warning {
    background: #fff7ed;
    color: #c2410c;
}

.route-admin-route-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.route-admin-route-stats span {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 800;
}

.route-admin-orders,
.route-admin-stops {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    margin-top: 12px;
}

.route-admin-orders h4,
.route-admin-stops h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 900;
}

.route-admin-order-row,
.route-admin-stop-row {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.20);
}

.route-admin-order-row:last-child,
.route-admin-stop-row:last-child {
    border-bottom: 0;
}

.route-admin-order-row strong,
.route-admin-stop-row strong {
    color: #0f172a;
}

.route-admin-order-row span,
.route-admin-stop-row span,
.route-admin-stop-row small {
    display: block;
    color: #64748b;
}

.route-admin-stop-row {
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
}

.route-admin-stop-number {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #1d4ed8;
    color: #fff;
    font-weight: 900;
}

.route-admin-actions {
    margin: 14px 0 0;
    display: flex;
    justify-content: flex-end;
}

.route-admin-ready-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.route-admin-ready-card {
    display: grid;
    gap: 4px;
}

.route-admin-ready-card span,
.route-admin-ready-card small {
    color: #64748b;
}

@media (max-width: 900px) {
    .route-admin-summary,
    .route-admin-ready-grid {
        grid-template-columns: 1fr;
    }

    .route-admin-date-form,
    .route-admin-driver-head,
    .route-admin-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .route-admin-actions .btn {
        width: 100%;
    }
}


.route-admin-stop-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.route-admin-stop-metrics span {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
}


/* Fase 3.1: planificacion futura rutas */
.route-admin-planning-form {
    display: grid;
    gap: 14px;
}

.route-admin-plan-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto;
    gap: 12px;
    align-items: end;
}

.route-admin-plan-controls label {
    display: grid;
    gap: 6px;
}

.route-admin-plan-controls label span {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.route-admin-selectable-card {
    cursor: pointer;
    transition: 0.18s ease;
}

.route-admin-selectable-card:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.35);
}

.route-admin-selectable-card input {
    width: 18px;
    height: 18px;
}

.route-admin-order-badges,
.route-admin-stop-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.route-admin-order-badges span,
.route-admin-stop-metrics span {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
}

.tracking-planned-delivery {
    max-width: 860px;
    margin: 0 auto 18px;
    padding: 16px 18px;
    border-radius: 20px;
    background: #eff6ff;
    border: 1px solid rgba(37, 99, 235, 0.20);
    color: #1e3a8a;
}

.tracking-planned-delivery span {
    display: block;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tracking-planned-delivery strong {
    display: block;
    margin-top: 4px;
    font-size: 1.35rem;
    font-weight: 900;
}

.tracking-planned-delivery p {
    margin: 6px 0 0;
    color: #1e40af;
}

@media (max-width: 900px) {
    .route-admin-plan-controls {
        grid-template-columns: 1fr;
    }

    .route-admin-plan-controls .btn {
        width: 100%;
    }
}




/* Tracking publico: entrega programada */
.tracking-planned-delivery {
    max-width: 920px;
    margin: 18px auto;
    padding: 18px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    border-radius: 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid rgba(37, 99, 235, 0.22);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.tracking-planned-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 1.25rem;
}

.tracking-planned-delivery span {
    display: block;
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tracking-planned-delivery strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 950;
}

.tracking-planned-delivery p {
    margin: 6px 0 0;
    color: #475569;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .tracking-planned-delivery {
        grid-template-columns: 1fr;
        text-align: left;
        margin: 16px 0;
    }
}


/* Fix senior: tracking entrega programada */
.tracking-planned-delivery {
    max-width: 920px;
    margin: 20px auto;
    padding: 18px;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

.tracking-planned-date {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.24);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tracking-planned-date span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tracking-planned-date strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 950;
}

.tracking-planned-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tracking-planned-copy h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 950;
}

.tracking-planned-copy p {
    margin: 6px 0 0;
    color: #475569;
    line-height: 1.5;
}

.tracking-planned-icon {
    display: none !important;
}

@media (max-width: 720px) {
    .tracking-planned-delivery {
        grid-template-columns: 1fr;
        margin: 16px 0;
    }
}


/* Fase 3.2: conductor inicia ruta planificada */
.driver-planned-route-section {
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.driver-route-card.planned {
    border-color: rgba(37, 99, 235, 0.20);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.driver-route-label.info {
    background: #eff6ff;
    color: #1d4ed8;
}

.driver-route-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.driver-route-actions-inline form {
    margin: 0;
}

@media (max-width: 720px) {
    .driver-route-actions-inline {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-route-actions-inline .btn {
        width: 100%;
    }
}


/* Fase 3.3: ejecucion por parada */
.driver-current-stop-panel {
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.driver-current-stop-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.driver-current-stop-grid > div {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.20);
}

.driver-current-stop-grid span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.driver-current-stop-grid strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-weight: 950;
}

.driver-current-stop-grid small {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

.driver-current-stop-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.driver-current-stop-actions form {
    margin: 0;
}

.driver-current-stop-ok {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #166534;
    font-weight: 800;
}

@media (max-width: 900px) {
    .driver-current-stop-grid {
        grid-template-columns: 1fr;
    }

    .driver-current-stop-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-current-stop-actions .btn {
        width: 100%;
    }
}


/* UX conductor mobile senior */
.driver-route-summary {
    align-items: stretch;
}

.driver-route-summary article {
    border-radius: 20px;
}

.driver-route-card {
    overflow: hidden;
}

.driver-route-card.active,
.driver-route-card.planned {
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.driver-route-number {
    font-weight: 950;
}

.driver-route-top {
    gap: 12px;
    align-items: flex-start;
}

.driver-route-top h3 {
    margin-top: 6px;
    font-size: 1.18rem;
    font-weight: 950;
}

.driver-route-top p {
    margin-bottom: 0;
    color: #64748b;
    font-weight: 700;
}

.driver-route-address {
    margin-top: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.20);
}

.driver-route-progress {
    margin-top: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.20);
}

.driver-route-progress progress {
    width: 100%;
    height: 10px;
}

.driver-route-meta {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.driver-route-meta > div {
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.driver-route-meta span,
.driver-delivery-hero span,
.driver-current-stop-grid span {
    color: #64748b;
    font-size: 0.70rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.driver-route-meta strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-weight: 900;
}

.driver-route-card .btn,
.driver-delivery-action-panel .btn,
.driver-current-stop-actions .btn {
    min-height: 44px;
    border-radius: 14px;
    font-weight: 850;
}

/* Detalle entrega */
.driver-delivery-hero {
    gap: 12px;
}

.driver-delivery-hero > div {
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.driver-current-stop-panel {
    border-radius: 24px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

.driver-stop-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.driver-stop-head h2 {
    margin: 6px 0 4px;
    font-size: 1.2rem;
    font-weight: 950;
    color: #0f172a;
}

.driver-stop-head p {
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.driver-stop-status {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.driver-stop-status.status-arrived,
.driver-stop-status.status-completed {
    background: #ecfdf5;
    color: #166534;
}

.driver-current-stop-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.driver-current-stop-grid > div {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.20);
}

.driver-current-stop-grid strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-weight: 950;
}

.driver-current-stop-grid small {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

.driver-current-stop-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.driver-current-stop-actions form {
    margin: 0;
}

.driver-current-stop-ok {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 13px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #166534;
    font-weight: 850;
}

/* Cierre entrega / evidencia */
.driver-delivery-action-panel {
    border-radius: 24px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

.driver-load-status {
    border-radius: 18px;
    padding: 13px 14px;
    font-weight: 800;
}

.driver-evidence-form {
    display: grid;
    gap: 16px;
}

.driver-evidence-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 16px;
    align-items: start;
}

.driver-evidence-upload-box,
.driver-evidence-form fieldset,
.driver-evidence-form .form-section,
.driver-evidence-form .card,
.driver-evidence-form .preview-box {
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 16px;
}

.driver-evidence-form label,
.driver-evidence-form .form-label {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 900;
}

.driver-evidence-form input,
.driver-evidence-form select,
.driver-evidence-form textarea {
    border-radius: 14px;
    min-height: 42px;
}

.driver-evidence-form textarea {
    min-height: 92px;
}

.mobile-evidence-actions .btn {
    border-radius: 14px;
    min-height: 44px;
}

@media (max-width: 820px) {
    .driver-route-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .driver-route-summary article {
        padding: 12px;
    }

    .driver-route-summary article strong {
        font-size: 1.15rem;
    }

    .driver-route-summary article small {
        font-size: 0.72rem;
    }

    .driver-route-card {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .driver-route-number {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .driver-route-top {
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-route-meta {
        grid-template-columns: 1fr;
    }

    .driver-delivery-hero {
        grid-template-columns: 1fr 1fr;
    }

    .driver-current-stop-grid {
        grid-template-columns: 1fr;
    }

    .driver-stop-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-current-stop-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-current-stop-actions .btn {
        width: 100%;
    }

    .driver-evidence-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .driver-route-summary {
        grid-template-columns: 1fr;
    }

    .driver-delivery-hero {
        grid-template-columns: 1fr;
    }
}




/* Fix conductor: parada trazable compacta */
.driver-stop-box {
    border-radius: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

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

.driver-stop-box-head h2 {
    margin: 5px 0 3px;
    color: var(--text);
    font-size: 20px;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.driver-stop-box-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.driver-stop-state {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.driver-stop-state.state-arrived,
.driver-stop-state.state-completed {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.driver-stop-destination {
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--border-soft);
    margin-bottom: 12px;
}

.driver-stop-destination span,
.driver-stop-metrics span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.driver-stop-destination strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 900;
}

.driver-stop-destination small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.driver-stop-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.driver-stop-metrics > div {
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--border-soft);
}

.driver-stop-metrics strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
}

.driver-stop-metrics small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.driver-stop-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.driver-stop-actions form {
    margin: 0;
}

.driver-stop-actions .btn {
    width: 100%;
    min-height: 42px;
    border-radius: 12px !important;
    font-weight: 900;
}

.driver-stop-ok {
    grid-column: 1 / -1;
    display: inline-flex;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-size: 12px;
    font-weight: 950;
}

@media (max-width: 640px) {
    .driver-stop-box {
        padding: 14px;
    }

    .driver-stop-box-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .driver-stop-state {
        width: fit-content;
    }

    .driver-stop-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .driver-stop-metrics > div:last-child {
        grid-column: 1 / -1;
    }

    .driver-stop-actions {
        grid-template-columns: 1fr;
    }
}


/* Bloque 15.4: seguimiento admin rutas */
.route-admin-progress-box {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.route-admin-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.route-admin-progress-head span,
.route-admin-progress-grid span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.route-admin-progress-head strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 950;
}

.route-admin-progress-head small {
    color: #64748b;
    font-weight: 800;
}

.route-admin-progress-box progress {
    width: 100%;
    height: 10px;
    accent-color: #1d4ed8;
}

.route-admin-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.route-admin-progress-grid > div {
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.route-admin-progress-grid strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 950;
}

.route-admin-stop-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.route-admin-stop-status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    white-space: nowrap;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    border: 1px solid transparent;
}

.route-admin-stop-status.status-pending {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.route-admin-stop-status.status-next {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.route-admin-stop-status.status-arrived {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.route-admin-stop-status.status-completed {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.route-admin-stop-status.status-skipped {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

@media (max-width: 760px) {
    .route-admin-progress-head,
    .route-admin-stop-main {
        display: grid;
        grid-template-columns: 1fr;
    }

    .route-admin-progress-grid {
        grid-template-columns: 1fr;
    }
}


/* Bloque 15.5: incidencias de entrega */
.driver-issue-box {
    margin-top: 12px;
    border-radius: 14px;
    border: 1px solid #fecaca;
    background: #fff7f7;
    padding: 12px;
}

.driver-issue-box summary {
    cursor: pointer;
    color: #991b1b;
    font-size: 13px;
    font-weight: 950;
}

.driver-issue-box form {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.driver-issue-reported {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.driver-issue-reported strong {
    display: block;
    color: #9a3412;
    font-weight: 950;
}

.driver-issue-reported span {
    display: block;
    margin-top: 3px;
    color: #9a3412;
}

.route-admin-stop-issue {
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.route-admin-stop-issue strong {
    display: block;
    color: #9a3412;
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.route-admin-stop-issue span {
    display: block;
    margin-top: 3px;
    color: #9a3412;
}


/* Bloque 16: cuentas por cobrar */
.ar-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ar-summary-grid article,
.ar-customer-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.ar-summary-grid span,
.ar-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ar-summary-grid strong {
    display: block;
    margin-top: 7px;
    color: var(--text);
    font-size: 26px;
    line-height: 1;
    font-weight: 950;
}

.ar-summary-grid small,
.ar-customer-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.ar-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(160px, 0.8fr) 150px 150px auto;
    gap: 12px;
    align-items: end;
}

.ar-filter-actions {
    align-items: end;
}

.ar-customer-list {
    display: grid;
    gap: 12px;
}

.ar-customer-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 120px 170px 170px;
    gap: 12px;
    align-items: center;
}

.ar-customer-card strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-weight: 950;
}

.ar-balance-cell strong {
    color: #991b1b;
}

@media (max-width: 1050px) {
    .ar-summary-grid,
    .ar-filter-form,
    .ar-customer-card {
        grid-template-columns: 1fr;
    }

    .ar-filter-actions .btn {
        width: 100%;
    }
}


/* Refinamiento senior: gestion de cobranza */
.ar-balance-cell {
    padding: 12px;
    border-radius: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.ar-balance-cell strong {
    color: #9a3412;
}

.ar-summary-grid article:first-child {
    border-color: rgba(154, 52, 18, 0.22);
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
}

.ar-summary-grid article:first-child strong {
    color: #9a3412;
}


/* Bloque 16.1: gestion de cobranza */
.ar-payment-action {
    min-width: 190px;
}

.ar-payment-action summary {
    cursor: pointer;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 950;
}

.ar-payment-action form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.ar-payment-action label {
    display: grid;
    gap: 5px;
}

.ar-payment-action label span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* Bloque 16.1 UX senior: cobranza accionable */
.ar-summary-executive {
    align-items: stretch;
}

.ar-summary-primary {
    border-color: rgba(154, 52, 18, 0.28) !important;
    background: linear-gradient(135deg, #fff 0%, #fff7ed 100%) !important;
}

.ar-summary-primary strong {
    color: #9a3412 !important;
}

.ar-info-strip {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.88rem;
}

.ar-info-strip strong {
    color: var(--text);
    font-weight: 950;
}

.ar-client-row {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ar-client-row:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.ar-client-main strong {
    font-size: 1rem;
}

.ar-table th {
    white-space: nowrap;
}

.ar-table td {
    vertical-align: top;
}

.ar-driver-small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.78rem;
}

.ar-pending-amount {
    color: #9a3412;
    font-weight: 950;
}

.ar-action-col {
    width: 210px;
}

.ar-action-cell {
    min-width: 210px;
}

.ar-payment-action {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 8px 10px;
}

.ar-payment-action summary {
    cursor: pointer;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 950;
    list-style: none;
}

.ar-payment-action summary::-webkit-details-marker {
    display: none;
}

.ar-payment-action summary::after {
    content: " +";
    color: #9a3412;
    font-weight: 950;
}

.ar-payment-action[open] summary::after {
    content: " -";
}

.ar-payment-action form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.ar-payment-action label {
    display: grid;
    gap: 5px;
}

.ar-payment-action label span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 900px) {
    .ar-info-strip {
        display: grid;
    }

    .ar-action-col,
    .ar-action-cell {
        width: auto;
        min-width: 180px;
    }
}


/* Bloque 16.2: ficha financiera cliente */
.customer-financial-header {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.customer-financial-header h2 {
    margin: 6px 0 0;
    font-size: 1.45rem;
    font-weight: 950;
}

.customer-financial-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.customer-financial-meta span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.customer-financial-address {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.customer-financial-address strong,
.customer-financial-address small {
    display: block;
    margin-top: 4px;
}

.customer-financial-summary {
    margin-bottom: 18px;
}

.customer-risk-balance {
    color: #9a3412 !important;
}

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

.customer-financial-events,
.customer-financial-orders {
    display: grid;
    gap: 10px;
}

.customer-financial-event,
.customer-financial-order-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    text-decoration: none;
}

.customer-financial-event strong,
.customer-financial-order-row strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

.customer-financial-event span,
.customer-financial-event small,
.customer-financial-order-row small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.customer-financial-order-row:hover {
    border-color: rgba(15, 23, 42, 0.25);
    box-shadow: var(--shadow-sm);
}

.empty-state.compact {
    padding: 22px;
}

@media (max-width: 950px) {
    .customer-financial-header,
    .customer-financial-grid {
        grid-template-columns: 1fr;
    }

    .customer-financial-event,
    .customer-financial-order-row {
        display: grid;
    }
}


/* Bloque 16.3: exportacion y periodos cobranza */
.ar-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ar-period-buttons .btn {
    border-radius: 999px;
    font-weight: 900;
}

.ar-period-buttons .btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

@media (max-width: 700px) {
    .ar-period-buttons .btn {
        width: 100%;
    }
}


/* Bloque 16.3 UX: periodo y exportacion cobranza */
.ar-export-panel {
    overflow: hidden;
}

.ar-period-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.ar-section-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.ar-period-main {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.ar-export-card {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    border: 1px solid rgba(154, 52, 18, 0.22);
}

.ar-export-card span {
    display: block;
    color: #9a3412;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.ar-export-card strong {
    display: block;
    margin-top: 5px;
    color: var(--text);
    font-weight: 950;
}

.ar-export-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.35;
}

.ar-filter-form-senior {
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.ar-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ar-period-buttons .btn {
    border-radius: 999px;
    font-weight: 900;
}

.ar-period-buttons .btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

@media (max-width: 950px) {
    .ar-period-layout,
    .ar-filter-form-senior {
        grid-template-columns: 1fr;
    }

    .ar-period-buttons .btn,
    .ar-filter-actions .btn {
        width: 100%;
    }
}


/* Bloque 16.3: centro de reportes ERP ordenado */
.erp-report-section-list {
    display: grid;
    gap: 18px;
}

.erp-report-section {
    display: grid;
    gap: 12px;
}

.erp-report-section-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.erp-report-section-header span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.erp-report-section-header h2 {
    margin: 3px 0 0;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
}

.erp-report-card-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.erp-report-priority {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}


/* Bloque 16.3 fix: prioridad consistente en reportes */
.erp-report-priority.priority-alta {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.erp-report-priority.priority-media {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.erp-report-card:has(.priority-alta) {
    border-color: rgba(154, 52, 18, 0.16);
}


/* Bloque 16.4: informe imprimible cartera cobranza */
.print-only {
    display: none;
}

.btn-print-report {
    white-space: nowrap;
}

.print-report-cover {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #111827;
}

.print-report-cover span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.print-report-cover h1 {
    margin: 5px 0 0;
    color: #111827;
    font-size: 26px;
    font-weight: 950;
}

.print-report-cover p {
    margin: 5px 0 0;
    color: #334155;
}

.print-report-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.print-report-meta div {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    padding: 10px;
}

.print-report-meta strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 950;
}

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    body {
        background: #ffffff !important;
        color: #111827 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-only {
        display: block !important;
    }

    .sidebar,
    .erp-sidebar,
    .app-sidebar,
    .navbar,
    .topbar,
    .messages,
    .toast,
    .erp-page-actions,
    .erp-hero-actions,
    .ar-export-panel,
    .btn,
    button,
    nav,
    aside {
        display: none !important;
    }

    .main,
    .content,
    .main-content,
    .page-content,
    .erp-content,
    .container,
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .erp-page-header {
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid #d1d5db !important;
    }

    .erp-title-block .erp-eyebrow,
    .erp-title-block p {
        display: none !important;
    }

    .erp-title-block h1 {
        font-size: 20px !important;
    }

    .ar-summary-grid,
    .ar-summary-executive {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .ar-summary-grid article,
    .panel,
    .ar-customer-card {
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .ar-summary-grid article {
        padding: 10px !important;
    }

    .ar-summary-grid article span,
    .ar-label,
    .panel-header p,
    .badge-soft,
    .ar-driver-small,
    small {
        font-size: 9px !important;
    }

    .ar-summary-grid article strong {
        font-size: 16px !important;
    }

    .panel {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    .panel-header {
        margin-bottom: 8px !important;
    }

    .panel-header h2 {
        font-size: 15px !important;
    }

    .ar-customer-list {
        display: grid !important;
        gap: 8px !important;
    }

    .ar-customer-card {
        grid-template-columns: 1.4fr 0.8fr 1fr 1fr !important;
        padding: 9px !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .ar-table {
        width: 100% !important;
        font-size: 9px !important;
        border-collapse: collapse !important;
    }

    .ar-table th,
    .ar-table td {
        padding: 5px !important;
        border-bottom: 1px solid #e5e7eb !important;
        vertical-align: top !important;
    }

    .ar-table th {
        color: #111827 !important;
        background: #f8fafc !important;
    }

    a {
        color: #111827 !important;
        text-decoration: none !important;
    }

    .status-pill,
    .code-pill,
    .badge-soft {
        border: 1px solid #d1d5db !important;
        background: #ffffff !important;
        color: #111827 !important;
    }

    .empty-state {
        border: 1px dashed #d1d5db !important;
        padding: 16px !important;
    }
}


/* Bloque 16.4 UX: reporte cobranza ejecutivo */
.ar-report-export-hub {
    border-color: rgba(154, 52, 18, 0.18);
}

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

.ar-export-choice-card {
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    display: grid;
    gap: 10px;
    align-content: start;
}

.ar-export-choice-card.primary {
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    border-color: #fed7aa;
}

.ar-export-choice-card span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.ar-export-choice-card.primary span {
    color: #9a3412;
}

.ar-export-choice-card h3 {
    margin: 0;
    color: #111827;
    font-size: 1.1rem;
    font-weight: 950;
}

.ar-export-choice-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.4;
}

.ar-period-buttons-clean {
    margin-bottom: 0;
}

.ar-period-buttons-clean .btn {
    padding: 9px 14px;
}

@media (max-width: 850px) {
    .ar-export-choice-grid {
        grid-template-columns: 1fr;
    }
}


/* Bloque 16.4 UX final: reporte cobranza lineal */
.ar-report-flow,
.ar-export-simple-panel {
    border-color: #dbe3ef;
}

.ar-flow-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.ar-flow-header > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
}

.ar-flow-header h2 {
    margin: 0;
    color: #111827;
    font-size: 1.15rem;
    font-weight: 950;
}

.ar-flow-header p {
    grid-column: 2;
    margin: 2px 0 0;
    color: #64748b;
}

.ar-step-pill {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 950;
}

.ar-export-simple-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ar-export-simple-card {
    display: grid;
    gap: 5px;
    padding: 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    text-decoration: none;
    color: inherit;
}

.ar-export-simple-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

.ar-export-simple-card.primary {
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    border-color: #fed7aa;
}

.ar-export-simple-card span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.ar-export-simple-card.primary span {
    color: #9a3412;
}

.ar-export-simple-card strong {
    color: #111827;
    font-size: 1.05rem;
    font-weight: 950;
}

.ar-export-simple-card small {
    color: #64748b;
}

@media (max-width: 850px) {
    .ar-export-simple-grid {
        grid-template-columns: 1fr;
    }

    .ar-flow-header > div {
        grid-template-columns: 1fr;
    }

    .ar-flow-header p {
        grid-column: auto;
    }

    .ar-step-pill {
        margin-bottom: 8px;
    }
}


/* Bloque 16.5: antiguedad de deuda */
.ar-aging-panel {
    border-color: #dbe3ef;
}

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

.ar-aging-card {
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
}

.ar-aging-card span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.ar-aging-card strong {
    display: block;
    margin-top: 6px;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 950;
}

.ar-aging-card small {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

.ar-aging-card.ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ar-aging-card.watch {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.ar-aging-card.warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.ar-aging-card.danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.ar-age-pill {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid #dbe3ef;
    background: #ffffff;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 950;
    white-space: nowrap;
}

.ar-age-pill.ok {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.ar-age-pill.watch {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.ar-age-pill.warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.ar-age-pill.danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

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

@media (max-width: 650px) {
    .ar-aging-grid {
        grid-template-columns: 1fr;
    }
}


/* Bloque 16.5 UX: antiguedad compacta */
.ar-aging-strip {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: -4px 0 16px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.ar-aging-strip-title {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ar-aging-strip-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ar-aging-mini {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
}

.ar-aging-mini strong {
    color: #111827;
    font-weight: 950;
}

.ar-aging-mini span {
    font-weight: 950;
}

.ar-aging-mini small {
    color: #64748b;
    font-size: 0.72rem;
}

.ar-aging-mini.ok {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.ar-aging-mini.watch {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.ar-aging-mini.warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.ar-aging-mini.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

@media (max-width: 850px) {
    .ar-aging-strip {
        grid-template-columns: 1fr;
    }

    .ar-aging-strip-items {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ar-aging-mini {
        justify-content: space-between;
        width: 100%;
    }
}


/* Bloque 17.1: errores comerciales visibles */
.field-error {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.88rem;
    font-weight: 850;
    line-height: 1.35;
}

.field-error strong {
    color: #7f1d1d;
    font-weight: 950;
}

.field-error div {
    color: #991b1b;
}

.order-form-card .field-error,
.customer-form-card .field-error {
    display: block;
}

.order-form-card .form-text {
    display: block;
    margin-top: 6px;
}


/* Bloque 17.2: semaforo financiero clientes */
.roder-credit-mini {
    display: grid;
    gap: 5px;
    min-width: 135px;
}

.roder-credit-mini small {
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

.roder-credit-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.roder-credit-pill.ok {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

.roder-credit-pill.warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.roder-credit-pill.danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.customer-credit-control-panel {
    border-color: #dbe3ef;
}

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

.customer-credit-grid article {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
}

.customer-credit-grid span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.customer-credit-grid strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 18px;
    line-height: 1.05;
    font-weight: 950;
}

.customer-credit-grid small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.25;
}

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

@media (max-width: 720px) {
    .customer-credit-grid {
        grid-template-columns: 1fr;
    }
}


/* Bloque 17.2 UX: riesgo cliente profesional */
.roder-credit-cell {
    display: grid;
    gap: 6px;
    min-width: 150px;
}

.roder-credit-pill {
    gap: 6px;
}

.roder-credit-pill i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
}

.roder-credit-meta {
    display: grid;
    gap: 1px;
}

.roder-credit-meta strong {
    color: #111827;
    font-size: 13px;
    line-height: 1.1;
    font-weight: 950;
}

.roder-credit-meta small,
.roder-credit-meta span {
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 750;
}

.erp-customers-table td {
    vertical-align: middle;
}


/* Bloque 17.2 UX Defontana: estado comercial sobrio */
.roder-commercial-state {
    display: grid;
    gap: 5px;
    min-width: 145px;
}

.roder-commercial-state-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 950;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    color: #334155;
    white-space: nowrap;
}

.roder-commercial-state-pill.ok {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.roder-commercial-state-pill.warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.roder-commercial-state-pill.danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.roder-commercial-state small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 750;
}

.roder-commercial-state.danger small {
    color: #991b1b;
}

.erp-customers-table td {
    vertical-align: middle;
}


/* Bloque 17.2 definitivo: alerta discreta cliente */
.roder-client-alert {
    display: inline-flex;
    margin-left: 7px;
    transform: translateY(-1px);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.roder-client-alert.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.roder-client-alert.danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
