:root {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17202a;
    background: #f5f7fa;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

.container { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
    background: white;
    border-bottom: 1px solid #e4e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.top-actions, .heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.brand { font-size: 1.15rem; font-weight: 800; text-decoration: none; }

.page-nav { margin-top: 24px; }
.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-weight: 700;
    text-decoration: none;
    color: #40515e;
}
.back-link:hover { text-decoration: underline; }

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin: 28px 0;
}
.page-heading h1 { margin: 4px 0; font-size: 2.2rem; }

.eyebrow {
    margin-bottom: 4px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    font-weight: 800;
    color: #536471;
}
.muted { color: #667785; }

.primary-button, .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.compact-button { min-height: 40px; padding: 0 14px; }
.primary-button { border: 0; background: #17202a; color: white; }
.secondary-button { border: 1px solid #ccd3d9; background: white; color: #17202a; }

.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 18px;
    padding-bottom: 48px;
}

.order-card, .form-card, .detail-card, .empty-state, .photos-section, .worklog-section {
    background: white;
    border: 1px solid #e1e6ea;
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(26, 34, 43, 0.05);
}
.order-card { padding: 22px; text-decoration: none; }
.order-card:hover { transform: translateY(-1px); }
.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.order-card h2 { margin-bottom: 4px; }

.code-inline {
    display: inline-block;
    margin-left: 8px;
    color: #667785;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.status {
    display: inline-flex;
    background: #eef2f5;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}
.status.large { font-size: 0.95rem; }
.delivery {
    border-top: 1px solid #edf0f2;
    padding-top: 14px;
    margin-top: 18px;
    font-weight: 650;
}
.photo-count { font-size: 0.9rem; font-weight: 700; }

.form-card { padding: 28px; max-width: 760px; margin-bottom: 48px; }
label { display: grid; gap: 8px; font-weight: 700; margin-bottom: 20px; }

input, textarea, select {
    width: 100%;
    border: 1px solid #cfd6dc;
    border-radius: 10px;
    padding: 12px 13px;
    font: inherit;
    background: white;
}
input[type="file"] { padding: 10px; }
textarea { resize: vertical; }

.field-help { color: #72808b; font-size: 0.82rem; font-weight: 500; }

.notice {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f0f3f5;
    color: #536471;
    font-weight: 700;
}

.field-row, .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.detail-card { padding: 26px; }
.detail-grid { padding-bottom: 20px; }

dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px 20px;
}
dt { font-weight: 800; }
dd { margin: 0; }
.full-width { width: 100%; }

.empty-state { padding: 52px; text-align: center; }

.order-code {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 8px 12px;
    border: 1px solid #dce2e7;
    border-radius: 10px;
    background: white;
}
.order-code span { color: #6a7883; font-size: 0.8rem; font-weight: 700; }
.order-code strong { letter-spacing: 0.12em; }

/* Registro de intervención */
.worklog-section {
    padding: 26px;
    margin-bottom: 20px;
}

.worklog-form {
    border-top: 1px solid #edf0f2;
    border-bottom: 1px solid #edf0f2;
    padding: 24px 0;
    margin-top: 18px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dce2e7;
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
}
.check-row input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}
.check-row span {
    display: grid;
    gap: 4px;
}
.check-row small {
    color: #667785;
    font-weight: 500;
    line-height: 1.35;
}

.single-photo-preview {
    width: min(220px, 100%);
    margin-top: -6px;
    margin-bottom: 20px;
}
.single-photo-preview img {
    width: 100%;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    max-height: 260px;
}

.timeline {
    margin-top: 26px;
    position: relative;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #e2e7eb;
}
.timeline-entry {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 16px;
    margin-bottom: 18px;
}
.timeline-marker {
    width: 16px;
    height: 16px;
    margin-top: 20px;
    border-radius: 50%;
    background: #17202a;
    border: 4px solid white;
    box-shadow: 0 0 0 2px #d7dde2;
    z-index: 1;
}
.timeline-card {
    border: 1px solid #e2e7eb;
    border-radius: 14px;
    padding: 18px;
    background: #fbfcfd;
}
.timeline-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.authorization-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}
.authorization-badge.pending {
    background: #fff3d6;
    color: #7a5a00;
}
.authorization-badge.neutral {
    background: #eef2f5;
    color: #536471;
}

.log-block {
    margin-top: 14px;
}
.log-block p {
    margin: 5px 0 0;
    line-height: 1.5;
}
.log-label {
    font-size: 0.74rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #697783;
    font-weight: 800;
}
.log-cost {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e7ebee;
}
.log-photo {
    display: block;
    width: min(260px, 100%);
    margin-top: 16px;
}
.log-photo img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}
.empty-log {
    margin-top: 22px;
    padding: 18px;
    border-radius: 12px;
    background: #f5f7f9;
    color: #667785;
    text-align: center;
}

/* QR */
.qr-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
}
.qr-preview {
    width: min(150px, 38vw);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    image-rendering: pixelated;
}

/* Fotos */
.photos-section { padding: 26px; margin-bottom: 48px; }
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.section-heading h2 { margin: 0; }

.photo-badge {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2f5;
    font-weight: 800;
}

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

.photo-card, .preview-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: #eef2f5;
}
.photo-card img, .preview-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-preview-grid { margin-top: -8px; margin-bottom: 20px; }

/* Etiqueta térmica */
.label-page { background: #eef1f4; min-height: 100vh; }

.label-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 24px;
}

.thermal-label {
    width: 50mm;
    min-height: 40mm;
    margin: 0 auto 30px;
    padding: 3mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    color: black;
    text-align: center;
}
.thermal-qr { width: 23mm; height: 23mm; }
.thermal-code {
    margin-top: 1mm;
    font-size: 13pt;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.08em;
}
.thermal-order {
    margin-top: 1.2mm;
    font-size: 8pt;
    font-weight: 700;
}
.thermal-item {
    max-width: 42mm;
    margin-top: 1mm;
    font-size: 8pt;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 700px) {
    .container { width: min(100% - 22px, 1080px); }

    .topbar-inner { min-height: 64px; }
    .brand { font-size: 1rem; }
    .compact-button { min-height: 38px; padding: 0 10px; font-size: 0.86rem; }

    .field-row, .detail-grid { grid-template-columns: 1fr; }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-top: 18px;
    }

    .heading-actions { width: 100%; }
    .heading-actions .secondary-button { flex: 1; }

    dl {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    dd { margin-bottom: 14px; }

    .form-card, .detail-card, .photos-section, .worklog-section {
        padding: 18px;
    }

    .qr-section {
        align-items: flex-start;
        flex-direction: column;
    }

    .qr-preview {
        width: min(180px, 60vw);
        max-width: 100%;
        align-self: center;
    }

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

    .photo-card, .preview-photo {
        width: 100%;
        max-width: 100%;
    }

    .timeline-entry {
        gap: 12px;
    }

    .timeline-card {
        padding: 15px;
    }
}

@media (max-width: 430px) {
    .top-actions .secondary-button { display: none; }

    .photo-grid, .photo-preview-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .actions .primary-button, .actions .secondary-button {
        width: 100%;
    }

    .timeline-top {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media print {
    @page {
        size: 50mm 40mm;
        margin: 0;
    }

    body.label-page {
        background: white;
        width: 50mm;
        height: 40mm;
        margin: 0;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }

    .thermal-label {
        width: 50mm;
        height: 40mm;
        min-height: 40mm;
        margin: 0;
        padding: 3mm;
        box-shadow: none;
    }
}


/* Inicio: lista operacional y búsqueda */
.home-heading {
    margin-bottom: 20px;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    margin-bottom: 22px;
}

.search-form,
.qr-search-help {
    background: white;
    border: 1px solid #e1e6ea;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(26, 34, 43, 0.04);
}

.search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.search-box input {
    margin: 0;
    min-height: 44px;
}

.search-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: #667785;
    font-size: 0.88rem;
}

.search-meta a {
    font-weight: 700;
}

.qr-search-help {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qr-search-help p {
    margin: 4px 0 0;
    color: #667785;
    font-size: 0.86rem;
    line-height: 1.35;
}

.qr-help-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #17202a;
    color: white;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.orders-list {
    background: white;
    border: 1px solid #e1e6ea;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 18px rgba(26, 34, 43, 0.05);
    margin-bottom: 48px;
}

.orders-list-header,
.order-row {
    display: grid;
    grid-template-columns: 150px 1.15fr 1.5fr 140px 170px;
    gap: 16px;
    align-items: center;
}

.orders-list-header {
    padding: 12px 18px;
    background: #f5f7f9;
    border-bottom: 1px solid #e5eaee;
    color: #697783;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.order-row {
    padding: 15px 18px;
    border-bottom: 1px solid #edf0f2;
    text-decoration: none;
    transition: background 0.12s ease;
}

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

.order-row:hover {
    background: #fafbfd;
}

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

.code-pill {
    display: inline-flex;
    padding: 5px 7px;
    border-radius: 7px;
    background: #eef2f5;
    color: #536471;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.order-cell {
    min-width: 0;
    display: grid;
    gap: 3px;
}

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

.order-cell small {
    color: #71808b;
}

.order-status-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.row-arrow {
    font-size: 1.5rem;
    color: #89959e;
}

.mobile-item-name {
    display: none;
}

@media (max-width: 850px) {
    .search-panel {
        grid-template-columns: 1fr;
    }

    .orders-list-header {
        display: none;
    }

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

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

    .mobile-item-name {
        display: block;
        width: 100%;
        margin-top: 4px;
        font-weight: 800;
        font-size: 1rem;
    }

    .order-row > .order-cell:nth-of-type(2) {
        grid-column: 1 / 2;
    }

    .order-row > .order-cell:nth-of-type(3),
    .order-row > .order-cell:nth-of-type(4) {
        display: none;
    }

    .order-status-cell {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        flex-direction: column;
        align-items: flex-end;
    }
}

@media (max-width: 520px) {
    .search-box {
        grid-template-columns: 1fr;
    }

    .search-box .primary-button {
        width: 100%;
    }

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

    .qr-search-help {
        align-items: flex-start;
    }

    .order-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .order-status-cell {
        grid-column: 1;
        grid-row: auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }

    .row-arrow {
        margin-left: auto;
    }
}


/* Escáner QR en vivo */
.qr-search-content { min-width: 0; }
.qr-scan-button { margin-top: 10px; width: 100%; }

.scanner-open { overflow: hidden; }

.scanner-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10, 15, 20, 0.72);
    display: grid;
    place-items: center;
    padding: 18px;
}

