* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #172033;
}

.container {
    width: min(1180px, 94%);
    margin: 38px auto 70px;
}

.wide-container {
    width: min(1450px, 96%);
}

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

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

.subtitle,
.muted {
    color: #667085;
}

.subtitle {
    margin-top: -7px;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: #111827;
    color: white;
    text-decoration: none;
}

.btn.secondary {
    background: white;
    color: #172033;
    border: 1px solid #d0d5dd;
}

.scanner-main {
    font-size: 17px;
    padding: 14px 22px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 22px 0;
}

.cards-five {
    grid-template-columns: repeat(5, 1fr);
}

.card,
.panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.panel {
    margin-top: 18px;
}

.notice-panel {
    border-left: 5px solid #2563eb;
}

.numero {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.label {
    color: #667085;
    margin-top: 8px;
    font-size: 14px;
}

.progress-wrap {
    height: 16px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}

.progress {
    height: 100%;
    background: #16a34a;
    width: 0%;
    transition: width .25s ease;
}

.lot-progress {
    min-width: 280px;
}

.lot-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid #eef0f2;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.lot-title {
    font-weight: 800;
    font-size: 18px;
}

.lot-number {
    color: #98a2b3;
    font-size: 13px;
    font-weight: 600;
    margin-left: 7px;
}

.lot-meta {
    color: #667085;
    margin-top: 5px;
    font-size: 14px;
}

.load-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0;
}

.mode-card {
    display: block;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    background: white;
}

.mode-card.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.mode-card input {
    display: none;
}

.mode-card strong {
    display: block;
    font-size: 17px;
}

.mode-card span {
    display: block;
    margin-top: 6px;
    color: #667085;
    font-size: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(250px, 520px);
    gap: 12px;
    margin-top: 15px;
}

.form-grid label > span {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 7px;
}

.text-input,
.status-select,
.inline-input {
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    padding: 10px 11px;
    font-size: 14px;
    background: white;
}

.text-input {
    width: 100%;
    font-size: 16px;
}

.inline-input {
    width: 100%;
    min-width: 140px;
}

.status-select {
    min-width: 145px;
}

.drop-zone {
    margin-top: 22px;
    background: white;
    border: 2px dashed #98a2b3;
    border-radius: 18px;
    padding: 52px 25px;
    text-align: center;
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.drop-zone strong {
    display: block;
    font-size: 22px;
    margin-bottom: 8px;
}

.drop-zone span {
    color: #667085;
}

input[type=file] {
    display: none;
}

.actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.actions.compact {
    margin-top: 0;
}

button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.speed-note {
    color: #667085;
    font-size: 13px;
}

.upload-progress-box {
    margin-top: 20px;
    padding: 18px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.upload-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.upload-stats {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 12px;
    color: #475467;
}

.upload-list {
    margin-top: 18px;
    max-height: 420px;
    overflow-y: auto;
}

.upload-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 140px 1fr;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    margin-bottom: 7px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
}

.upload-file {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.row-ok {
    border-left: 5px solid #16a34a;
}

.row-dup {
    border-left: 5px solid #d97706;
}

.row-error {
    border-left: 5px solid #dc2626;
}

.result-success,
.result-error {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
}

.result-success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
}

.result-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.editable-title-row,
.part-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editable-title-row h1,
.part-title-row h2 {
    margin-bottom: 0;
}

.icon-btn {
    border: 1px solid #d0d5dd;
    background: white;
    color: #344054;
    border-radius: 9px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
}

.toolbar-panel {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    align-items: center;
}

.filters {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.toggle-line {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
}

.part-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid #eaecf0;
}

.part-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fafafa;
    border-bottom: 1px solid #eaecf0;
}

.part-header h2 {
    margin: 4px 0 6px;
}

.part-number {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #667085;
}

.part-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mini-progress {
    width: 130px;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.mini-progress-bar {
    height: 100%;
    background: #16a34a;
}

.part-table-wrap {
    padding: 8px 16px 16px;
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    color: #667085;
    font-size: 13px;
    padding: 10px 9px;
    border-bottom: 1px solid #e5e7eb;
}

.orders-table td {
    padding: 10px 9px;
    border-bottom: 1px solid #eef0f2;
    vertical-align: middle;
}

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

.pedido-completado {
    background: #ecfdf3;
    opacity: .68;
}

.pedido-completado .mono {
    text-decoration: line-through;
}

.pedido-faltante {
    background: #fff7ed;
}

.mono {
    font-family: Consolas, monospace;
    font-weight: 700;
}

.mini-btn {
    border: 1px solid #d0d5dd;
    background: white;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 700;
}

.empty {
    color: #667085;
    padding: 18px;
    text-align: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .52);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 18px;
}

.modal-card {
    width: min(500px, 95%);
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,.22);
}

.pdf-modal-card {
    width: min(1250px, 98vw);
    height: min(900px, 96vh);
    background: white;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.pdf-modal-head {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.pdf-frame {
    border: 0;
    width: 100%;
    flex: 1;
    background: #e5e7eb;
}

@media (max-width: 1000px) {
    .cards-five {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .toolbar-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .topbar,
    .part-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .load-mode {
        grid-template-columns: 1fr;
    }

    .part-actions {
        width: 100%;
        justify-content: space-between;
    }
}


.dashboard-cards {
    grid-template-columns: repeat(6, 1fr);
}

.metric-card {
    border: 2px solid transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

.metric-card:hover {
    border-color: #d0d5dd;
}

.metric-card.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.dashboard-filters {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) 1fr 1.4fr .7fr;
    gap: 14px;
    align-items: end;
}

.dashboard-filters label > span {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 7px;
}

.dashboard-meta {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 16px;
}

.table-panel {
    padding: 0;
    overflow: hidden;
}

.global-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 310px);
    min-height: 430px;
}

.global-orders-table {
    min-width: 1180px;
}

.global-orders-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 5;
}

.origin-main {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
}

.origin-main a {
    color: #172033;
}

.origin-sub,
.origin-date {
    color: #667085;
    font-size: 12px;
    margin-top: 4px;
}

.late-badge {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 999px;
}

.pedido-atrasado {
    background: #fef2f2;
}

.pagination {
    border-top: 1px solid #eaecf0;
    padding: 14px 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background: white;
}

@media (max-width: 1200px) {
    .dashboard-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-filters {
        grid-template-columns: 1fr;
    }

    .dashboard-meta {
        flex-direction: column;
    }
}


.lot-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 7px;
    border-radius: 999px;
    margin-left: 7px;
}

.lot-status.open {
    background: #dcfce7;
    color: #166534;
}

.lot-status.closed {
    background: #e5e7eb;
    color: #475467;
}

.station-panel {
    border-left: 5px solid #7c3aed;
}

.station-panel label > span,
.surtido-toolbar label > span,
.surtido-fields label > span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 7px;
}

.surtido-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) minmax(220px, 1fr) auto auto;
    gap: 14px;
    align-items: end;
}

.surtido-toggle {
    padding-bottom: 11px;
}

.surtido-meta {
    margin: 18px 0 10px;
    color: #667085;
    font-weight: 700;
}

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

.surtido-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
    transition: opacity .25s, transform .25s;
}

.surtido-card.has-missing {
    border-left: 6px solid #f59e0b;
}

.surtido-card.card-completing {
    opacity: .15;
    transform: scale(.98);
}

.surtido-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.surtido-guide {
    font-size: 20px;
}

.surtido-origin {
    margin-top: 6px;
    color: #667085;
    font-size: 13px;
}

.state-pill {
    display: inline-block;
    white-space: nowrap;
    padding: 6px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
}

.surtido-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.surtido-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.history-panel {
    margin-top: 26px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.history-list {
    margin-top: 12px;
    border-top: 1px solid #eaecf0;
}

.history-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 150px;
    gap: 16px;
    padding: 12px 4px;
    border-bottom: 1px solid #eaecf0;
    align-items: start;
}

.history-time,
.history-station {
    color: #667085;
    font-size: 12px;
}

.history-station {
    text-align: right;
    font-weight: 700;
}

.history-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.history-detail {
    flex-basis: 100%;
    color: #667085;
    font-size: 13px;
}

@media (max-width: 1000px) {
    .surtido-toolbar {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 700px) {
    .surtido-toolbar,
    .surtido-fields {
        grid-template-columns: 1fr;
    }

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

    .history-station {
        text-align: left;
    }

    .section-heading {
        flex-direction: column;
    }
}


/* Navegación global */
body {
    padding-top: 64px;
}

.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 3%;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #e5e7eb;
    backdrop-filter: blur(12px);
}

.brand-link {
    color: #111827;
    text-decoration: none;
    font-size: 18px;
    font-weight: 900;
}

.global-nav-links {
    display: flex;
    gap: 8px;
}

.global-nav-links a {
    color: #475467;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 9px 12px;
    border-radius: 9px;
}

.global-nav-links a:hover {
    background: #f2f4f7;
    color: #111827;
}

/* Home */
.home-container {
    width: min(1200px, 94%);
}

.home-hero {
    padding: 38px 0 12px;
}

.home-hero h1 {
    font-size: clamp(38px, 6vw, 68px);
    margin-bottom: 10px;
}

.home-hero p {
    font-size: 20px;
    color: #667085;
}

.eyebrow {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    color: #667085;
}

.home-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.home-action-card {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0,1fr) 30px;
    align-items: center;
    gap: 18px;
    min-height: 150px;
    padding: 25px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
    color: #172033;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform .15s, border-color .15s;
}

.home-action-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.home-card-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #eef2ff;
    font-size: 30px;
    font-weight: 900;
}

.scanner-home-card .home-card-icon {
    background: #ecfdf3;
}

.home-action-card h2 {
    margin: 0 0 7px;
    font-size: 22px;
}

.home-action-card p {
    margin: 0;
    color: #667085;
    line-height: 1.45;
}

.home-arrow {
    font-size: 26px;
    font-weight: 800;
}

.home-lots-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
    margin-top: 12px;
}

.home-lot-card {
    display: block;
    color: #172033;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    padding: 15px;
}

.home-lot-card:hover {
    background: #f8fafc;
}

.home-lot-title {
    font-weight: 800;
}

.home-lot-meta,
.home-lot-user {
    color: #667085;
    font-size: 12px;
    margin-top: 6px;
}

/* Operador */
.operator-modal {
    z-index: 2500;
}

.operator-card {
    width: min(480px, 96%);
}

.operator-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #eef2ff;
    font-size: 28px;
    margin-bottom: 15px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin: 15px 0 7px;
}

.operator-or {
    text-align: center;
    color: #98a2b3;
    font-size: 12px;
    font-weight: 700;
    margin: 14px 0 3px;
}

.operator-confirm {
    width: 100%;
    margin-top: 18px;
}

.form-error {
    min-height: 20px;
    color: #b42318;
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

.operator-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 7px 8px 7px 14px;
}

.operator-pill > span {
    color: #667085;
    font-size: 12px;
}

/* Visor operativo */
.order-workspace {
    width: min(1500px, 98vw);
    height: min(920px, 96vh);
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(340px, .65fr);
    overflow: hidden;
    border-radius: 18px;
    background: white;
    box-shadow: 0 26px 80px rgba(0,0,0,.28);
}

.order-pdf-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #e5e7eb;
}

.workspace-head {
    min-height: 66px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.order-control-panel {
    padding: 22px;
    overflow-y: auto;
    border-left: 1px solid #e5e7eb;
}

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

.control-panel-head h2 {
    margin-top: 4px;
    font-size: 22px;
}

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.order-info-grid > div {
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}

.order-info-grid span {
    display: block;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
}

.control-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 20px 0;
}

.control-field {
    display: block;
    margin-bottom: 14px;
}

.control-field > span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 7px;
}

.text-area {
    width: 100%;
    resize: vertical;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 10px 11px;
    font: inherit;
}

.workspace-actions {
    display: grid;
    gap: 9px;
    margin-top: 18px;
}

.success-btn {
    background: #15803d;
}

.plain-action {
    border: 0;
    background: transparent;
    color: #667085;
    padding: 10px;
    cursor: pointer;
    font-weight: 700;
}

.print-note {
    margin-top: 18px;
    color: #98a2b3;
    font-size: 11px;
    line-height: 1.45;
}

.responsibility-line {
    color: #667085;
    font-size: 12px;
    margin-top: 10px;
}

@media (max-width: 900px) {
    .home-menu-grid,
    .home-lots-grid {
        grid-template-columns: 1fr;
    }

    .global-nav-links {
        gap: 2px;
    }

    .global-nav-links a {
        font-size: 12px;
        padding: 8px 7px;
    }

    .order-workspace {
        grid-template-columns: 1fr;
        height: 97vh;
        overflow-y: auto;
    }

    .order-pdf-panel {
        min-height: 58vh;
    }

    .order-control-panel {
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }
}


/* Paso 9.2 — carga automática */
.optional-label {
    color: #98a2b3;
    font-weight: 600;
}

.field-help {
    display: block;
    color: #98a2b3;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 6px;
}

.auto-upload-instruction {
    margin-top: 20px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    font-weight: 700;
}

.auto-upload-note {
    color: #166534;
    font-size: 13px;
    font-weight: 800;
}

.auto-upload-fallback {
    display: none;
}

/* Faltantes múltiples */
.missing-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.missing-choice,
.missing-chip {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
}

.missing-choice {
    cursor: pointer;
    opacity: .62;
    transition: transform .12s, opacity .12s, box-shadow .12s;
}

.missing-choice:hover {
    transform: translateY(-1px);
    opacity: .9;
}

.missing-choice.selected {
    opacity: 1;
    box-shadow: 0 0 0 2px #111827;
}

.missing-custom-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 10px;
}

.missing-selected,
.missing-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.missing-selected {
    margin-top: 12px;
    min-height: 30px;
}

.missing-chip {
    cursor: default;
}

button.missing-chip.removable-missing {
    cursor: pointer;
}

.missing-chip span {
    margin-left: 5px;
    font-size: 14px;
}

.compact-chips {
    margin-bottom: 6px;
}