.scanner-modal[hidden] {
    display: none;
}

.scanner-sheet {
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

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

.scanner-header h2 {
    margin: 3px 0 0;
}

.scanner-close {
    width: 42px;
    height: 42px;
    border: 1px solid #d9e0e5;
    border-radius: 10px;
    background: white;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.qr-reader {
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #0d1115;
}

.qr-reader video {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

.scanner-message {
    margin: 12px 0 16px;
    min-height: 1.4em;
    color: #536471;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 600px) {
    .scanner-modal {
        align-items: end;
        padding: 0;
    }

    .scanner-sheet {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        padding: 18px;
    }
}


/* Filtros operacionales */
.filters-panel {
    margin-bottom: 16px;
}

.status-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scrollbar-width: thin;
}

.filter-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #dfe5e9;
    border-radius: 999px;
    background: white;
    text-decoration: none;
    color: #43525e;
    font-size: 0.88rem;
    font-weight: 750;
}

.filter-chip strong {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef2f5;
    font-size: 0.76rem;
}

.filter-chip:hover {
    border-color: #bfc9d0;
}

.filter-chip.active {
    background: #17202a;
    color: white;
    border-color: #17202a;
}

.filter-chip.active strong {
    background: rgba(255,255,255,0.16);
    color: white;
}

.active-filter-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef2f5;
    color: #536471;
    font-size: 0.88rem;
}

.active-filter-note a {
    font-weight: 800;
}

@media (max-width: 600px) {
    .status-filters {
        margin-left: -11px;
        margin-right: -11px;
        padding-left: 11px;
        padding-right: 11px;
    }

    .filter-chip {
        min-height: 38px;
        font-size: 0.82rem;
    }

    .active-filter-note {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Teléfono internacional */
.iti {
    width: 100%;
}

.iti input {
    width: 100%;
    min-height: 44px;
}

.iti__country-container {
    z-index: 20;
}

.iti__dropdown-content {
    max-width: min(420px, calc(100vw - 32px));
}

.field-error {
    color: #a11d1d;
    font-size: 0.82rem;
    font-weight: 700;
}


/* v0.7 - columnas, historial y cierre */
.orders-list-header,
.order-row {
    grid-template-columns: 105px 120px 1.05fr 1.45fr 140px 170px;
}

.order-code-cell {
    display: flex;
    align-items: center;
}

.history-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #e1e6ea;
    border-radius: 14px;
    background: white;
    box-shadow: 0 4px 14px rgba(26, 34, 43, 0.04);
}

.history-shortcut > div {
    display: grid;
    gap: 3px;
}

.history-shortcut span {
    color: #667785;
    font-size: 0.86rem;
}

.modal-open {
    overflow: hidden;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(10, 15, 20, 0.72);
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-card {
    width: min(480px, 100%);
    padding: 24px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.confirm-card h2 {
    margin-top: 4px;
}

.confirm-card p {
    color: #536471;
    line-height: 1.5;
}

.confirm-warning {
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff3d6;
    color: #705400;
    font-weight: 700;
    line-height: 1.4;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.history-search {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #e1e6ea;
    border-radius: 14px;
    background: white;
}

.history-list .orders-list-header,
.history-row {
    display: grid;
    grid-template-columns: 90px 105px 1.05fr 1.3fr 160px 145px 125px;
    gap: 16px;
    align-items: center;
}

.history-row {
    padding: 15px 18px;
    border-bottom: 1px solid #edf0f2;
}

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

.history-actions {
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

.mini-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.closed-banner {
    display: grid;
    gap: 4px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #dce2e7;
    border-radius: 12px;
    background: #f5f7f9;
}

.closed-banner span {
    color: #667785;
    font-size: 0.88rem;
}

@media (max-width: 950px) {
    .orders-list-header {
        display: none;
    }

    .order-row {
        grid-template-columns: 100px 120px 1fr auto;
    }

    .order-row > .order-cell:nth-of-type(2) {
        grid-column: 3;
    }

    .order-row > .order-cell:nth-of-type(3),
    .order-row > .order-cell:nth-of-type(4) {
        display: none;
    }

    .order-status-cell {
        grid-column: 4;
        grid-row: 1;
    }

    .history-list .orders-list-header {
        display: none;
    }

    .history-row {
        grid-template-columns: 90px 110px 1fr;
    }

    .history-row > div:nth-child(4),
    .history-row > div:nth-child(5) {
        display: none;
    }

    .history-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .history-shortcut {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-shortcut .secondary-button {
        width: 100%;
    }

    .order-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .order-main {
        grid-column: 1;
    }

    .order-code-cell {
        grid-column: 2;
        justify-content: flex-start;
    }

    .order-row > .order-cell:nth-of-type(2) {
        grid-column: 1 / -1;
    }

    .order-status-cell {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-actions .primary-button,
    .confirm-actions .secondary-button {
        width: 100%;
    }

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

    .history-row > div:nth-child(3) {
        grid-column: 1 / -1;
    }

    .history-actions {
        grid-column: 1 / -1;
    }
}


/* v0.8 - prioridad, vencimientos y estados visuales */

.urgent-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 4px;
    padding: 14px;
    border: 1px solid #e4b7b7;
    border-radius: 12px;
    background: #fff8f8;
    cursor: pointer;
}

.urgent-toggle input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin: 2px 0 0;
}

.urgent-toggle span {
    display: grid;
    gap: 4px;
}

.urgent-toggle small {
    color: #6f6666;
    font-weight: 500;
    line-height: 1.35;
}

.urgent-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fde8e8;
    color: #a61b1b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.urgent-row {
    box-shadow: inset 4px 0 0 #c62828;
}

.urgent-row:hover {
    background: #fffafa;
}

.urgent-filter {
    border-color: #e4b7b7;
    color: #9f2020;
}

.urgent-filter.active {
    background: #a61b1b;
    border-color: #a61b1b;
    color: white;
}

/* Colores de estados */
.status-recibido {
    background: #eef2f5;
    color: #465661;
}

.status-en-evaluacion {
    background: #f0eafd;
    color: #6241a3;
}

.status-en-reparacion {
    background: #e5f0ff;
    color: #215f9f;
}

.status-esperando-autorizacion {
    background: #fff1cf;
    color: #7a5900;
}

.status-listo-para-retiro {
    background: #e2f5e8;
    color: #23683a;
}

.status-entregado {
    background: #dcefe2;
    color: #1f5f34;
}

/* En los chips, mantener un borde visual asociado al estado */
.filter-chip.status-recibido { border-color: #cfd8de; }
.filter-chip.status-en-evaluacion { border-color: #d5c7ef; }
.filter-chip.status-en-reparacion { border-color: #bed7f5; }
.filter-chip.status-esperando-autorizacion { border-color: #ecd28e; }
.filter-chip.status-listo-para-retiro { border-color: #bcdcc5; }

/* Alertas de fecha/hora de entrega */
.delivery-cell {
    border-radius: 9px;
    padding: 8px 10px;
    margin: -8px -10px;
}

.delivery-cell small,
.delivery-note {
    display: block;
    margin-top: 3px;
    font-size: 0.75rem;
    font-weight: 750;
}

.delivery-soon {
    background: #fff4c7;
    color: #705600;
}

.delivery-overdue {
    background: #fde6e6;
    color: #9b1c1c;
}

.delivery-inline {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 8px;
    font-weight: 750;
}

.delivery-inline.delivery-normal {
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 600px) {
    .urgent-toggle {
        padding: 12px;
    }
}


/* v0.8.1 - compactación, jerarquía y filtros por plazo */

.filter-group {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.filter-label {
    padding-left: 2px;
    color: #6a7883;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.due-filter-group {
    margin-top: 2px;
}

.due-filters .filter-chip {
    min-height: 36px;
    padding: 0 11px;
}

.filter-chip.active-subtle {
    border-color: #aebbc4;
    background: #eef2f5;
    color: #33434f;
}

.filter-chip.due-overdue {
    border-color: #efbcbc;
    color: #9d1f1f;
}

.filter-chip.due-overdue.active {
    background: #a61b1b;
    border-color: #a61b1b;
    color: white;
}

.filter-chip.due-soon {
    border-color: #ead18a;
    color: #725600;
}

.filter-chip.due-soon.active {
    background: #c18a00;
    border-color: #c18a00;
    color: white;
}

.filter-chip.due-normal {
    border-color: #bdd9c4;
    color: #28633a;
}

.filter-chip.due-normal.active {
    background: #2d7343;
    border-color: #2d7343;
    color: white;
}

.search-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}

.search-form,
.compact-qr-search {
    min-height: 0;
    padding: 16px;
}

.compact-qr-search {
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 190px;
}

.compact-qr-search .qr-scan-button {
    width: 100%;
    min-height: 46px;
    margin: 0;
}

.order-number {
    color: #667785;
    font-size: 0.82rem;
    font-weight: 750;
}

.code-pill-primary {
    padding: 6px 9px;
    background: #e8eef3;
    color: #263640;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.09em;
}

.urgent-row {
    background: #fff8f8;
}

.urgent-row:hover {
    background: #fff1f1;
}

.delivery-date {
    display: block;
}

.delivery-time {
    display: block;
    margin-top: 2px;
    font-size: 0.84rem;
    font-weight: 750;
}

@media (max-width: 700px) {
    .search-panel {
        grid-template-columns: 1fr;
    }

    .compact-qr-search {
        width: 100%;
    }

    .compact-qr-search .qr-scan-button {
        width: 100%;
    }

    .filter-group {
        margin-bottom: 10px;
    }
}


/* =========================================================
   v0.9 - Menú principal, Configuración y tema
   ========================================================= */

.brand {
    display: grid;
    gap: 1px;
}

.brand-name {
    font-size: 1.02rem;
    line-height: 1.1;
}

.brand small {
    color: #7a8994;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.main-menu-heading {
    max-width: 760px;
    margin: 56px auto 28px;
    text-align: center;
}

.main-menu-heading h1 {
    margin: 4px 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.launcher-grid {
    width: min(850px, 100%);
    margin: 0 auto 64px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.launcher-card {
    min-height: 210px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr auto;
    gap: 18px;
    padding: 28px;
    border: 1px solid #e0e5e9;
    border-radius: 20px;
    background: white;
    box-shadow: 0 8px 28px rgba(25, 35, 44, 0.06);
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.launcher-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 13px 34px rgba(25, 35, 44, 0.10);
}

.launcher-card h2 {
    margin: 0 0 8px;
    font-size: 1.45rem;
}

.launcher-card p {
    margin: 0;
    color: #667785;
    line-height: 1.5;
}

.launcher-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #edf2f6;
    font-size: 1.45rem;
    font-weight: 900;
}

.launcher-metrics {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #edf0f2;
}

.launcher-metrics strong {
    font-size: 1.65rem;
}

.launcher-metrics span {
    color: #667785;
    font-size: 0.88rem;
}

.launcher-alert {
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fde8e8;
    color: #a61b1b !important;
    font-weight: 800;
}

.launcher-arrow {
    grid-column: 1 / -1;
    justify-self: end;
    align-self: end;
    font-size: 1.5rem;
    font-weight: 800;
}

.launcher-orders .launcher-icon { background: #e5f0ff; color: #215f9f; }
.launcher-delivered .launcher-icon { background: #e2f5e8; color: #23683a; }
.launcher-new .launcher-icon { background: #eef2f5; color: #263640; }
.launcher-settings .launcher-icon { background: #f0eafd; color: #6241a3; }

.settings-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding-bottom: 60px;
}

.settings-card {
    padding: 24px;
    border: 1px solid #e1e6ea;
    border-radius: 16px;
    background: white;
    box-shadow: 0 5px 18px rgba(26, 34, 43, 0.05);
}

.settings-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
}

.settings-card-heading h2 {
    margin: 0 0 4px;
}

.settings-card-heading p {
    margin: 0;
    color: #667785;
    font-size: 0.88rem;
    line-height: 1.4;
}

.settings-card-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eef2f5;
    font-weight: 900;
}

.settings-saved {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #b9dcc4;
    border-radius: 10px;
    background: #e7f5eb;
    color: #23683a;
    font-weight: 800;
}

.future-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid #edf0f2;
}

.future-setting > div {
    display: grid;
    gap: 3px;
}

.future-setting span {
    color: #70808b;
    font-size: 0.82rem;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.subscription-summary {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.subscription-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid #edf0f2;
}

.subscription-summary span {
    color: #6c7a85;
    font-size: 0.85rem;
}

.subscription-active {
    color: #23683a;
}

.settings-note {
    margin: 14px 0 0;
    color: #6d7b86;
    font-size: 0.82rem;
    line-height: 1.5;
}

.settings-data-card {
    grid-column: 1 / -1;
}

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

.export-option {
    position: relative;
    display: grid;
    gap: 5px;
    min-height: 120px;
    padding: 18px;
    border: 1px solid #dce2e7;
    border-radius: 12px;
    text-decoration: none;
    background: #fafbfc;
}

.export-option:hover {
    border-color: #aebbc4;
}

.export-option span {
    color: #667785;
    font-size: 0.86rem;
    line-height: 1.45;
}

.export-option small {
    position: absolute;
    right: 14px;
    top: 14px;
    padding: 4px 6px;
    border-radius: 6px;
    background: #e9eef2;
    color: #556571;
    font-weight: 800;
}

.settings-save-bar {
    grid-column: 1 / -1;
    position: sticky;
    bottom: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid #dbe1e5;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 30px rgba(25, 35, 44, 0.12);
    backdrop-filter: blur(10px);
}

.settings-save-bar span {
    color: #63727d;
    font-size: 0.82rem;
}

/* Tema oscuro */
html[data-resolved-theme="dark"] {
    color-scheme: dark;
    background: #11161b;
}

html[data-resolved-theme="dark"] body {
    background: #11161b;
    color: #e8edf1;
}

html[data-resolved-theme="dark"] .topbar,
html[data-resolved-theme="dark"] .order-card,
html[data-resolved-theme="dark"] .form-card,
html[data-resolved-theme="dark"] .detail-card,
html[data-resolved-theme="dark"] .empty-state,
html[data-resolved-theme="dark"] .photos-section,
html[data-resolved-theme="dark"] .worklog-section,
html[data-resolved-theme="dark"] .launcher-card,
html[data-resolved-theme="dark"] .settings-card,
html[data-resolved-theme="dark"] .history-shortcut,
html[data-resolved-theme="dark"] .history-search,
html[data-resolved-theme="dark"] .orders-list,
html[data-resolved-theme="dark"] .confirm-card {
    background: #1b2229;
    border-color: #303a43;
    color: #e8edf1;
}

html[data-resolved-theme="dark"] .topbar {
    border-bottom-color: #303a43;
}

html[data-resolved-theme="dark"] input,
html[data-resolved-theme="dark"] textarea,
html[data-resolved-theme="dark"] select {
    background: #12181e;
    border-color: #3a4650;
    color: #eef2f5;
}

html[data-resolved-theme="dark"] .secondary-button {
    background: #222b32;
    border-color: #3c4852;
    color: #eef2f5;
}

html[data-resolved-theme="dark"] .primary-button {
    background: #eef2f5;
    color: #151b20;
}

html[data-resolved-theme="dark"] .muted,
html[data-resolved-theme="dark"] .field-help,
html[data-resolved-theme="dark"] .launcher-card p,
html[data-resolved-theme="dark"] .settings-card-heading p,
html[data-resolved-theme="dark"] .settings-note,
html[data-resolved-theme="dark"] .future-setting span,
html[data-resolved-theme="dark"] .settings-save-bar span {
    color: #a3afb8;
}

html[data-resolved-theme="dark"] .back-link,
html[data-resolved-theme="dark"] .eyebrow {
    color: #b0bcc5;
}

html[data-resolved-theme="dark"] .export-option,
html[data-resolved-theme="dark"] .check-row {
    background: #151c22;
    border-color: #36414a;
}

html[data-resolved-theme="dark"] .settings-save-bar {
    background: rgba(27, 34, 41, 0.94);
    border-color: #3a4650;
}

html[data-resolved-theme="dark"] .urgent-row {
    background: #2a1d1f;
}

html[data-resolved-theme="dark"] .order-code {
    background: #151c22;
    border-color: #36414a;
}

@media (max-width: 760px) {
    .launcher-grid,
    .settings-layout,
    .export-grid {
        grid-template-columns: 1fr;
    }

    .launcher-card {
        min-height: 175px;
    }

    .settings-data-card,
    .settings-save-bar {
        grid-column: 1;
    }

    .settings-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-save-bar .primary-button {
        width: 100%;
    }

    .topbar-inner {
        align-items: flex-start;
        padding: 12px 0;
    }

    .top-actions {
        justify-content: flex-end;
    }
}


/* =========================================================
   v1.0 - Tipos de trabajo, país y análisis
   ========================================================= */

.field-title {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.work-type-field {
    display: grid;
    gap: 9px;
}

.work-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-type-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    padding: 9px 11px;
    border: 1px solid #d8dfe4;
    border-radius: 10px;
    background: #fafbfc;
    cursor: pointer;
}

.work-type-option:hover {
    border-color: #aebbc4;
}

.work-type-option input {
    width: 17px;
    height: 17px;
    margin: 0;
}

.work-type-option span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.88rem;
    font-weight: 700;
}

.work-type-option small {
    color: #7b8993;
    font-size: 0.68rem;
}

.work-type-option.inactive {
    opacity: 0.58;
}

.category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: #edf2f6;
    color: #425461;
    font-size: 0.76rem;
    font-weight: 800;
}

.empty-config-note {
    padding: 12px 14px;
    border: 1px dashed #cbd4da;
    border-radius: 10px;
    color: #687985;
    background: #fafbfc;
    font-size: 0.86rem;
}

.empty-config-note a {
    font-weight: 800;
}

.settings-work-types {
    grid-column: 1 / -1;
}

.category-create-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 14px;
}

.settings-category-list {
    display: grid;
    gap: 7px;
}

.settings-category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e2e7ea;
    border-radius: 10px;
    background: #fafbfc;
}

.settings-category-row.inactive {
    opacity: 0.58;
}

.category-rename-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.history-tabs {
    display: flex;
    gap: 6px;
    margin: -4px 0 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e6ea;
}

.history-tab {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 9px;
    color: #63737f;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.history-tab:hover {
    background: #eef2f5;
}

.history-tab.active {
    background: #263640;
    color: white;
}

.analysis-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid #e1e6ea;
    border-radius: 14px;
    background: white;
}

.analysis-filter-actions {
    display: flex;
    gap: 7px;
    padding-bottom: 1px;
}

.analysis-note {
    margin-bottom: 18px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #f5f7f9;
    color: #647581;
    font-size: 0.82rem;
    line-height: 1.45;
}

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

.metric-card {
    display: grid;
    gap: 7px;
    padding: 18px;
    border: 1px solid #e1e6ea;
    border-radius: 14px;
    background: white;
    box-shadow: 0 4px 15px rgba(26, 34, 43, 0.04);
}

.metric-card span {
    color: #71808b;
    font-size: 0.78rem;
    font-weight: 750;
}

.metric-card strong {
    font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.analysis-insights,
.analysis-table-card {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #e1e6ea;
    border-radius: 14px;
    background: white;
}

.analysis-insights h2 {
    margin-top: 0;
}

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

.insight-card {
    display: grid;
    gap: 6px;
    min-height: 110px;
    padding: 14px;
    border-radius: 11px;
    background: #f6f8f9;
}

.insight-card > span {
    color: #70808b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.insight-card strong {
    align-self: end;
}

.insight-card small {
    color: #657681;
}

.analysis-table {
    overflow-x: auto;
}

.analysis-table-header,
.analysis-table-row {
    min-width: 720px;
    display: grid;
    grid-template-columns: 1.5fr .65fr 1fr 1fr 1fr;
    gap: 14px;
    align-items: center;
    padding: 11px 12px;
}

.analysis-table-header {
    border-radius: 8px;
    background: #f0f3f5;
    color: #61717c;
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
}

.analysis-table-row {
    border-bottom: 1px solid #edf0f2;
    font-size: 0.87rem;
}

.analysis-footnote {
    margin: 14px 0 0;
    color: #75838d;
    font-size: 0.77rem;
    line-height: 1.45;
}

/* Dark mode v1.0 */
html[data-resolved-theme="dark"] .work-type-option,
html[data-resolved-theme="dark"] .settings-category-row,
html[data-resolved-theme="dark"] .analysis-filters,
html[data-resolved-theme="dark"] .metric-card,
html[data-resolved-theme="dark"] .analysis-insights,
html[data-resolved-theme="dark"] .analysis-table-card {
    background: #1b2229;
    border-color: #303a43;
}

html[data-resolved-theme="dark"] .empty-config-note,
html[data-resolved-theme="dark"] .analysis-note,
html[data-resolved-theme="dark"] .insight-card,
html[data-resolved-theme="dark"] .analysis-table-header {
    background: #151c22;
    border-color: #36414a;
    color: #aab5bd;
}

html[data-resolved-theme="dark"] .category-badge {
    background: #2a343c;
    color: #dce4e9;
}

html[data-resolved-theme="dark"] .history-tabs {
    border-color: #303a43;
}

html[data-resolved-theme="dark"] .history-tab:hover {
    background: #222b32;
}

html[data-resolved-theme="dark"] .history-tab.active {
    background: #eef2f5;
    color: #151b20;
}

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

    .analysis-filter-actions {
        grid-column: 1 / -1;
    }

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

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

@media (max-width: 600px) {
    .category-create-row,
    .settings-category-row,
    .category-rename-form,
    .analysis-filters {
        grid-template-columns: 1fr;
    }

    .analysis-filter-actions {
        grid-column: 1;
        flex-direction: column;
    }

    .metric-grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .history-tabs {
        overflow-x: auto;
    }

    .history-tab {
        white-space: nowrap;
    }
}


/* v0.10.1 - reprogramación de entregas */
.reschedule-button {
    display: inline-flex;
    margin-top: 8px;
}

.reschedule-summary {
    display: grid;
    gap: 3px;
    margin-top: 10px;
    padding: 9px 11px;
    border-left: 3px solid #c18a00;
    background: #fff8e6;
    border-radius: 7px;
}

.reschedule-summary strong {
    font-size: 0.78rem;
}

.reschedule-summary span {
    color: #6f6550;
    font-size: 0.76rem;
}

.reschedule-history-card {
    margin-bottom: 20px;
}

.reschedule-history {
    display: grid;
    gap: 10px;
}

.reschedule-history-item {
    padding: 13px 14px;
    border: 1px solid #e2e7ea;
    border-radius: 10px;
    background: #fafbfc;
}

.reschedule-history-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    font-size: 0.78rem;
}

.reschedule-history-top span {
    color: #72818b;
}

.reschedule-change {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    font-size: 0.86rem;
}

.reschedule-history-item p {
    margin: 9px 0 0;
    color: #64747f;
    font-size: 0.82rem;
}

#reschedule-modal form {
    display: grid;
    gap: 14px;
}

html[data-resolved-theme="dark"] .reschedule-summary {
    background: #2a2517;
    border-left-color: #d5a62f;
}

html[data-resolved-theme="dark"] .reschedule-summary span {
    color: #c9bea3;
}

html[data-resolved-theme="dark"] .reschedule-history-item {
    background: #151c22;
    border-color: #36414a;
}

@media (max-width: 600px) {
    .reschedule-history-top {
        flex-direction: column;
        gap: 3px;
    }

    .reschedule-change {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}


/* v0.10.2 - reprogramación desde intervención */
.delivery-change-fields {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e2e7ea;
    border-radius: 11px;
    background: #fafbfc;
}

.delivery-change-fields[hidden] {
    display: none;
}

.delivery-change-current {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5eaed;
    font-size: 0.82rem;
}

.delivery-change-current span {
    color: #70808b;
}

html[data-resolved-theme="dark"] .delivery-change-fields {
    background: #151c22;
    border-color: #36414a;
}

html[data-resolved-theme="dark"] .delivery-change-current {
    border-color: #36414a;
}

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

    .delivery-change-current {
        grid-column: 1;
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   v0.10.3 · Sitio público + acceso
   ========================================================= */

.logout-form {
    display: inline-flex;
    margin: 0;
}

.public-site {
    margin: 0;
    min-height: 100vh;
    background: #f4f1ea;
    color: #17201c;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.public-site * {
    box-sizing: border-box;
}

.public-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.public-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(23, 32, 28, 0.09);
    background: rgba(244, 241, 234, 0.94);
}

.public-header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.public-brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #17201c;
    color: #f4f1ea;
    font-size: 1.05rem;
    font-weight: 800;
}

.public-brand > span:last-child {
    display: grid;
    gap: 1px;
}

.public-brand strong {
    font-size: 0.98rem;
    letter-spacing: -0.02em;
}

.public-brand small {
    color: #67716c;
    font-size: 0.68rem;
}

.public-header-link {
    color: #17201c;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 14px;
    border: 1px solid #cfd2cc;
    border-radius: 999px;
}

.public-header-link:hover {
    background: #17201c;
    border-color: #17201c;
    color: white;
}

.public-hero {
    position: relative;
    overflow: hidden;
    padding: 78px 0 86px;
}

.public-hero::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -190px;
    top: -180px;
    border-radius: 50%;
    border: 1px solid rgba(23, 32, 28, 0.08);
}

.public-hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -100px;
    top: -90px;
    border-radius: 50%;
    border: 1px solid rgba(23, 32, 28, 0.07);
}

.public-hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    align-items: center;
    gap: 72px;
}

.public-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: #e4eadf;
    color: #435749;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.public-hero-copy h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(3rem, 6vw, 5.6rem);
    line-height: 0.96;
    letter-spacing: -0.065em;
    font-weight: 760;
}

.public-hero-copy h1 span {
    color: #68786e;
}

.public-lead {
    max-width: 650px;
    margin: 28px 0 0;
    color: #56615c;
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.65;
}

.public-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 710px;
    margin-top: 44px;
}