.missing-color-0 {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.missing-color-1 {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.missing-color-2 {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.missing-color-3 {
    background: #fce7f3;
    color: #9d174d;
    border-color: #fbcfe8;
}

.missing-color-4 {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.missing-color-5 {
    background: #cffafe;
    color: #155e75;
    border-color: #a5f3fc;
}

.missing-color-6 {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fed7aa;
}

.missing-color-7 {
    background: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

.surtido-summary-row {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.summary-label {
    display: block;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.order-note-preview {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475467;
    font-size: 13px;
}

.surtido-actions.single-action {
    margin-top: 16px;
}

.surtido-actions.single-action .btn {
    width: 100%;
    font-size: 16px;
    padding: 13px 16px;
}


/* Paso 9.3 */
.surtido-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.two-main-actions {
    grid-template-columns: 1fr 1fr;
    display: grid;
    gap: 10px;
}

.two-main-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
}

.pending-text-action {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: #475467;
    cursor: pointer;
    padding: 11px;
    margin-top: 5px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pending-text-action:hover {
    color: #111827;
}

.metadata-divider {
    margin-top: 18px;
}

.order-metadata {
    margin-top: 2px;
    color: #667085;
}

.order-metadata summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    user-select: none;
}

.metadata-grid {
    margin-top: 12px;
    opacity: .9;
}

.action-toast {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translate(-50%, -12px);
    z-index: 3500;
    min-width: min(420px, 88vw);
    max-width: 700px;
    padding: 12px 16px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
    text-align: center;
    font-weight: 800;
    box-shadow: 0 8px 28px rgba(0,0,0,.16);
    background: #f8fafc;
    color: #334155;
}

.action-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.action-toast.success {
    background: #dcfce7;
    color: #166534;
}

.action-toast.error {
    background: #fee2e2;
    color: #991b1b;
}

.action-toast.neutral {
    background: #e2e8f0;
    color: #334155;
}

/* Cualquier pedido pendiente con faltante u observación se resalta naranja. */
.surtido-card.has-missing {
    border-left: 7px solid #f59e0b;
    background: #fffaf0;
}

@media (max-width: 700px) {
    .two-main-actions {
        grid-template-columns: 1fr;
    }

    .surtido-top-actions {
        align-items: stretch;
    }
}


/* Paso 9.4 — filtro de pedidos por estado operativo */
.surtido-toolbar {
    grid-template-columns:
        minmax(260px, 1.6fr)
        minmax(190px, .8fr)
        minmax(150px, .65fr)
        auto
        auto;
}

.surtido-card.completed-order-card {
    background: #ecfdf3;
    border-color: #bbf7d0;
    border-left: 7px solid #16a34a;
}

.surtido-card.completed-order-card.has-missing {
    /* Si un pedido ya fue surtido, predomina visualmente el verde. */
    background: #ecfdf3;
    border-left-color: #16a34a;
}

.completed-responsibility {
    color: #166534;
}

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

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


/* Paso 9.5 — Dashboard global */
.dashboard-seven {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.general-progress-panel {
    padding: 20px 22px;
}

.progress-summary-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.progress-summary-head strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
}

.progress-percent {
    font-size: 26px !important;
}

.dashboard-main-progress {
    height: 20px;
    margin-top: 14px;
}

.scan-health-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.scan-health-badge,
.duplicate-health-badge {
    padding: 8px 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.scan-health-badge.all-scanned {
    background: #dcfce7;
    color: #166534;
}

.duplicate-health-badge.has-duplicates {
    background: #ffedd5;
    color: #9a3412;
}

.status-select.status-pending {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
    font-weight: 800;
}

.status-select.status-filled {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
    font-weight: 800;
}

.status-select.status-scanned {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
    font-weight: 800;
}

.pedido-surtido {
    background: #eff6ff;
}

.pedido-escaneado {
    background: #ecfdf3;
}

.scan-row-status {
    font-size: 12px;
    font-weight: 900;
}

.scan-row-status.ok {
    color: #166534;
}

.scan-row-status.pending {
    color: #64748b;
}

.scan-row-detail {
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
}

.duplicate-row-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #ffedd5;
    color: #9a3412;
    font-size: 10px;
    font-weight: 900;
}

@media (max-width: 1400px) {
    .dashboard-seven {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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


/* Paso 9.6 — duplicados como incidencias resolubles */
.duplicate-resolution-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
}

.resolve-duplicate-btn {
    border: 1px solid #fdba74;
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff7ed;
    color: #9a3412;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
}

.resolve-duplicate-btn:hover {
    background: #ffedd5;
}

.resolve-duplicate-btn:disabled {
    opacity: .55;
    cursor: wait;
}

.operational-filter option[value="DUPLICADO"] {
    color: #9a3412;
    font-weight: 800;
}


/* Paso 9.7 / 9.11 — pestaña actual */
.global-nav-links a.active {
    background: #111827;
    color: white;
}

.global-nav-links a.active:hover {
    background: #111827;
    color: white;
}

.operator-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    max-height: 300px;
    overflow-y: auto;
    padding: 2px;
    margin-top: 7px;
}

.operator-name-btn {
    min-height: 58px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: white;
    color: #172033;
    cursor: pointer;
    padding: 10px 12px;
    text-align: left;
    font-family: inherit;
    transition: border-color .12s, background .12s, transform .12s;
}

.operator-name-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
}

.operator-name-btn span {
    display: block;
    font-size: 15px;
    font-weight: 900;
}

.operator-name-btn small {
    display: block;
    margin-top: 4px;
    color: #2563eb;
    font-size: 10px;
    font-weight: 800;
}

.operator-name-btn.recent {
    border-color: #93c5fd;
    background: #eff6ff;
}

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

.operator-empty,
.operator-loading {
    grid-column: 1 / -1;
    padding: 15px;
    border-radius: 10px;
    background: #f8fafc;
    color: #667085;
    text-align: center;
    font-size: 13px;
}

.home-hero {
    padding-bottom: 22px;
}

@media (max-width: 600px) {
    .operator-buttons,
    .operator-new-row {
        grid-template-columns: 1fr;
    }
}


/* Paso 9.8 — períodos del Dashboard */
.dashboard-period-panel {
    border-left: 5px solid #2563eb;
}

.period-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.period-top-row > div:first-child {
    min-width: 210px;
}

.period-top-row strong {
    display: block;
    margin-top: 5px;
    font-size: 21px;
}

.period-dates-label {
    margin-top: 5px;
    font-size: 12px;
}

.period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.period-preset {
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    padding: 8px 11px;
    background: white;
    color: #344054;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.period-preset:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.period-preset.active {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}

.period-custom-grid {
    display: grid;
    grid-template-columns:
        minmax(180px, .9fr)
        auto
        minmax(160px, .7fr)
        minmax(160px, .7fr)
        auto;
    gap: 10px;
    align-items: end;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eaecf0;
}

.period-custom-grid label > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #475467;
}

.period-separator {
    align-self: center;
    padding-bottom: 2px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 1050px) {
    .period-top-row {
        flex-direction: column;
    }

    .period-presets {
        justify-content: flex-start;
    }

    .period-custom-grid {
        grid-template-columns: 1fr 1fr;
    }

    .period-separator {
        display: none;
    }
}

@media (max-width: 650px) {
    .period-custom-grid {
        grid-template-columns: 1fr;
    }

    .period-presets {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
}


/* Paso 9.10 — concurrencia + móvil */
.surtido-card.reserved-order-card {
    border-left: 7px solid #64748b;
    background: #f8fafc;
    opacity: .82;
}

.surtido-card.reserved-order-card.has-missing,
.surtido-card.reserved-order-card.completed-order-card {
    border-left-color: #64748b;
    background: #f8fafc;
}

.live-reservation-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
}

.workspace-reservation {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 14px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 11px;
}

.workspace-reservation strong {
    font-size: 12px;
}

.workspace-reservation small {
    width: 100%;
    color: #64748b;
}

@media (max-width: 700px) {
    .surtido-card .btn,
    .order-control-panel .btn,
    .order-control-panel .icon-btn,
    .missing-choice,
    .mini-btn {
        min-height: 46px;
    }

    .order-workspace {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .order-pdf-panel {
        min-height: 52vh;
    }

    .order-control-panel {
        padding: 16px;
    }

    .workspace-head {
        min-height: 58px;
    }

    .two-main-actions .btn {
        min-height: 54px;
        font-size: 17px;
    }

    .surtido-toolbar {
        gap: 12px;
    }

    .surtido-toolbar .text-input,
    .surtido-toolbar .btn {
        min-height: 48px;
        font-size: 16px;
    }
}


/* Paso 9.11 — selector limpio de mes */
.month-specific-select {
    cursor: pointer;
}


/* ==========================================================
   PASO 10.0 — IDENTIDAD VISUAL CECI PINGÜINO
   ========================================================== */

:root {
    --brand-primary: #DF7499;
    --brand-secondary: #39BDE3;
    --brand-accent: #EDB141;
    --app-bg: #F7F8FA;
    --app-card: #FFFFFF;
    --app-text: #1B2728;
    --app-font: "Avenir Next", "Segoe UI", Trebuchet MS, Arial, sans-serif;

    /* Colores operativos: NO dependen del tema */
    --op-pending-bg: #FFF4C7;
    --op-pending-text: #765A00;
    --op-filled-bg: #E7F0FF;
    --op-filled-text: #1B56A9;
    --op-scanned-bg: #E5F7EC;
    --op-scanned-text: #17663B;
    --op-duplicate-bg: #FFF0D9;
    --op-duplicate-text: #985006;
    --op-error-bg: #FFE7E7;
    --op-error-text: #A32A2A;

    --radius-ui: 14px;
    --radius-card: 18px;
    --shadow-soft:
        0 1px 2px rgba(18, 24, 40, .04),
        0 8px 28px rgba(18, 24, 40, .055);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--app-bg);
}

body {
    margin: 0;
    color: var(--app-text);
    background:
        radial-gradient(
            circle at 12% -8%,
            color-mix(in srgb, var(--brand-primary) 10%, transparent),
            transparent 27rem
        ),
        radial-gradient(
            circle at 96% 8%,
            color-mix(in srgb, var(--brand-secondary) 7%, transparent),
            transparent 25rem
        ),
        var(--app-bg);
    font-family: var(--app-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.theme-radius-recta {
    --radius-ui: 8px;
    --radius-card: 10px;
}

body.theme-radius-suave {
    --radius-ui: 14px;
    --radius-card: 18px;
}

body.theme-radius-redonda {
    --radius-ui: 20px;
    --radius-card: 26px;
}

body.theme-scale-pequena {
    font-size: 14px;
}

body.theme-scale-normal {
    font-size: 15px;
}

body.theme-scale-grande {
    font-size: 16px;
}

body.theme-density-compacta .panel {
    padding: 16px;
}

body.theme-density-equilibrada .panel {
    padding: 20px;
}

body.theme-density-comoda .panel {
    padding: 25px;
}

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

::selection {
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 30%,
            white
        );
}

/* NAV ------------------------------------------------------ */

.global-nav {
    position: sticky;
    top: 0;
    z-index: 1500;
    min-height: 68px;
    padding: 9px clamp(14px, 3vw, 42px);
    border-bottom:
        1px solid
        rgba(17, 24, 39, .07);
    background:
        color-mix(
            in srgb,
            var(--app-card) 92%,
            transparent
        );
    backdrop-filter: blur(18px);
    box-shadow:
        0 1px 0
        rgba(255,255,255,.6);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 175px;
    text-decoration: none;
    color: var(--app-text);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 15px;
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 9%,
            white
        );
}

.brand-mark img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong {
    display: block;
    overflow: hidden;
    max-width: 155px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 850;
    letter-spacing: -.02em;
}

.brand-copy small {
    display: block;
    margin-top: 1px;
    color: #8A8F98;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.global-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: rgba(17, 24, 39, .035);
}

.global-nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 10px;
    color: #626873;
    text-decoration: none;
    font-size: 12px;
    font-weight: 780;
    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}

.global-nav-links a:hover {
    color: var(--app-text);
    background: rgba(255,255,255,.75);
}

.global-nav-links a.active {
    color: white;
    background: #15191C;
    box-shadow:
        0 4px 12px
        rgba(17,24,39,.12);
}

.personalize-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    margin-left: 8px;
    padding: 8px 11px;
    border-radius: 11px;
    color: #6B7280;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.personalize-link:hover,
.personalize-link.active {
    color: var(--app-text);
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 12%,
            white
        );
}

/* COMMON SURFACES ----------------------------------------- */

.container {
    width:
        min(
            1240px,
            calc(100% - 34px)
        );
    margin:
        30px auto 70px;
}

.wide-container {
    width:
        min(
            1480px,
            calc(100% - 34px)
        );
}

.topbar {
    align-items: flex-end;
    margin-bottom: 22px;
}

.topbar h1,
.home-hero h1 {
    margin:
        2px 0 6px;
    color: var(--app-text);
    font-size:
        clamp(29px, 3.1vw, 42px);
    font-weight: 860;
    letter-spacing: -.045em;
    line-height: 1.03;
}

.subtitle,
.home-hero p {
    color: #727985;
    line-height: 1.55;
}

.eyebrow {
    color:
        color-mix(
            in srgb,
            var(--brand-primary) 78%,
            #6B3450
        );
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .15em;
}

.card,
.panel {
    border:
        1px solid
        rgba(17, 24, 39, .075);
    border-radius: var(--radius-card);
    background: var(--app-card);
    box-shadow: var(--shadow-soft);
}

.panel {
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.btn {
    min-height: 42px;
    border: 0;
    border-radius: var(--radius-ui);
    padding: 10px 16px;
    background: #171B1E;
    color: white;
    box-shadow:
        0 5px 14px
        rgba(17, 24, 39, .10);
    font-weight: 800;
    cursor: pointer;
    transition:
        transform .13s ease,
        box-shadow .13s ease,
        background .13s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #050607;
    box-shadow:
        0 8px 18px
        rgba(17, 24, 39, .14);
}

.btn.secondary {
    border:
        1px solid
        rgba(17,24,39,.11);
    background: var(--app-card);
    color: #40464F;
    box-shadow: none;
}

.btn.secondary:hover:not(:disabled) {
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 6%,
            white
        );
}

.text-input,
.text-area,
.inline-input,
select {
    border:
        1px solid
        rgba(17,24,39,.14);
    border-radius: var(--radius-ui);
    background:
        color-mix(
            in srgb,
            var(--app-card) 96%,
            #F3F4F6
        );
    color: var(--app-text);
    box-shadow:
        0 1px 2px
        rgba(17,24,39,.025);
    transition:
        border-color .14s ease,
        box-shadow .14s ease,
        background .14s ease;
}

.text-input:focus,
.text-area:focus,
.inline-input:focus,
select:focus {
    outline: none;
    border-color:
        color-mix(
            in srgb,
            var(--brand-primary) 72%,
            #111827
        );
    background: white;
    box-shadow:
        0 0 0 4px
        color-mix(
            in srgb,
            var(--brand-primary) 13%,
            transparent
        );
}

/* HOME ----------------------------------------------------- */

.home-container {
    margin-top: 34px;
}

.brand-hero {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(260px, .65fr);
    align-items: center;
    min-height: 340px;
    overflow: hidden;
    padding:
        clamp(28px, 5vw, 66px);
    border:
        1px solid
        rgba(17,24,39,.07);
    border-radius:
        calc(
            var(--radius-card) + 8px
        );
    background:
        linear-gradient(
            135deg,
            color-mix(
                in srgb,
                var(--brand-primary) 6%,
                var(--app-card)
            ),
            var(--app-card) 52%,
            color-mix(
                in srgb,
                var(--brand-secondary) 5%,
                var(--app-card)
            )
        );
    box-shadow:
        0 18px 52px
        rgba(17,24,39,.065);
}

.brand-hero::before {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    left: -80px;
    top: -90px;
    border-radius: 50%;
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 13%,
            transparent
        );
}

.brand-hero-copy {
    position: relative;
    z-index: 2;
    max-width: 670px;
}

.brand-hero h1 {
    max-width: 720px;
    margin-top: 9px;
    font-size:
        clamp(42px, 6vw, 72px);
}

.brand-hero p {
    max-width: 580px;
    margin: 15px 0 0;
    font-size:
        clamp(16px, 1.8vw, 20px);
}

.hero-mini-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 30px;
    color: #66707B;
    font-size: 11px;
    font-weight: 780;
}

.hero-mini-status span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-dot.pink {
    background: var(--brand-primary);
}

.status-dot.blue {
    background: var(--brand-secondary);
}

.status-dot.green {
    background: #36A36A;
}

.brand-hero-mascot {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 255px;
}

.brand-hero-mascot img {
    position: relative;
    z-index: 2;
    width:
        min(
            330px,
            92%
        );
    max-height: 300px;
    object-fit: contain;
    filter:
        drop-shadow(
            0 16px 22px
            rgba(20,30,34,.11)
        );
    transition:
        transform .25s ease;
}

.brand-hero:hover
.brand-hero-mascot img {
    transform:
        translateY(-3px)
        rotate(-1deg);
}

.mascot-blob {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 45% 55% 58% 42%;
    background:
        linear-gradient(
            145deg,
            color-mix(
                in srgb,
                var(--brand-primary) 17%,
                white
            ),
            color-mix(
                in srgb,
                var(--brand-secondary) 14%,
                white
            )
        );
    transform: rotate(12deg);
}

.theme-mascot-discreta
.brand-hero-mascot img {
    width: min(230px, 76%);
    opacity: .92;
}

.theme-mascot-discreta
.mascot-blob {
    width: 205px;
    height: 205px;
    opacity: .65;
}

.theme-mascot-oculta
.brand-hero {
    grid-template-columns: 1fr;
}

.theme-mascot-oculta
.brand-hero-mascot {
    display: none;
}

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

.home-action-card {
    position: relative;
    display: grid;
    grid-template-columns:
        auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 150px;
    padding: 21px;
    border:
        1px solid
        rgba(17,24,39,.07);
    border-radius: var(--radius-card);
    background: var(--app-card);
    color: var(--app-text);
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

.home-action-card:hover {
    transform:
        translateY(-3px);
    border-color:
        color-mix(
            in srgb,
            var(--brand-primary) 25%,
            rgba(17,24,39,.08)
        );
    box-shadow:
        0 16px 34px
        rgba(17,24,39,.09);
}

.home-card-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 10%,
            white
        );
    color:
        color-mix(
            in srgb,
            var(--brand-primary) 78%,
            #5F3044
        );
    font-size: 21px;
    font-weight: 900;
}