.public-benefit {
    min-height: 96px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    padding: 15px;
    border-top: 1px solid #bec5bf;
}

.public-benefit strong {
    color: #8b948f;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.public-benefit span {
    max-width: 150px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
}

.public-login-card {
    position: relative;
    padding: 28px;
    border-radius: 24px;
    background: #17201c;
    color: white;
    box-shadow: 0 28px 70px rgba(24, 33, 29, 0.16);
}

.public-login-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.public-login-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #d9e3d2;
    color: #17201c;
    font-size: 1.15rem;
    font-weight: 800;
}

.public-login-card .eyebrow {
    margin: 0 0 3px;
    color: #9eaaa3;
    font-size: 0.65rem;
}

.public-login-card h2 {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

.public-login-intro {
    margin: 22px 0;
    color: #aeb8b2;
    font-size: 0.86rem;
    line-height: 1.5;
}

.public-login-form {
    display: grid;
    gap: 15px;
}

.public-login-form label {
    display: grid;
    gap: 7px;
    color: #dce2de;
    font-size: 0.72rem;
    font-weight: 700;
}

.public-login-form input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 13px;
    border: 1px solid #3d4943;
    border-radius: 11px;
    outline: none;
    background: #222c27;
    color: white;
    font: inherit;
}

.public-login-form input::placeholder {
    color: #738078;
}

.public-login-form input:focus {
    border-color: #a9bcae;
    box-shadow: 0 0 0 3px rgba(169, 188, 174, 0.12);
}

.public-login-button {
    width: 100%;
    min-height: 50px;
    margin-top: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 16px;
    border: 0;
    border-radius: 11px;
    background: #d9e3d2;
    color: #17201c;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
}

.public-login-button:hover {
    background: #e8eee4;
}

.public-login-button span {
    font-size: 1.2rem;
}

.public-login-footer {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 19px;
    color: #7f8c84;
    font-size: 0.65rem;
}

.public-login-message {
    margin: 0 0 15px;
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(217, 227, 210, 0.1);
    color: #dce5d8;
    font-size: 0.75rem;
}

.public-login-error {
    background: rgba(214, 92, 74, 0.13);
    color: #ffd6d0;
}

.public-what {
    padding: 88px 0 96px;
    background: #ffffff;
}

.public-section-heading {
    display: grid;
    grid-template-columns: 0.65fr 1.5fr 1fr;
    align-items: start;
    gap: 38px;
}

.public-section-heading .eyebrow {
    margin-top: 8px;
}

.public-section-heading h2 {
    margin: 0;
    max-width: 520px;
    color: #17201c;
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.public-section-heading > p:last-child {
    margin: 6px 0 0;
    color: #66716b;
    font-size: 0.93rem;
    line-height: 1.65;
}

.public-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 60px;
}

.public-feature-grid article {
    min-height: 250px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e4e7e3;
    border-radius: 18px;
    background: #f8f8f5;
}

.public-feature-grid article > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-bottom: auto;
    border-radius: 10px;
    background: #e4eadf;
    color: #35463b;
    font-weight: 800;
}

.public-feature-grid h3 {
    margin: 32px 0 8px;
    font-size: 1.05rem;
    letter-spacing: -0.025em;
}

.public-feature-grid p {
    margin: 0;
    color: #6b756f;
    font-size: 0.82rem;
    line-height: 1.55;
}

.public-final {
    padding: 86px 0;
    background: #dfe7d9;
}

.public-final-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 50px;
}

.public-final .eyebrow {
    margin: 0 0 13px;
    color: #617264;
}

.public-final h2 {
    margin: 0;
    color: #17201c;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.public-final a {
    flex: 0 0 auto;
    padding: 13px 16px;
    border-radius: 999px;
    background: #17201c;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 800;
}

.public-footer {
    padding: 24px 0;
    background: #17201c;
    color: #849088;
}

.public-footer .public-shell {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    font-size: 0.68rem;
}

.public-footer span:first-child {
    color: #e5ebe7;
    font-weight: 800;
}

@media (max-width: 900px) {
    .public-hero {
        padding-top: 55px;
    }

    .public-hero-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .public-login-card {
        max-width: 620px;
        width: 100%;
    }

    .public-section-heading {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .public-feature-grid {
        grid-template-columns: 1fr;
    }

    .public-feature-grid article {
        min-height: 190px;
    }

    .public-final-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .public-shell {
        width: min(100% - 28px, 1180px);
    }

    .public-header-inner {
        min-height: 68px;
    }

    .public-brand small {
        display: none;
    }

    .public-header-link {
        font-size: 0.7rem;
    }

    .public-hero {
        padding: 42px 0 60px;
    }

    .public-hero-copy h1 {
        font-size: clamp(2.75rem, 14vw, 4rem);
    }

    .public-benefits {
        grid-template-columns: 1fr;
        margin-top: 30px;
    }

    .public-benefit {
        min-height: 0;
        grid-template-columns: 36px 1fr;
        align-items: center;
        gap: 9px;
    }

    .public-login-card {
        padding: 22px;
        border-radius: 19px;
    }

    .public-what {
        padding: 64px 0;
    }

    .public-feature-grid {
        margin-top: 38px;
    }

    .public-final {
        padding: 62px 0;
    }

    .public-footer .public-shell {
        flex-direction: column;
        gap: 5px;
    }
}


/* =========================================================
   v0.10.4 · Multiempresa, registro y roles
   ========================================================= */

.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 4px 9px 4px 5px;
    border: 1px solid #d9dfe2;
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    background: white;
}

.account-chip > span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #17201c;
    color: white;
    font-size: .68rem;
    font-weight: 800;
}

.account-chip > div {
    display: grid;
    gap: 0;
}

.account-chip strong {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .67rem;
}

.account-chip small {
    color: #7a8780;
    font-size: .57rem;
}

.public-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-header-link-secondary {
    border-color: transparent;
    background: transparent;
}

.public-signup-link {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    padding: 14px 0 2px;
    border-top: 1px solid #344039;
    text-align: center;
}

.public-signup-link span {
    color: #87938c;
    font-size: .69rem;
}

.public-signup-link a {
    color: #d9e3d2;
    text-decoration: none;
    font-size: .76rem;
    font-weight: 800;
}

.public-final-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-final .public-final-login {
    background: transparent;
    color: #17201c;
    border: 1px solid rgba(23,32,28,.2);
}

.register-main {
    min-height: calc(100vh - 78px);
    display: grid;
    align-items: center;
    padding: 58px 0 70px;
}

.register-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .7fr);
    align-items: center;
    gap: 90px;
}

.register-copy h1 {
    margin: 0;
    font-size: clamp(3rem, 6vw, 5.4rem);
    line-height: .96;
    letter-spacing: -.065em;
}

.register-copy h1 span {
    color: #718078;
}

.register-copy > p {
    max-width: 610px;
    margin: 27px 0 0;
    color: #59655f;
    line-height: 1.65;
}

.register-points {
    display: grid;
    gap: 0;
    margin-top: 42px;
    max-width: 580px;
    border-top: 1px solid #c7cdc8;
}

.register-points > div {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #c7cdc8;
}

.register-points strong {
    color: #87928c;
    font-size: .68rem;
}

.register-points span {
    font-size: .82rem;
    font-weight: 700;
}

.register-card {
    padding: 29px;
    border-radius: 24px;
    background: #17201c;
    color: white;
    box-shadow: 0 28px 70px rgba(24,33,29,.16);
}

.register-card .eyebrow {
    margin: 0 0 6px;
    color: #97a39c;
}

.register-card h2 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -.035em;
}

.register-intro {
    margin: 10px 0 22px;
    color: #aeb8b2;
    font-size: .78rem;
    line-height: 1.5;
}

.register-form {
    display: grid;
    gap: 13px;
}

.register-form label {
    display: grid;
    gap: 6px;
    color: #dce2de;
    font-size: .7rem;
    font-weight: 700;
}

.register-form input,
.register-form select {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: 1px solid #3d4943;
    border-radius: 10px;
    outline: none;
    background: #222c27;
    color: white;
    font: inherit;
}

.register-form select option {
    color: #17201c;
    background: white;
}

.register-login-note {
    margin: 18px 0 0;
    color: #87938c;
    text-align: center;
    font-size: .7rem;
}

.register-login-note a {
    color: #d9e3d2;
    font-weight: 800;
    text-decoration: none;
}

.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 20px 0 30px;
    padding: 18px 20px;
    border: 1px solid #cddbc7;
    border-radius: 14px;
    background: #edf4e9;
}

.welcome-banner > div {
    display: grid;
    gap: 3px;
}

.welcome-banner .eyebrow {
    margin: 0 0 3px;
}

.welcome-banner strong {
    font-size: .95rem;
}

.welcome-banner span {
    color: #647167;
    font-size: .78rem;
}

.role-pill {
    align-self: flex-start;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .67rem;
    font-weight: 800;
}

.role-admin {
    background: #e4eadf;
    color: #405446;
}

.role-staff {
    background: #eef1f3;
    color: #5e6b73;
}

.permission-banner {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 18px;
    padding: 15px;
    border: 1px solid #d9dee1;
    border-radius: 12px;
    background: #f7f8f8;
}

.permission-lock {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #e7ebed;
}

.permission-banner strong {
    font-size: .78rem;
}

.permission-banner p {
    margin: 3px 0 0;
    color: #6d7a82;
    font-size: .72rem;
    line-height: 1.5;
}

.settings-card-heading {
    position: relative;
}

.locked-badge {
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef1f2;
    color: #727f86;
    font-size: .58rem;
    font-weight: 800;
    white-space: nowrap;
}

.settings-locked {
    position: relative;
    background: #f8f9f9;
}

.settings-locked input:disabled,
.settings-locked select:disabled,
.settings-locked button:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.locked-explanation {
    padding: 11px 12px;
    border-radius: 9px;
    background: #f0f2f3;
    color: #6c7980;
    font-size: .72rem;
    line-height: 1.5;
}

.user-create-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
}

.user-create-grid label {
    min-width: 0;
}

.user-create-grid button {
    min-height: 42px;
}

.business-user-list {
    display: grid;
    gap: 8px;
}

.business-user-row {
    display: grid;
    grid-template-columns: 34px minmax(140px, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e2e7ea;
    border-radius: 10px;
    background: #fafbfc;
}

.business-user-row.inactive {
    opacity: .62;
}

.business-user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #e4eadf;
    color: #405446;
    font-size: .75rem;
    font-weight: 800;
}

.business-user-info {
    display: grid;
    min-width: 0;
}

.business-user-info strong,
.business-user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-user-info strong {
    font-size: .76rem;
}

.business-user-info span {
    color: #7a878e;
    font-size: .65rem;
}

.user-role-label,
.user-status,
.current-user-tag {
    padding: 5px 7px;
    border-radius: 999px;
    background: #eef1f3;
    color: #68757c;
    font-size: .59rem;
    font-weight: 800;
}

.user-status.active {
    background: #e7f2e2;
    color: #4b6b45;
}

.current-user-tag {
    background: #17201c;
    color: white;
}

.account-readonly {
    display: grid;
    gap: 2px;
    padding: 11px 12px;
    margin-bottom: 13px;
    border-radius: 9px;
    background: #f3f5f5;
}