.home-card-pick
.home-card-icon {
    background:
        color-mix(
            in srgb,
            var(--brand-secondary) 10%,
            white
        );
    color: #147DA1;
}

.scanner-home-card
.home-card-icon {
    background:
        color-mix(
            in srgb,
            var(--brand-accent) 15%,
            white
        );
    color: #9A690D;
}

.home-card-dashboard
.home-card-icon {
    background: #F0F2F4;
    color: #252A2F;
}

.home-card-content {
    min-width: 0;
}

.home-card-kicker {
    display: block;
    margin-bottom: 5px;
    color: #9A9FA7;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
}

.home-action-card h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 850;
    letter-spacing: -.02em;
}

.home-action-card p {
    margin: 6px 0 0;
    color: #767D87;
    font-size: 11px;
    line-height: 1.45;
}

.home-arrow {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: #F6F7F8;
    color: #454B53;
    transition:
        transform .15s ease,
        background .15s ease;
}

.home-action-card:hover
.home-arrow {
    transform:
        translateX(2px);
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 10%,
            white
        );
}

/* OPERATOR ------------------------------------------------- */

.operator-card {
    max-width: 570px;
    border-radius:
        calc(
            var(--radius-card) + 4px
        );
    border:
        1px solid
        rgba(17,24,39,.08);
    box-shadow:
        0 26px 80px
        rgba(17,24,39,.18);
}

.operator-brand-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.operator-brand-head h2 {
    margin: 3px 0 0;
    font-size: 24px;
    letter-spacing: -.035em;
}

.operator-mascot {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 22px;
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 8%,
            white
        );
}

.operator-mascot img {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.theme-mascot-discreta
.operator-mascot {
    width: 58px;
    height: 58px;
    border-radius: 17px;
}

.theme-mascot-discreta
.operator-mascot img {
    width: 69px;
    height: 69px;
}

.theme-mascot-oculta
.operator-mascot {
    display: none;
}

.operator-intro {
    margin-top: 0;
    margin-bottom: 20px;
}

.operator-name-btn {
    min-height: 62px;
    border:
        1px solid
        rgba(17,24,39,.10);
    border-radius: var(--radius-ui);
    background: var(--app-card);
}

.operator-name-btn:hover {
    border-color:
        color-mix(
            in srgb,
            var(--brand-primary) 55%,
            #C8CBD0
        );
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 6%,
            white
        );
}

.operator-name-btn.recent {
    border-color:
        color-mix(
            in srgb,
            var(--brand-primary) 38%,
            #D9DBDE
        );
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 7%,
            white
        );
}

.operator-name-btn small {
    color:
        color-mix(
            in srgb,
            var(--brand-primary) 78%,
            #5D3143
        );
}

/* CARGAS / SURTIDO / DASHBOARD ----------------------------- */

.notice-panel {
    border-left:
        4px solid
        var(--brand-secondary);
    background:
        linear-gradient(
            90deg,
            color-mix(
                in srgb,
                var(--brand-secondary) 5%,
                var(--app-card)
            ),
            var(--app-card)
        );
}

.mode-card {
    border-radius: var(--radius-ui);
    transition:
        border-color .14s ease,
        background .14s ease,
        transform .14s ease;
}

.mode-card.active {
    border-color:
        color-mix(
            in srgb,
            var(--brand-primary) 50%,
            #C9CCD1
        );
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 6%,
            white
        );
}

.drop-zone {
    border-radius: var(--radius-card);
    border:
        1.5px dashed
        color-mix(
            in srgb,
            var(--brand-primary) 50%,
            #C9CED4
        );
    background:
        linear-gradient(
            135deg,
            color-mix(
                in srgb,
                var(--brand-primary) 4%,
                white
            ),
            color-mix(
                in srgb,
                var(--brand-secondary) 3%,
                white
            )
        );
}

.drop-zone:hover {
    border-color:
        var(--brand-primary);
}

.surtido-card {
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    transition:
        transform .14s ease,
        box-shadow .14s ease,
        border-color .14s ease;
}

.surtido-card:hover {
    transform: translateY(-1px);
    box-shadow:
        0 12px 28px
        rgba(17,24,39,.075);
}

.surtido-card.has-missing {
    border-left:
        5px solid #F0A11C;
    background:
        color-mix(
            in srgb,
            #FFF4DB 58%,
            var(--app-card)
        );
}

.surtido-card.completed-order-card {
    border-left:
        5px solid #39A66B;
    background:
        color-mix(
            in srgb,
            #E9F8EF 62%,
            var(--app-card)
        );
}

.workspace-reservation {
    border:
        1px solid
        color-mix(
            in srgb,
            var(--brand-secondary) 30%,
            #D8DEE5
        );
    background:
        color-mix(
            in srgb,
            var(--brand-secondary) 7%,
            white
        );
    color: #285E70;
}

.metric-card {
    min-height: 112px;
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-card.active {
    border-color:
        color-mix(
            in srgb,
            var(--brand-primary) 38%,
            #D5D8DC
        );
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 5%,
            var(--app-card)
        );
}

.general-progress-panel {
    overflow: hidden;
}

.dashboard-main-progress {
    overflow: hidden;
    border-radius: 999px;
    background: #EEF0F2;
}

.dashboard-main-progress .progress,
.progress-wrap .progress {
    background:
        linear-gradient(
            90deg,
            var(--brand-primary),
            color-mix(
                in srgb,
                var(--brand-primary) 60%,
                var(--brand-secondary)
            )
        );
}

.orders-table thead th {
    background:
        color-mix(
            in srgb,
            var(--app-card) 92%,
            #EEF0F3
        );
}

.orders-table tbody tr {
    transition:
        background .12s ease;
}