.account-readonly span {
    color: #7a878e;
    font-size: .63rem;
}

.account-readonly strong {
    font-size: .75rem;
}

.export-option-disabled {
    cursor: not-allowed;
    opacity: .55;
    filter: grayscale(.3);
}

html[data-resolved-theme="dark"] .account-chip {
    background: #151c22;
    border-color: #36414a;
}

html[data-resolved-theme="dark"] .permission-banner,
html[data-resolved-theme="dark"] .settings-locked,
html[data-resolved-theme="dark"] .business-user-row,
html[data-resolved-theme="dark"] .account-readonly,
html[data-resolved-theme="dark"] .locked-explanation {
    background: #151c22;
    border-color: #36414a;
}

@media (max-width: 1050px) {
    .user-create-grid {
        grid-template-columns: 1fr 1fr;
    }

    .register-grid {
        gap: 50px;
    }
}

@media (max-width: 900px) {
    .register-grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .register-card {
        max-width: 620px;
    }

    .account-chip > div {
        display: none;
    }

    .business-user-row {
        grid-template-columns: 34px minmax(130px, 1fr) auto;
    }

    .business-user-row .user-status,
    .business-user-row .current-user-tag,
    .business-user-row .user-toggle-button {
        grid-column: 2 / -1;
        justify-self: start;
    }
}

@media (max-width: 620px) {
    .public-header-actions {
        gap: 2px;
    }

    .public-header-link-secondary {
        display: none;
    }

    .public-final-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .public-final-actions a {
        text-align: center;
    }

    .register-main {
        padding: 38px 0 52px;
    }

    .register-copy h1 {
        font-size: clamp(2.8rem, 15vw, 4rem);
    }

    .register-card {
        padding: 22px;
    }

    .welcome-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-create-grid {
        grid-template-columns: 1fr;
    }

    .business-user-row {
        grid-template-columns: 34px 1fr;
    }

    .business-user-row > *:not(.business-user-avatar):not(.business-user-info) {
        grid-column: 2;
        justify-self: start;
    }
}


/* v0.10.5 · Apariencia personal por usuario */
.personal-setting-badge {
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e7efe3;
    color: #50664f;
    font-size: .58rem;
    font-weight: 800;
    white-space: nowrap;
}

html[data-resolved-theme="dark"] .personal-setting-badge {
    background: #263329;
    color: #c8dbc5;
}


/* v0.10.6 · Permiso de acceso a Análisis */
.analysis-permission-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f0f3f4;
    color: #5d6a72;
    font-size: .6rem;
    font-weight: 800;
    white-space: nowrap;
}

.analysis-permission-toggle input {
    margin: 0;
}

.analysis-permission-admin {
    padding: 5px 8px;
    border-radius: 999px;
    background: #e7f2e2;
    color: #4b6b45;
    font-size: .59rem;
    font-weight: 800;
    white-space: nowrap;
}

.history-tab-locked {
    cursor: not-allowed;
    opacity: .5;
    user-select: none;
}

html[data-resolved-theme="dark"] .analysis-permission-toggle {
    background: #202a30;
    color: #c0c9ce;
}

@media (max-width: 900px) {
    .analysis-permission-toggle,
    .analysis-permission-admin {
        grid-column: 2 / -1;
        justify-self: start;
    }
}


/* v0.10.7 · eliminación de usuarios secundarios */
.danger-button {
    border-color: #e0b8b1;
    color: #9d3f34;
}

.danger-button:hover {
    border-color: #c96054;
    background: #fff2ef;
    color: #7f2f27;
}

html[data-resolved-theme="dark"] .danger-button {
    border-color: #6b3c37;
    color: #efaaa1;
}

html[data-resolved-theme="dark"] .danger-button:hover {
    background: #321f1d;
    color: #ffd0ca;
}

/* v0.10.8 · Facturación externa e integraciones */
.integration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.integration-option {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border, #dfe5e1);
    border-radius: 14px;
    background: var(--surface-soft, rgba(127, 127, 127, .04));
}

.integration-option > div:nth-child(2) {
    display: grid;
    gap: 3px;
}

.integration-option strong {
    font-size: .86rem;
}

.integration-option span {
    color: var(--muted, #6e7872);
    font-size: .72rem;
    line-height: 1.35;
}

.integration-logo {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #dfe5e1);
    font-size: .7rem;
    font-weight: 900;
}

.billing-card {
    margin-top: 18px;
}

.billing-heading {
    align-items: flex-start;
}

.billing-status {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 850;
}

.billing-status.pending {
    background: #fff4d6;
    color: #886515;
}

.billing-status.registered {
    background: #e7f5eb;
    color: #2f7045;
}

.billing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
    gap: 22px;
    margin-top: 18px;
}

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

.billing-summary > div {
    display: grid;
    gap: 5px;
    padding: 13px;
    border-radius: 12px;
    background: var(--surface-soft, rgba(127, 127, 127, .05));
}

.billing-summary span {
    color: var(--muted, #6e7872);
    font-size: .68rem;
}

.billing-summary strong {
    font-size: .84rem;
}

.billing-summary button,
.billing-summary .field-help {
    grid-column: 1 / -1;
}

.billing-form {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border, #dfe5e1);
}

@media (max-width: 800px) {
    .integration-grid,
    .billing-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .integration-option {
        grid-template-columns: 42px 1fr;
    }

    .integration-option button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .billing-summary {
        grid-template-columns: 1fr;
    }
}

/* v0.10.9 - asignación, bandeja inteligente y análisis unificado */
.smart-priority-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 18px;
}

.smart-priority-guide span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid #e1e6ea;
    border-radius: 999px;
    background: #fff;
    color: #667680;
    font-size: .73rem;
    font-weight: 750;
}

.smart-priority-guide strong {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #24343e;
    color: #fff;
    font-size: .65rem;
}

.smart-orders-header,
.smart-order-row {
    grid-template-columns: 92px 105px 1.15fr 1.35fr 1fr 145px 165px;
    gap: 12px;
}

.smart-order-row.ready-row:not(.urgent-row) {
    background: #fafcfb;
    opacity: .86;
}

.smart-order-row.ready-row:not(.urgent-row):hover {
    opacity: 1;
}

.assignee-cell strong {
    color: #34444e;
}

.priority-hint {
    width: fit-content;
    margin-top: 3px;
    font-weight: 800;
}

.ready-hint { color: #3c7762 !important; }
.soon-hint { color: #9a6b12 !important; }
.overdue-hint { color: #a84238 !important; }

.assignment-section {
    margin-top: 18px;
}

.assignment-section + .assignment-section {
    margin-top: 42px;
    padding-top: 28px;
    border-top: 2px solid #e8ecef;
}

.assignment-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.assignment-heading h2 {
    margin: 2px 0 0;
}

.assignment-heading p {
    margin-bottom: 0;
}

.assignment-count {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    background: #253640;
    color: #fff;
    font-weight: 900;
}

.assignment-team .orders-list {
    box-shadow: none;
}

.assignment-team .smart-order-row {
    background: #fbfcfd;
}

.empty-inline {
    padding: 18px;
    border: 1px dashed #ccd5da;
    border-radius: 12px;
    color: #71808b;
    background: #fafbfc;
}

.smart-search-form {
    min-width: 0;
}

.assignee-filter {
    max-width: 320px;
    margin-top: 10px;
}

.assignee-form-field {
    display: grid;
    gap: 8px;
    padding: 15px;
    border: 1px solid #e1e6ea;
    border-radius: 12px;
    background: #f8fafb;
}

.assignment-readonly {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e7ea;
}

.assignment-readonly span,
.responsible-role {
    color: #71808b;
    font-size: .78rem;
}

.analysis-filters-unified {
    grid-template-columns: minmax(210px, 1.15fr) minmax(300px, 1.3fr) minmax(190px, .95fr) minmax(190px, .95fr);
    align-items: start;
}

.analysis-date-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
    align-items: end;
}

.analysis-date-range[hidden] {
    display: none;
}

.range-separator {
    align-self: center;
    padding-top: 22px;
    color: #7d8a93;
    font-weight: 900;
}

.analysis-filters-unified .analysis-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 2px;
}

.analysis-period-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -2px 0 12px;
    color: #71808b;
    font-size: .78rem;
}

.analysis-period-summary strong {
    color: #3e505b;
}

html[data-resolved-theme="dark"] .smart-priority-guide span,
html[data-resolved-theme="dark"] .assignee-form-field,
html[data-resolved-theme="dark"] .assignment-readonly,
html[data-resolved-theme="dark"] .empty-inline {
    background: #1b2229;
    border-color: #303a43;
}

html[data-resolved-theme="dark"] .assignment-section + .assignment-section {
    border-color: #303a43;
}

html[data-resolved-theme="dark"] .assignee-cell strong,
html[data-resolved-theme="dark"] .analysis-period-summary strong {
    color: #dbe3e8;
}

@media (max-width: 1180px) {
    .smart-orders-header,
    .smart-order-row {
        grid-template-columns: 82px 95px 1.1fr 1.2fr .9fr 130px 150px;
        gap: 9px;
    }

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

@media (max-width: 900px) {
    .smart-orders-header { display: none; }

    .smart-order-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 9px 14px;
        padding: 16px;
    }

    .smart-order-row .order-main { grid-column: 1; grid-row: 1; }
    .smart-order-row .code-cell { grid-column: 1; grid-row: 2; }
    .smart-order-row .client-cell { grid-column: 1; grid-row: 3; }
    .smart-order-row .work-cell { grid-column: 1; grid-row: 4; }
    .smart-order-row .assignee-cell { grid-column: 1; grid-row: 5; display: grid; }
    .smart-order-row .delivery-cell { grid-column: 1; grid-row: 6; display: grid; }
    .smart-order-row .order-status-cell {
        grid-column: 2;
        grid-row: 1 / span 6;
        align-self: start;
        flex-direction: column;
        align-items: flex-end;
    }

    .smart-order-row .order-cell strong,
    .smart-order-row .order-cell small {
        white-space: normal;
    }

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

    .analysis-filters-unified .analysis-filter-actions {
        grid-column: 1;
    }
}