.orders-table tbody tr:hover {
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 3%,
            white
        );
}

/* Personalización ------------------------------------------ */

.customization-container {
    width:
        min(
            1450px,
            calc(100% - 34px)
        );
}

.customization-topbar {
    align-items: center;
}

.customization-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.customization-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(370px, .8fr);
    gap: 20px;
    align-items: start;
}

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

.customization-section {
    padding: 24px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.section-number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 11px;
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 9%,
            white
        );
    color:
        color-mix(
            in srgb,
            var(--brand-primary) 80%,
            #56323F
        );
    font-size: 9px;
    font-weight: 900;
}

.section-heading h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.025em;
}

.section-heading p {
    margin: 4px 0 0;
    color: #81868D;
    font-size: 11px;
}

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

.logo-control-row {
    display: grid;
    grid-template-columns:
        115px 1fr;
    gap: 16px;
    align-items: center;
    margin-top: 18px;
}

.logo-current-card {
    display: grid;
    place-items: center;
    width: 115px;
    height: 115px;
    overflow: hidden;
    border:
        1px solid
        rgba(17,24,39,.08);
    border-radius: 25px;
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 5%,
            white
        );
}

.logo-current-card img {
    width: 135px;
    height: 135px;
    object-fit: contain;
}

.logo-upload-copy p {
    margin: 5px 0 12px;
}

.upload-logo-btn {
    display: inline-flex;
    cursor: pointer;
}

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

.color-field {
    padding: 12px;
    border:
        1px solid
        rgba(17,24,39,.08);
    border-radius: var(--radius-ui);
    background:
        color-mix(
            in srgb,
            var(--app-card) 96%,
            #F4F5F6
        );
}

.color-field > span {
    display: block;
    margin-bottom: 9px;
    color: #6B7179;
    font-size: 10px;
    font-weight: 800;
}

.color-field > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.color-field input[type="color"] {
    width: 43px;
    height: 43px;
    padding: 2px;
    border:
        1px solid
        rgba(17,24,39,.10);
    border-radius: 11px;
    background: white;
    cursor: pointer;
}

.color-field code {
    color: #50565E;
    font-size: 11px;
    font-weight: 800;
}

.safe-colors-note {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 16px;
    padding: 11px 13px;
    border-radius: var(--radius-ui);
    background: #F7F8F9;
    color: #69707A;
    font-size: 10px;
}

.safe-colors-note strong {
    margin-right: 3px;
    color: #444A52;
}

.safe-colors-note span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sample-state {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sample-state.pending {
    background: #E8B829;
}

.sample-state.filled {
    background: #4F8DE5;
}

.sample-state.scanned {
    background: #42A36D;
}

.sample-state.duplicate {
    background: #E88A20;
}

.sample-state.error {
    background: #D75656;
}

.choice-group {
    margin-top: 18px;
}

.choice-title {
    display: block;
    margin-bottom: 8px;
    color: #555C65;
    font-size: 11px;
    font-weight: 850;
}

.segmented-control {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 4px;
    border-radius:
        calc(
            var(--radius-ui) + 2px
        );
    background: #F2F3F5;
}

.segmented-control label {
    cursor: pointer;
}

.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-control span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 37px;
    padding: 8px 13px;
    border-radius: 10px;
    color: #69707A;
    font-size: 10px;
    font-weight: 820;
    transition:
        background .12s ease,
        color .12s ease,
        box-shadow .12s ease;
}

.segmented-control
input:checked + span {
    background: white;
    color: #20252A;
    box-shadow:
        0 2px 8px
        rgba(17,24,39,.08);
}

.customization-preview-wrap {
    min-width: 0;
}

.preview-sticky {
    position: sticky;
    top: 88px;
}

.preview-label {
    margin: 0 0 8px 4px;
    color: #949AA2;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .14em;
}

.theme-preview {
    --preview-radius: 14px;
    overflow: hidden;
    border:
        1px solid
        rgba(17,24,39,.10);
    border-radius:
        calc(
            var(--preview-radius) + 8px
        );
    background: var(--app-bg);
    box-shadow:
        0 18px 50px
        rgba(17,24,39,.09);
    font-family: var(--app-font);
}

.preview-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 8px 12px;
    border-bottom:
        1px solid
        rgba(17,24,39,.07);
    background: var(--app-card);
}

.preview-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.preview-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.preview-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.preview-active {
    padding: 7px 11px;
    border-radius: 9px;
    background: #161A1D;
    color: white;
    font-size: 9px;
    font-weight: 850;
}

.preview-content {
    padding: 16px;
}

.preview-hero {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        110px;
    align-items: center;
    gap: 10px;
    min-height: 150px;
    padding: 18px;
    border-radius: var(--preview-radius);
    background:
        linear-gradient(
            135deg,
            color-mix(
                in srgb,
                var(--brand-primary) 8%,
                var(--app-card)
            ),
            var(--app-card)
        );
}

.preview-hero span {
    color: var(--brand-primary);
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .12em;
}

.preview-hero h3 {
    margin: 5px 0 5px;
    color: var(--app-text);
    font-size: 22px;
    letter-spacing: -.04em;
}

.preview-hero p {
    margin: 0;
    color: #737983;
    font-size: 9px;
    line-height: 1.45;
}

.preview-hero img {
    width: 112px;
    height: 112px;
    object-fit: contain;
}

.theme-preview[data-mascot="discreta"]
.preview-hero img {
    width: 82px;
    height: 82px;
    justify-self: end;
}

.theme-preview[data-mascot="oculta"]
.preview-hero {
    grid-template-columns: 1fr;
}

.theme-preview[data-mascot="oculta"]
.preview-hero img {
    display: none;
}

.preview-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 9px;
}

.preview-card {
    padding: 12px;
    border-radius: var(--preview-radius);
    background: var(--app-card);
    border:
        1px solid
        rgba(17,24,39,.07);
}

.preview-card span {
    display: block;
    color: #8A9097;
    font-size: 8px;
}

.preview-card strong {
    display: block;
    margin-top: 3px;
    color: var(--app-text);
    font-size: 18px;
}

.preview-order {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
    padding: 12px;
    border-radius: var(--preview-radius);
    background: var(--app-card);
    border:
        1px solid
        rgba(17,24,39,.07);
}

.preview-order strong {
    display: block;
    color: var(--app-text);
    font-size: 9px;
}

.preview-order small {
    display: block;
    margin-top: 2px;
    color: #90959B;
    font-size: 7px;
}

.preview-order button {
    min-height: 32px;
    border: 0;
    border-radius: 9px;
    padding: 6px 10px;
    background: #171B1E;
    color: white;
    font-size: 8px;
    font-weight: 850;
}

.theme-preview[data-density="compacta"]
.preview-content {
    padding: 10px;
}

.theme-preview[data-density="compacta"]
.preview-hero {
    min-height: 125px;
    padding: 13px;
}

.theme-preview[data-density="comoda"]
.preview-content {
    padding: 22px;
}

.theme-preview[data-density="comoda"]
.preview-hero {
    padding: 24px;
}

.theme-preview[data-scale="pequena"] {
    font-size: 90%;
}

.theme-preview[data-scale="grande"] {
    font-size: 110%;
}

.preview-help {
    margin: 10px 4px 0;
    color: #81868D;
    font-size: 10px;
    line-height: 1.5;
}

/* Operativos: mantener semántica de color ------------------ */

.status-select.status-pending {
    background: var(--op-pending-bg);
    color: var(--op-pending-text);
    border-color: #F4DC7D;
}

.status-select.status-filled {
    background: var(--op-filled-bg);
    color: var(--op-filled-text);
    border-color: #BFD5F7;
}

.status-select.status-scanned {
    background: var(--op-scanned-bg);
    color: var(--op-scanned-text);
    border-color: #B9E3C9;
}