@media (max-width: 600px) {
    .smart-priority-guide {
        gap: 6px;
    }

    .smart-priority-guide span {
        font-size: .68rem;
    }

    .analysis-date-range {
        grid-template-columns: 1fr;
    }

    .range-separator {
        display: none;
    }

    .analysis-filters-unified .analysis-filter-actions {
        flex-direction: column;
    }

    .assignment-heading {
        align-items: flex-start;
    }
}


.label-bluetooth-note {
    width: min(100% - 24px, 520px);
    margin: 8px auto 14px;
    text-align: center;
    color: var(--muted-text, #667085);
    font-size: 0.78rem;
}


/* ---------------------------------------------------------------
   Privacidad / Ley 21.719
   --------------------------------------------------------------- */
.privacy-retention-note {
    margin: 10px 0 0;
    color: #587064;
    font-size: 0.82rem;
    font-weight: 650;
}

.privacy-checkbox-cell {
    display: flex;
    justify-content: center;
}

.privacy-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #556772;
    font-size: 0.78rem;
    font-weight: 750;
    cursor: pointer;
}

.privacy-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #274f3b;
    cursor: pointer;
}

.privacy-check.done {
    color: #587064;
    cursor: default;
}

.privacy-check.done input {
    cursor: default;
}

.privacy-admin-only {
    font-size: 0.72rem;
}

@media (max-width: 950px) {
    .history-row > .privacy-checkbox-cell {
        display: flex;
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}


.privacy-anonymize-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.privacy-checkbox-cell .privacy-check {
    padding: 4px;
}

.privacy-checkbox-cell .privacy-check input {
    width: 18px;
    height: 18px;
}


/* Confirmación de anonimización */
.privacy-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    place-items: center;
    padding: 20px;
}

.privacy-confirm-modal[aria-hidden="false"] {
    display: grid;
}

.privacy-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 22, 18, .60);
    backdrop-filter: blur(4px);
}

.privacy-confirm-card {
    position: relative;
    z-index: 1;
    width: min(540px, 100%);
    padding: 26px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 26px 80px rgba(0,0,0,.26);
}

.privacy-confirm-card h2 {
    margin: 0 0 8px;
}

.privacy-confirm-data {
    display: grid;
    gap: 11px;
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #dfe5df;
    border-radius: 12px;
    background: #f7f9f6;
}

.privacy-confirm-data div {
    display: grid;
    gap: 3px;
}

.privacy-confirm-data span {
    color: #76827b;
    font-size: .72rem;
}

.privacy-confirm-data strong {
    color: #1c2b22;
    font-size: .9rem;
}

.privacy-modal-open {
    overflow: hidden;
}


/* v125 · permisos STAFF y trazabilidad */
.staff-permissions {
    display: grid;
    gap: 8px;
    min-width: 250px;
}

.commercial-permission-box {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr);
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line, #dfe5df);
    border-radius: 10px;
    background: rgba(127, 143, 132, .06);
}