/* RESPONSIVE ------------------------------------------------ */

@media (max-width: 1120px) {
    .brand-copy {
        display: none;
    }

    .brand-link {
        min-width: 50px;
    }

    .personalize-link span {
        display: none;
    }

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

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

    .preview-sticky {
        position: static;
    }

    .customization-preview-wrap {
        order: -1;
    }
}

@media (max-width: 760px) {
    .global-nav {
        position: sticky;
        display: grid;
        grid-template-columns:
            auto 1fr auto;
        gap: 6px;
        padding: 7px 9px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .brand-mark img {
        width: 51px;
        height: 51px;
    }

    .global-nav-links {
        overflow-x: auto;
        justify-content: flex-start;
        min-width: 0;
        scrollbar-width: none;
    }

    .global-nav-links::-webkit-scrollbar {
        display: none;
    }

    .global-nav-links a {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 7px 10px;
        font-size: 10px;
    }

    .personalize-link {
        width: 40px;
        min-height: 40px;
        padding: 7px;
    }

    .container,
    .wide-container,
    .customization-container {
        width:
            min(
                100% - 20px,
                100%
            );
        margin-top: 18px;
    }

    .brand-hero {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 27px 22px 12px;
    }

    .brand-hero h1 {
        font-size: 42px;
    }

    .brand-hero-mascot {
        min-height: 190px;
    }

    .brand-hero-mascot img {
        max-height: 205px;
    }

    .mascot-blob {
        width: 180px;
        height: 180px;
    }

    .home-menu-grid {
        grid-template-columns: 1fr;
    }

    .home-action-card {
        min-height: 118px;
    }

    .customization-topbar {
        align-items: flex-start;
    }

    .customization-grid,
    .color-grid {
        grid-template-columns: 1fr;
    }

    .logo-control-row {
        grid-template-columns:
            92px 1fr;
    }

    .logo-current-card {
        width: 92px;
        height: 92px;
        border-radius: 21px;
    }

    .logo-current-card img {
        width: 110px;
        height: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
    }
}


/* ==========================================================
   PASO 10.1 — PULIDO
   ========================================================== */

/* La navegación permanece sticky, pero nunca tapa modales/visor. */
.global-nav {
    z-index: 700;
}

.modal-backdrop {
    z-index: 3000;
}

.pdf-modal {
    z-index: 3200;
}

.operator-modal {
    z-index: 3400;
}

/* Logo pequeño: siempre mostrar la composición COMPLETA. */
.brand-mark {
    width: 54px;
    height: 54px;
    overflow: visible;
    padding: 3px;
    border-radius: 15px;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    object-position: center;
}

.operator-mascot {
    overflow: visible;
    padding: 5px;
}

.operator-mascot img {
    width: 100%;
    height: 100%;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    object-position: center;
}

.theme-mascot-discreta
.operator-mascot img {
    width: 100%;
    height: 100%;
    max-width: 50px;
    max-height: 50px;
}

.logo-current-card {
    overflow: visible;
    padding: 7px;
}

.logo-current-card img {
    width: 100%;
    height: 100%;
    max-width: 98px;
    max-height: 98px;
    object-fit: contain;
    object-position: center;
}

.preview-brand img {
    object-fit: contain;
    object-position: center;
}

@media (max-width: 760px) {
    .brand-mark {
        width: 46px;
        height: 46px;
        padding: 3px;
    }

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

/* Catálogo persistente de faltantes */
.missing-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.missing-field-head > span {
    font-weight: 800;
}

.missing-manage-btn {
    min-height: 30px;
    border: 0;
    border-radius: 9px;
    padding: 6px 9px;
    background: transparent;
    color: #737983;
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.missing-manage-btn:hover,
.missing-manage-btn.active {
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 9%,
            white
        );
    color: var(--app-text);
}

.missing-presets {
    align-items: center;
}

.missing-catalog-item {
    display: inline-flex;
    align-items: stretch;
    gap: 3px;
}

.missing-catalog-item
.missing-choice {
    min-height: 36px;
}

.missing-delete-btn {
    display: grid;
    place-items: center;
    width: 30px;
    min-height: 36px;
    border:
        1px solid
        rgba(150, 45, 45, .16);
    border-radius: 9px;
    background: #FFF5F5;
    color: #A33A3A;
    cursor: pointer;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.missing-delete-btn:hover {
    background: #FFE8E8;
    color: #851F1F;
}

.missing-custom-row {
    margin-top: 10px;
}

@media (max-width: 700px) {
    .missing-field-head {
        align-items: flex-start;
    }

    .missing-manage-btn {
        min-height: 38px;
    }

    .missing-delete-btn {
        width: 38px;
        min-height: 44px;
    }
}


/* ==========================================================
   PASO 11.1.7 — PDF MÓVIL COLAPSABLE + IMPRESIÓN ESTABLE
   ========================================================== */

.mobile-pdf-viewer {
    display: none;
}

.mobile-pdf-tools {
    display: none;
}

.mobile-print-frame {
    position: fixed;
    left: -100000px;
    top: 0;
    width: 2px;
    height: 2px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 900px), (pointer: coarse) {
    .mobile-pdf-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

    .mobile-pdf-tools .btn {
        min-height: 46px;
        padding: 9px 10px;
        font-size: 12px;
    }

    .desktop-pdf-frame {
        display: none !important;
    }

    /* Al abrir: interfaz operativa primero, PDF oculto. */
    .order-workspace {
        display: block;
        width: min(100%, 760px);
        height: min(94vh, 920px);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--app-card);
    }

    .order-control-panel {
        min-height: 100%;
    }

    .order-pdf-panel {
        display: none;
        min-height: 0;
        background: #DDE1E5;
    }

    .order-workspace.mobile-pdf-open
    .order-pdf-panel {
        display: block;
        max-height: 52vh;
        overflow: hidden;
        border-bottom:
            1px solid
            rgba(17,24,39,.10);
    }

    .order-workspace.mobile-pdf-open
    .workspace-head {
        display: none;
    }

    .mobile-pdf-viewer {
        display: block;
        max-height: 52vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 9px;
        background:
            linear-gradient(
                180deg,
                #E7EAED,
                #D7DBDF
            );
        -webkit-overflow-scrolling: touch;
    }

    .mobile-pdf-viewer[hidden] {
        display: none;
    }

    .mobile-pdf-status {
        margin: 10px;
        padding: 14px;
        border-radius: 13px;
        background: rgba(255,255,255,.88);
        color: #565E67;
        text-align: center;
        font-size: 12px;
        line-height: 1.45;
    }

    .mobile-pdf-status strong,
    .mobile-pdf-status span {
        display: block;
    }

    .mobile-pdf-status span {
        margin-top: 5px;
        color: #7A828C;
    }

    .mobile-pdf-pages {
        display: grid;
        gap: 10px;
        width: 100%;
        max-width: 680px;
        margin: 0 auto;
    }

    .mobile-pdf-page {
        margin: 0;
        overflow: hidden;
        border-radius: 9px;
        background: white;
        box-shadow:
            0 3px 14px
            rgba(17,24,39,.14);
    }

    .mobile-pdf-page img {
        display: block;
        width: 100%;
        height: auto;
        background: white;
    }

    .mobile-pdf-page figcaption {
        padding: 5px 9px;
        border-top:
            1px solid #EEF0F2;
        background: #FAFAFB;
        color: #818892;
        text-align: center;
        font-size: 9px;
        font-weight: 750;
    }
}

@media (max-width: 520px) {
    .mobile-pdf-tools {
        position: sticky;
        top: 0;
        z-index: 9;
        margin: -2px -2px 12px;
        padding: 7px;
        border-radius: 12px;
        background:
            rgba(255,255,255,.96);
        backdrop-filter: blur(10px);
    }

    .order-workspace {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .order-workspace.mobile-pdf-open
    .order-pdf-panel,
    .mobile-pdf-viewer {
        max-height: 46vh;
    }
}


/* ==========================================================
   PASO 11.3 — GOOGLE LOGIN
   ========================================================== */

.nav-account-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.auth-account {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 5px 4px 10px;
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.76);
}

.auth-account-copy {
    min-width: 0;
}

.auth-account-copy strong,
.auth-account-copy small {
    display: block;
    overflow: hidden;
    max-width: 145px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-account-copy strong {
    color: var(--app-text);
    font-size: 10px;
    font-weight: 850;
}

.auth-account-copy small {
    margin-top: 1px;
    color: #838991;
    font-size: 8px;
}

.auth-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 8px;
    background: #F2F3F5;
    color: #5F6670;
    text-decoration: none;
    font-size: 9px;
    font-weight: 850;
}

.auth-logout:hover {
    background: #E8EAED;
    color: #22272C;
}

body.login-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at 20% 10%,
            color-mix(in srgb, var(--brand-primary) 15%, transparent),
            transparent 30rem
        ),
        radial-gradient(
            circle at 90% 85%,
            color-mix(in srgb, var(--brand-secondary) 10%, transparent),
            transparent 28rem
        ),
        var(--app-bg);
    color: var(--app-text);
    font-family: var(--app-font);
}

.login-shell {
    width: min(440px, 100%);
}

.login-card {
    padding: 34px 30px 28px;
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 28px;
    background: rgba(255,255,255,.94);
    box-shadow:
        0 24px 80px
        rgba(17,24,39,.12);
    text-align: center;
    backdrop-filter: blur(18px);
}

.login-mascot {
    display: grid;
    place-items: center;
    width: 122px;
    height: 122px;
    margin: -8px auto 10px;
    border-radius: 34px;
    background:
        color-mix(
            in srgb,
            var(--brand-primary) 7%,
            white
        );
}

.login-mascot img {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: contain;
}

.login-card h1 {
    margin: 7px 0 7px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.045em;
}

.login-subtitle {
    margin: 0 auto;
    max-width: 330px;
    color: #747B84;
    font-size: 13px;
    line-height: 1.5;
}

.google-login-wrap {
    display: flex;
    justify-content: center;
    min-height: 48px;
    margin-top: 25px;
}

.login-message {
    display: grid;
    gap: 5px;
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.45;
}

.login-message.error {
    border: 1px solid #F0C6C6;
    background: #FFF1F1;
    color: #923838;
}

.login-allowed {
    display: grid;
    gap: 4px;
    margin-top: 24px;
    padding-top: 17px;
    border-top: 1px solid #ECEEF0;
}

.login-allowed > span {
    margin-bottom: 3px;
    color: #969BA2;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login-allowed strong {
    color: #5E656E;
    font-size: 10px;
    font-weight: 750;
}

.login-security-note {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 18px;
    color: #8B9199;
    font-size: 8px;
    font-weight: 750;
}

.login-footer {
    margin: 12px 0 0;
    color: #91969D;
    text-align: center;
    font-size: 9px;
}

@media (max-width: 760px) {
    .auth-account-copy {
        display: none;
    }

    .auth-account {
        padding: 3px;
        border: 0;
        background: transparent;
    }

    .auth-logout {
        min-height: 38px;
        padding: 7px 8px;
    }
}

@media (max-width: 480px) {
    body.login-page {
        padding: 14px;
    }

    .login-card {
        padding: 27px 18px 23px;
        border-radius: 22px;
    }

    .login-mascot {
        width: 108px;
        height: 108px;
    }

    .login-mascot img {
        width: 100px;
        height: 100px;
    }

    .login-card h1 {
        font-size: 30px;
    }
}


/* ==========================================================
   PASO 11.7 — RESET DE BASE
   ========================================================== */

.danger-zone {
    border-color: rgba(180, 54, 54, .22) !important;
    background: #FFFBFB !important;
}

.danger-number {
    background: #FFF0F0 !important;
    color: #A63737 !important;
}

.reset-base-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #F1D6D6;
    border-radius: 14px;
    background: #FFF9F9;
}

.reset-base-copy strong {
    display: block;
    color: #792D2D;
    font-size: 14px;
    font-weight: 900;
}

.reset-base-copy p {
    max-width: 660px;
    margin: 5px 0 7px;
    color: #646A72;
    font-size: 11px;
    line-height: 1.5;
}

.reset-base-copy span {
    color: #969BA1;
    font-size: 9px;
    font-weight: 700;
}

.danger-action-btn,
.danger-confirm-btn {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 15px;
    border: 0;
    border-radius: 11px;
    background: #A83E3E;
    color: white;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
}

.danger-action-btn:hover,
.danger-confirm-btn:hover {
    background: #913232;
}

.danger-confirm-btn:disabled {
    cursor: wait;
    opacity: .55;
}

.reset-password-link {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #888E95;
    cursor: pointer;
    font-size: 9px;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

.ceci-modal-backdrop {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(21, 25, 29, .56);
    backdrop-filter: blur(6px);
}

.ceci-modal-card {
    position: relative;
    width: min(500px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 27px;
    border-radius: 20px;
    background: #FFF;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .25);
}

.ceci-modal-card h2 {
    margin: 5px 0 8px;
    color: #272B30;
    font-size: 23px;
    letter-spacing: -.03em;
}

.ceci-modal-card > p {
    margin: 0 0 18px;
    color: #727880;
    font-size: 11px;
    line-height: 1.55;
}

.ceci-modal-close {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: #F2F3F4;
    color: #60666D;
    cursor: pointer;
    font-size: 20px;
}

.danger-kicker {
    color: #A83E3E;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .14em;
}

.modal-field {
    display: grid;
    gap: 6px;
    margin-top: 13px;
}

.modal-field label {
    color: #555B63;
    font-size: 9px;
    font-weight: 850;
}

.modal-field input {
    width: 100%;
    min-height: 43px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #D9DDE1;
    border-radius: 10px;
    outline: none;
    background: #FFF;
    color: #22272C;
    font: inherit;
}

.modal-field input:focus {
    border-color: var(--brand-primary);
}

.ceci-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 22px;
}

.reset-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 15px 0;
}

.reset-counts > div {
    padding: 11px 8px;
    border: 1px solid #E9EBED;
    border-radius: 10px;
    background: #FAFAFB;
    text-align: center;
}

.reset-counts span,
.reset-counts strong {
    display: block;
}

.reset-counts span {
    color: #8E949B;
    font-size: 8px;
    font-weight: 800;
}

.reset-counts strong {
    margin-top: 4px;
    color: #30353A;
    font-size: 18px;
}

.reset-final-warning {
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #FFF3D9;
    color: #7A612A;
    font-size: 9px;
    font-weight: 750;
    line-height: 1.45;
}

.reset-progress {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #F3F7F8;
    color: #596168;
    font-size: 9px;
    font-weight: 800;
}

.reset-progress strong,
.reset-progress span {
    display: block;
}

.reset-spinner {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid #D6DBDE;
    border-top-color: #555D63;
    border-radius: 50%;
    animation: ceci-reset-spin .7s linear infinite;
}

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

body.modal-open {
    overflow: hidden;
}

@media (max-width: 650px) {
    .reset-base-box {
        align-items: stretch;
        flex-direction: column;
    }

    .danger-action-btn {
        width: 100%;
    }

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

    .ceci-modal-card {
        padding: 24px 18px 19px;
        border-radius: 17px;
    }

    .ceci-modal-actions {
        flex-direction: column-reverse;
    }

    .ceci-modal-actions button {
        width: 100%;
    }
}