.commercial-permission-title {
    grid-column: 1 / -1;
    font-size: .72rem;
    font-weight: 850;
    color: var(--muted, #68746d);
}

.commercial-permission-box .save-operational-permissions {
    grid-column: 1 / -1;
}

.percent-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.percent-input input {
    min-width: 0;
}

.percent-input span {
    font-weight: 800;
    color: var(--muted, #68746d);
}

.read-only-badge {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef1ee;
    color: #647168;
    font-size: .72rem;
    font-weight: 850;
}

.read-only-panel {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid #dfe5df;
    border-radius: 11px;
    background: #f7f9f6;
}

.read-only-panel span {
    color: #718078;
    font-size: .78rem;
}

.trace-user {
    color: #6d7b73;
    font-size: .72rem;
    font-weight: 700;
}

.traceability-card {
    margin-top: 20px;
}

.traceability-list {
    display: grid;
}

.traceability-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid #e8ece8;
}

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

.traceability-row > div:first-child {
    display: grid;
    gap: 4px;
}

.traceability-row span {
    color: #718078;
    font-size: .78rem;
}

.traceability-meta {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 3px;
    text-align: right;
    font-size: .76rem;
}

@media (max-width: 760px) {
    .commercial-permission-box {
        grid-template-columns: 1fr;
    }

    .commercial-permission-title,
    .commercial-permission-box .save-operational-permissions {
        grid-column: 1;
    }

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

    .traceability-meta {
        justify-items: start;
        text-align: left;
    }
}


/* v126 · Configuración privada de STAFF */
.staff-config-modal {
    position: fixed; inset: 0; z-index: 2200;
    display: none; place-items: center; padding: 20px;
}
.staff-config-modal[aria-hidden="false"] { display: grid; }
.staff-config-backdrop {
    position: absolute; inset: 0;
    background: rgba(14,22,18,.60);
    backdrop-filter: blur(4px);
}
.staff-config-card {
    position: relative; z-index: 1;
    width: min(620px,100%);
    max-height: min(760px,calc(100vh - 40px));
    overflow-y: auto;
    padding: 26px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 26px 80px rgba(0,0,0,.26);
}
.staff-config-heading {
    display:flex; justify-content:space-between;
    align-items:flex-start; gap:18px; margin-bottom:20px;
}
.staff-config-heading h2 { margin:0 0 5px; }
.modal-close-button {
    width:34px; height:34px; flex:0 0 34px;
    display:grid; place-items:center;
    border:0; border-radius:999px;
    background:#eef1ee; color:#35443b;
    font-size:1.3rem; cursor:pointer;
}
.staff-config-section {
    display:grid; gap:12px;
    padding:18px 0;
    border-top:1px solid #e8ece8;
}
.staff-config-section h3 { margin:0; font-size:.93rem; }
.staff-config-toggle {
    display:grid; grid-template-columns:20px minmax(0,1fr);
    gap:11px; align-items:start;
    padding:12px;
    border:1px solid #dfe5df;
    border-radius:11px;
    background:#f8faf8;
    cursor:pointer;
}
.staff-config-toggle input { width:18px; height:18px; margin:2px 0 0; }
.staff-config-toggle > span { display:grid; gap:4px; }
.staff-config-toggle strong { font-size:.8rem; }
.staff-config-toggle small {
    color:#6e7b73; font-size:.72rem; line-height:1.45;
}
.staff-config-description {
    margin:0; font-size:.76rem; line-height:1.5;
}
.staff-commercial-grid {
    display:grid; grid-template-columns:1fr 1fr; gap:12px;
}
.staff-percent-field {
    display:flex; align-items:center; gap:7px;
}
.staff-percent-field input { min-width:0; }
.staff-percent-field span {
    font-weight:850; color:#68766e;
}
.staff-config-notice {
    margin-top:5px; padding:12px;
    border-radius:10px;
    background:#eef2ed; color:#57665d;
    font-size:.73rem; line-height:1.5;
}
.staff-config-actions {
    display:flex; justify-content:flex-end;
    gap:8px; margin-top:20px;
}
.staff-config-modal-open { overflow:hidden; }

@media (max-width:620px) {
    .staff-commercial-grid { grid-template-columns:1fr; }
    .staff-config-actions { flex-direction:column-reverse; }
    .staff-config-actions button { width:100%; }
}

.settings-tariff-card{grid-column:1/-1}.tariff-import-actions,.tariff-upload-form,.tariff-row-actions,.tariff-confirm-import{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.tariff-upload-form{flex:1 1 420px}.tariff-upload-form input{flex:1}.tariff-manual-card{margin:12px 0 18px;padding:14px;border:1px solid #dfe5df;border-radius:12px;background:#f8faf8}.tariff-manual-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}.tariff-table-wrap{overflow-x:auto;border:1px solid #e1e6e1;border-radius:12px}.tariff-table{width:100%;min-width:860px;border-collapse:collapse;background:#fff}.tariff-table th,.tariff-table td{padding:11px 12px;border-bottom:1px solid #edf0ed;text-align:left;font-size:.74rem}.tariff-table th{background:#f6f8f6;color:#68766e}.tariff-inactive{opacity:.55}.tariff-danger-zone{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-top:24px;padding:15px;border:1px solid #efc6c2;border-radius:12px;background:#fff6f4}.tariff-delete-modal{position:fixed;inset:0;z-index:2300;display:none;place-items:center;padding:20px}.tariff-delete-modal[aria-hidden=false]{display:grid}.tariff-delete-backdrop{position:absolute;inset:0;background:rgba(14,22,18,.62)}.tariff-delete-card{position:relative;z-index:1;width:min(500px,100%);padding:25px;border-radius:18px;background:#fff}.tariff-import-summary{display:grid;grid-template-columns:repeat(2,minmax(0,180px));gap:12px;margin-bottom:18px}.tariff-import-summary>div,.tariff-reference-card>div{padding:12px;border:1px solid #e0e5df;border-radius:10px;background:#fff}.tariff-order-picker{display:grid;gap:12px;padding:16px;border:1px solid #dfe5df;border-radius:13px;background:#f8faf8}.tariff-reference-card{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.tariff-reference-card span{display:block;color:#728078;font-size:.68rem}@media(max-width:800px){.tariff-manual-form{grid-template-columns:1fr 1fr}.tariff-reference-card{grid-template-columns:1fr}}@media(max-width:520px){.tariff-manual-form{grid-template-columns:1fr}.tariff-upload-form{flex-direction:column;align-items:stretch}}

/* v128 */
.tariff-source-note{margin:0 0 16px;padding:13px 14px;border:1px solid #dce5dc;border-radius:11px;background:#f4f7f3;color:#536159;font-size:.76rem;line-height:1.5}.tariff-work-type-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.tariff-work-type-chips span{display:inline-flex;padding:6px 9px;border-radius:999px;background:#fff;border:1px solid #dce3dc;font-size:.7rem;font-weight:750}.tariff-file-picker{flex:1;display:grid;gap:5px}.tariff-file-picker small{color:#6e7b73;font-size:.68rem}.manual-price-toggle{display:inline-flex;align-items:center;gap:8px;font-size:.75rem;font-weight:750}.manual-price-toggle input{width:17px;height:17px}.tariff-success-banner{margin-top:10px}

/* v129 */
.standalone-action-form { display: none; }


/* v130 · múltiples trabajos */
.multi-work-section,
.intervention-work-picker {
    display:grid;
    gap:12px;
    padding:16px;
    border:1px solid #dfe5df;
    border-radius:14px;
    background:#f8faf8;
}
.compact-heading { align-items:center; margin-bottom:0; }
.multi-work-list { display:grid; gap:10px; }
.multi-work-row {
    position:relative;
    display:grid;
    gap:10px;
    padding:14px 42px 14px 14px;
    border:1px solid #e0e6e0;
    border-radius:12px;
    background:#fff;
}
.multi-work-row-number {
    color:#637169;
    font-size:.69rem;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.05em;
}
.multi-work-fields {
    display:grid;
    grid-template-columns:1fr 1.3fr .75fr;
    gap:10px;
}
.multi-work-reference {
    padding:8px 10px;
    border-radius:9px;
    background:#f3f6f2;
    color:#67756d;
    font-size:.71rem;
}
.remove-work-row {
    position:absolute;
    top:12px;
    right:12px;
    width:27px;
    height:27px;
    display:grid;
    place-items:center;
    border:0;
    border-radius:999px;
    background:#eef1ee;
    color:#59675f;
    cursor:pointer;
}
.multi-work-total {
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
    padding:12px 14px;
    border-radius:11px;
    background:#17241c;
    color:#fff;
}
.intervention-work-picker { margin:6px 0; }
.intervention-work-total { background:#eef2ed; color:#29372f; }
.order-work-items-card { margin-top:18px; }
.work-items-total { font-size:1.1rem; }
.order-work-items-list { display:grid; }
.order-work-item {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:16px;
    padding:13px 0;
    border-bottom:1px solid #e8ece8;
}
.order-work-item:last-child { border-bottom:0; }
.order-work-item > div:first-child { display:grid; gap:4px; }
.order-work-item strong span { color:#68766e; font-weight:700; }
.order-work-item small { color:#75827a; font-size:.7rem; }
.order-work-item-pricing {
    display:grid;
    justify-items:end;
    align-content:start;
    gap:2px;
}
.order-work-item-pricing span,
.order-work-item-pricing small { color:#75827a; font-size:.68rem; }
.log-work-items { display:grid; gap:6px; margin-top:6px; }
.log-work-items > div {
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:8px 10px;
    border-radius:8px;
    background:#f5f7f4;
    font-size:.75rem;
}
@media(max-width:800px) {
    .multi-work-fields { grid-template-columns:1fr; }
    .order-work-item { grid-template-columns:1fr; }
    .order-work-item-pricing { justify-items:start; }
}


/* v131 · Tipo de trabajo editable fuera de tarifario */
.work-type-control {
    display: grid;
    gap: 6px;
}

.work-type-control > .work-type-label {
    font-size: inherit;
}

.work-type-control .manual-work-name[hidden],
.work-variant-control[hidden] {
    display: none !important;
}

.work-type-control .manual-work-name:not([hidden]) {
    display: block;
    width: 100%;
}

.work-manual-toggle {
    width: fit-content;
}

/* v134 · referencia única de precios */
.multi-work-reference {
    font-weight: 700;
}


/* v135 · descuentos STAFF */
.staff-discount-field {
    min-width: 110px;
}

.staff-discount-field select {
    width: 100%;
}

.special-discount-request {
    padding: 10px 12px;
    border: 1px dashed #d8dfd8;
    border-radius: 10px;
    background: #fafbfa;
}

.special-discount-request summary {
    cursor: pointer;
    font-size: .73rem;
    font-weight: 800;
}

.special-discount-request-body {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.discount-pending-label {
    color: #926b18 !important;
    font-weight: 800;
}

.discount-approval-card {
    border-color: #e6d59a;
    background: #fffdf5;
}

.discount-approval-list {
    display: grid;
}

.discount-approval-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    gap: 18px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #eee6c9;
}

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

.discount-approval-row > div:first-child {
    display: grid;
    gap: 4px;
}

.discount-approval-row span {
    color: #746d57;
    font-size: .72rem;
}

.discount-approval-analysis {
    display: grid;
    gap: 3px;
}

.discount-approval-actions {
    display: flex;
    gap: 7px;
}

.discount-approval-actions form {
    margin: 0;
}

@media (max-width: 800px) {
    .discount-approval-row {
        grid-template-columns: 1fr;
    }

    .discount-approval-actions {
        justify-content: flex-start;
    }
}


/* v137 · solicitudes de descuento prioritarias para ADMIN */
.special-discount-list-alert {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 18px;
    align-items: center;
    margin: 10px 0 12px;
    padding: 11px 12px;
    border: 1px solid #e5d391;
    border-radius: 11px;
    background: #fffaf0;
}

.special-discount-list-copy {
    display: grid;
    gap: 3px;
}

.special-discount-list-eyebrow {
    color: #8b6919;
    font-size: .65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.special-discount-list-numbers {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
}

.special-discount-list-numbers span {
    color: #766d54;
    font-size: .68rem;
}

.special-discount-list-numbers strong {
    color: #3e3520;
    font-size: .78rem;
}

.special-discount-more {
    grid-column: 1 / -1;
    color: #776a46;
    font-size: .68rem;
    font-weight: 750;
}

@media (max-width: 760px) {
    .special-discount-list-alert {
        grid-template-columns: 1fr;
    }

    .special-discount-list-numbers {
        justify-items: start;
        text-align: left;
    }
}


/* v139 · autorización presencial ADMIN */
.same-device-approval {
    margin-top:7px;
    width:min(380px,100%);
    padding:9px 11px;
    border:1px dashed #d7c579;
    border-radius:10px;
    background:#fffdf4;
    text-align:left;
}
.same-device-approval summary {
    cursor:pointer;
    color:#6f591b;
    font-size:.71rem;
    font-weight:850;
}
.same-device-approval-form {
    display:flex;
    gap:8px;
    align-items:end;
    margin-top:10px;
}
.same-device-approval-form label { flex:1; }
.same-device-approval-form input { width:100%; }
.same-device-approval > small {
    display:block;
    margin-top:7px;
    color:#786f58;
}
.inline-error-message,
.inline-success-message {
    margin:0 0 14px;
    padding:11px 13px;
    border-radius:10px;
    font-size:.76rem;
    font-weight:750;
}
.inline-error-message {
    border:1px solid #e3b7b7;
    background:#fff5f5;
}
.inline-success-message {
    border:1px solid #b9d7c1;
    background:#f4fbf5;
}
@media(max-width:620px) {
    .same-device-approval-form { display:grid; }
}


/* v140 · motor de notificaciones */
.notification-channel-field {
    margin-bottom: 18px;
}

.notification-settings-events {
    display: grid;
    gap: 8px;
    margin: 10px 0 14px;
}

.notification-history-card {
    grid-column: 1 / -1;
}

.notification-history-list {
    display: grid;
    gap: 9px;
}

.notification-history-row {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid #e2e6e1;
    border-radius: 11px;
    background: #fbfcfb;
}

.notification-history-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.notification-history-meta span,
.notification-status-line small {
    color: #737b74;
    font-size: .7rem;
}

.notification-history-row p {
    margin: 0;
    font-size: .77rem;
    line-height: 1.45;
}

.notification-status-line {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.notification-simulated-badge {
    display: inline-flex;
    width: fit-content;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e8efeb;
    font-size: .64rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.notification-simulator {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed #d9ded9;
    border-radius: 10px;
}

.notification-simulator summary {
    cursor: pointer;
    font-size: .72rem;
    font-weight: 800;
}

.notification-simulator form {
    display: flex;
    gap: 8px;
    align-items: end;
    margin-top: 10px;
}

.notification-simulator label {
    flex: 1;
}

.empty-mini-state {
    padding: 12px;
    border-radius: 10px;
    background: #f5f7f5;
    color: #717872;
    font-size: .76rem;
}

@media (max-width: 700px) {
    .notification-history-meta {
        display: grid;
    }

    .notification-simulator form {
        display: grid;
    }
}


/* v141 · WhatsApp Cloud API test */
.notification-real-badge,
.notification-error-badge {
    display:inline-flex;
    width:fit-content;
    padding:3px 7px;
    border-radius:999px;
    font-size:.64rem;
    font-weight:850;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.notification-real-badge { background:#e3f3e8; }
.notification-error-badge { background:#f9e4e4; }

/* v146 */
.notification-row form { margin-top: 8px; }
.notification-row small { display:block; margin-top:4px; }
