:root {
    --ink: #1c2430;
    --muted: #667085;
    --line: #d8dee8;
    --panel: #ffffff;
    --soft: #f4f7fb;
    --brand: #06133d;
    --brand-2: #0f766e;
    --danger: #b42318;
    --warning: #b54708;
    --ok: #067647;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background: var(--brand);
}

.login-box {
    width: min(420px, 100%);
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.login-box h1 {
    margin: 0 0 20px;
    font-size: 32px;
    line-height: 1;
}

.login-error {
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    background: var(--danger);
    font-weight: 800;
}

.login-box form {
    display: grid;
    gap: 12px;
}

.login-box input,
.login-box button {
    width: 100%;
    min-height: 52px;
    border-radius: 8px;
    font-size: 18px;
}

.login-box input {
    border: 1px solid var(--line);
    padding: 0 14px;
}

.login-box button {
    border: 0;
    color: #fff;
    background: var(--brand-2);
    cursor: pointer;
    font-weight: 900;
}

.app-header {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 36px);
    color: #fff;
    background: var(--brand);
}

.brand img {
    display: block;
    width: min(170px, 40vw);
    height: auto;
}

.brand span,
.app-header h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1;
    text-transform: uppercase;
}

.logout {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 8px;
    font-weight: 700;
}

.page-shell {
    width: min(1500px, calc(100% - 28px));
    margin: 18px auto 120px;
}

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

.filter-link {
    min-height: 48px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font-weight: 800;
}

.filter-link.is-active {
    color: #fff;
    background: var(--brand-2);
    border-color: var(--brand-2);
}

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

.order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 4px 14px rgba(16, 24, 40, .06);
}

.order-main {
    display: grid;
    grid-template-columns: 145px minmax(190px, 1.1fr) minmax(240px, 1.5fr) 120px 130px;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.order-number span,
.eyebrow,
.info-block span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.order-number strong {
    display: block;
    font-size: 36px;
    line-height: 1;
}

.order-info,
.order-address {
    min-width: 0;
}

.order-info strong,
.order-info span,
.order-address {
    display: block;
    overflow-wrap: anywhere;
}

.order-info strong {
    font-size: 20px;
}

.order-total {
    font-size: 22px;
    font-weight: 900;
    text-align: right;
}

.status-pill {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 999px;
    color: #fff;
    background: var(--muted);
    font-weight: 900;
    text-align: center;
}

.status-processing,
.status-print {
    background: var(--warning);
}

.status-cocinando {
    background: #155eef;
}

.status-enviado {
    background: var(--brand-2);
}

.status-entregado {
    background: var(--ok);
}

.order-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.icon-action,
.secondary-button,
.advance-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 76px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 900;
}

.icon-action {
    width: 96px;
    flex-direction: column;
    font-size: 13px;
}

.icon-action img,
.secondary-button img,
.advance-button img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.advance-button {
    min-width: 230px;
    padding: 12px 18px;
    border-color: var(--brand-2);
    background: var(--brand-2);
    color: #fff;
    font-size: 18px;
}

.advance-button.is-loading {
    opacity: .68;
    pointer-events: none;
}

.empty-state {
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 22px;
    font-weight: 800;
    text-align: center;
}

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

.detail-hero,
.detail-grid,
.products,
.notes {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.detail-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
}

.detail-hero h2 {
    margin: 4px 0 8px;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1;
}

.detail-hero p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 20px;
}

.detail-total {
    display: grid;
    justify-items: end;
    align-content: center;
    gap: 12px;
}

.detail-total strong {
    font-size: 38px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.info-block {
    padding: 18px;
    border-right: 1px solid var(--line);
}

.info-block:last-child {
    border-right: 0;
}

.info-block strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
}

.products,
.notes {
    padding: 18px;
}

.products h2,
.notes h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.product-line {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.product-line:first-of-type {
    border-top: 0;
}

.product-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 22px;
}

.product-title span {
    white-space: nowrap;
    font-weight: 800;
}

.meta-list {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
}

.meta-list div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
}

.meta-list dt {
    color: var(--muted);
    font-weight: 800;
}

.meta-list dd {
    margin: 0;
}

.notes p {
    margin: 0;
    white-space: pre-wrap;
    font-size: 20px;
}

.bottom-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
}

.secondary-button {
    min-width: 150px;
    padding: 12px 18px;
}

.print-frame {
    width: 1px;
    height: 1px;
    border: 0;
    opacity: 0;
}

.admin-shell,
.admin-form-shell {
    display: grid;
    gap: 16px;
}

.admin-toolbar {
    display: flex;
    justify-content: flex-end;
}

.admin-primary,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--brand-2);
    cursor: pointer;
    font-weight: 900;
}

.danger-button {
    background: var(--danger);
}

.admin-table-wrap,
.admin-card,
.admin-form {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .06);
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

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

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

.admin-actions a {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.admin-actions .danger-link {
    color: var(--danger);
}

.admin-form {
    display: grid;
    gap: 14px;
    width: min(760px, 100%);
    padding: 20px;
}

.admin-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 900;
}

.admin-form label span {
    font-weight: 700;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="url"] {
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-size: 17px;
}

.checkbox-line {
    display: flex !important;
    grid-template-columns: none;
    flex-direction: row;
    align-items: center;
}

.checkbox-line input {
    width: 22px;
    height: 22px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.admin-note {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
}

.admin-card {
    display: grid;
    gap: 12px;
    width: min(760px, 100%);
    padding: 20px;
}

.admin-card p {
    margin: 0;
}

.admin-success {
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    background: var(--ok);
    font-weight: 800;
}

.orders-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-button {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
}

.filter-button.is-active {
    color: #fff;
    background: var(--brand-2);
    border-color: var(--brand-2);
}

.refresh-button {
    margin-left: auto;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-row {
    display: grid;
    grid-template-columns: 90px 120px minmax(140px, 1.2fr) 130px minmax(160px, 1.2fr) 105px minmax(280px, 330px);
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.order-id {
    font-size: 18px;
    font-weight: 900;
}

.order-status {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fff;
    background: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.order-customer,
.order-phone,
.order-shipping,
.order-total {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-customer,
.order-total {
    font-weight: 900;
}

.order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: #e9eef7;
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.btn-view {
    background: #e9eef7;
}

.btn-print {
    background: #fff4d6;
}

.btn-next {
    color: #fff;
    background: var(--brand-2);
}

.btn.is-loading,
.advance-button.is-loading {
    opacity: .68;
    pointer-events: none;
}

@media (max-width: 1100px) {
    .order-row {
        grid-template-columns: 80px 105px minmax(130px, 1fr) 120px 1fr 95px minmax(240px, 300px);
        font-size: 14px;
    }
}

@media (max-width: 800px) {
    .app-header {
        grid-template-columns: 1fr auto;
    }

    .app-header h1 {
        grid-column: 1 / -1;
        grid-row: 2;
        font-size: 30px;
    }

    .logout {
        padding: 10px 12px;
    }

    .page-shell {
        width: min(100% - 16px, 1500px);
        margin-top: 10px;
    }

    .filter-link,
    .filter-button {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
    }

    .refresh-button {
        margin-left: 0;
    }

    .order-row {
        display: block;
        padding: 14px;
    }

    .order-id {
        display: inline-block;
        margin-right: 8px;
        font-size: 26px;
    }

    .order-status {
        vertical-align: middle;
    }

    .order-customer,
    .order-phone,
    .order-shipping,
    .order-total {
        display: block;
        margin-top: 7px;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

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

    .btn,
    .icon-action,
    .advance-button,
    .secondary-button {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }

    .detail-hero,
    .product-title,
    .bottom-actions {
        flex-direction: column;
    }

    .detail-total {
        justify-items: start;
    }

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

    .info-block {
        border-right: 0;
        border-top: 1px solid var(--line);
    }

    .info-block:first-child {
        border-top: 0;
    }

    .meta-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .bottom-actions {
        position: static;
        margin-top: 16px;
    }

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

/* Panel pedidos: escritorio compacto y movil en tarjetas */
.orders-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-btn {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #d7dde8;
    border-radius: 9px;
    background: #fff;
    color: #061336;
    cursor: pointer;
    font-weight: 900;
}

.filter-btn.is-active {
    color: #fff;
    background: #0f7f75;
    border-color: #0f7f75;
}

.refresh-button {
    margin-left: auto;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-row {
    display: grid;
    grid-template-columns: 220px 120px minmax(260px, 1fr) 110px 140px 330px;
    align-items: center;
    gap: 12px;
    min-height: 86px;
    overflow: hidden;
    padding: 10px 14px;
    border: 1px solid #d7dde8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

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

.order-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-id {
    display: block;
    color: #061336;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
}

.order-customer {
    display: block;
    overflow: hidden;
    color: #061336;
    font-size: 15px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-phone,
.order-address {
    color: #061336;
    font-size: 15px;
    line-height: 1.2;
}

.order-address {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.order-total {
    color: #061336;
    font-size: 22px;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.order-status {
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 18px;
    border-radius: 999px;
    color: #fff;
    background: #c54b00;
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
}

.status-processing .status-badge {
    background: #f97316;
}

.status-print .status-badge {
    background: #c54b00;
}

.status-cocinando .status-badge {
    background: #2563eb;
}

.status-enviado .status-badge {
    background: #7c3aed;
}

.status-entregado .status-badge {
    background: #16a34a;
}

.order-actions {
    display: grid;
    grid-template-columns: 58px 70px 190px;
    align-items: center;
    justify-content: end;
    gap: 8px;
}

.icon-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 64px;
    min-height: 0;
    border: 1px solid #d7dde8;
    border-radius: 8px;
    background: #fff;
    color: #061336;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.icon-action img {
    display: block;
    width: 34px;
    height: 34px;
    margin-bottom: 3px;
    object-fit: contain;
}

.btn-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 190px;
    min-height: 58px;
    border: 0;
    border-radius: 8px;
    background: #0f7f75;
    color: #fff;
    cursor: pointer;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
}

.btn-next .btn-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
}

.status-cocinando .btn-next {
    background: #0f7f75;
}

.status-enviado .btn-next {
    background: #16a34a;
}

.status-entregado .btn-next {
    display: none;
}

@media (max-width: 1150px) {
    .order-row {
        grid-template-columns: 190px 110px minmax(220px, 1fr) 100px 120px 300px;
    }

    .order-actions {
        grid-template-columns: 54px 64px 170px;
    }

    .icon-action {
        width: 54px;
    }

    .btn-next {
        width: 170px;
        font-size: 15px;
    }
}

@media (max-width: 760px) {
    .refresh-button {
        margin-left: 0;
    }

    .filter-btn {
        flex: 1 1 calc(50% - 8px);
    }

    .order-row {
        display: block;
        min-height: auto;
        padding: 12px;
    }

    .order-info {
        margin-bottom: 8px;
    }

    .order-phone,
    .order-address,
    .order-total,
    .order-status {
        margin-top: 8px;
        text-align: left;
    }

    .order-total {
        font-size: 24px;
    }

    .order-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 14px;
    }

    .icon-action {
        width: 100%;
        height: 58px;
        flex-direction: row;
        gap: 8px;
    }

    .icon-action img {
        width: 28px;
        height: 28px;
        margin: 0;
    }

    .btn-next {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 58px;
        font-size: 17px;
    }
}

/* TPV limpio: acciones solo icono */
body[data-page="orders"] .order-row {
    display: grid;
    grid-template-columns: minmax(280px, 1.2fr) minmax(220px, 1fr) 110px 140px 170px;
    grid-template-areas: "info address total status actions";
    gap: 12px;
    align-items: center;
    min-height: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

body[data-page="orders"] .order-info {
    grid-area: info;
    min-width: 0;
}

body[data-page="orders"] .order-topline {
    display: flex;
    align-items: center;
    gap: 8px;
}

body[data-page="orders"] .order-id {
    color: var(--navy);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
}

body[data-page="orders"] .order-customer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    color: var(--navy);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

body[data-page="orders"] .order-address {
    grid-area: address;
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

body[data-page="orders"] .order-total {
    grid-area: total;
    color: var(--navy);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    text-align: right;
    white-space: nowrap;
}

body[data-page="orders"] .order-status {
    grid-area: status;
    display: flex;
    justify-content: center;
}

body[data-page="orders"] .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}

body[data-page="orders"] .status-processing .status-badge { background: #f97316; }
body[data-page="orders"] .status-print .status-badge { background: var(--orange); }
body[data-page="orders"] .status-cocinando .status-badge { background: var(--blue); }
body[data-page="orders"] .status-enviado .status-badge { background: var(--purple); }
body[data-page="orders"] .status-entregado .status-badge { background: var(--green); }

body[data-page="orders"] .order-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

body[data-page="orders"] .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}

body[data-page="orders"] .icon-btn img {
    display: block;
    width: 34px;
    height: 34px;
    margin: 0;
    object-fit: contain;
}

body[data-page="orders"] .icon-view {
    background: linear-gradient(180deg, #fff7d6 0%, #fff 100%);
}

body[data-page="orders"] .icon-print {
    background: linear-gradient(180deg, #fff2d0 0%, #fff 100%);
}

body[data-page="orders"] .icon-next {
    background: linear-gradient(180deg, #d9fbf4 0%, #fff 100%);
}

body[data-page="orders"] .status-cocinando .icon-next {
    background: linear-gradient(180deg, #efe8ff 0%, #fff 100%);
}

body[data-page="orders"] .status-enviado .icon-next {
    background: linear-gradient(180deg, #e5fbe8 0%, #fff 100%);
}

body[data-page="orders"] .icon-btn.is-loading {
    opacity: .68;
    pointer-events: none;
}

@media (max-width: 900px) {
    body[data-page="orders"] .order-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "info total"
            "address address"
            "status status"
            "actions actions";
        padding: 12px;
    }

    body[data-page="orders"] .order-id {
        font-size: 18px;
    }

    body[data-page="orders"] .order-total {
        font-size: 20px;
        text-align: right;
    }

    body[data-page="orders"] .order-customer {
        font-size: 16px;
    }

    body[data-page="orders"] .order-address {
        margin-top: 0;
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    body[data-page="orders"] .order-status {
        justify-content: flex-start;
        margin-top: 0;
    }

    body[data-page="orders"] .order-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 0;
    }

    body[data-page="orders"] .icon-btn {
        width: 100%;
        height: 62px;
    }

    body[data-page="orders"] .icon-btn img {
        width: 32px;
        height: 32px;
    }
}

/* Nueva vista simple del panel de pedidos */
body[data-page="orders"] {
    --bg: #eef1f5;
    --card: #ffffff;
    --line: #d8dee8;
    --text: #0f172a;
    --muted: #64748b;
    --navy: #04184d;
    --teal: #0f7f75;
    --orange: #c85d05;
    --blue: #2563eb;
    --purple: #7c3aed;
    --green: #16a34a;
    --radius: 14px;
    background: var(--bg);
    color: var(--text);
}

body[data-page="orders"] .page-shell {
    width: min(1320px, 100%);
    margin: 0 auto;
    padding: 14px;
}

body[data-page="orders"] .orders-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

body[data-page="orders"] .filter-btn {
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--navy);
    cursor: pointer;
    font-weight: 900;
}

body[data-page="orders"] .filter-btn.is-active {
    color: #fff;
    background: var(--teal);
    border-color: var(--teal);
}

body[data-page="orders"] .refresh-button {
    margin-left: auto;
}

body[data-page="orders"] .orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body[data-page="orders"] .order-row {
    display: grid;
    grid-template-columns: minmax(320px, 1.3fr) minmax(120px, 150px) 220px;
    align-items: center;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

body[data-page="orders"] .order-info {
    display: block;
    min-width: 0;
}

body[data-page="orders"] .order-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body[data-page="orders"] .order-id {
    display: block;
    color: var(--navy);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

body[data-page="orders"] .order-total {
    color: var(--navy);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    text-align: right;
    white-space: nowrap;
}

body[data-page="orders"] .order-customer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: var(--navy);
    font-size: 18px;
    font-weight: 800;
}

body[data-page="orders"] .order-address {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.25;
}

body[data-page="orders"] .order-status {
    display: flex;
    justify-content: center;
    text-align: center;
}

body[data-page="orders"] .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    min-height: 44px;
    padding: 8px 18px;
    border-radius: 999px;
    color: #fff;
    background: var(--orange);
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
}

body[data-page="orders"] .status-processing .status-badge {
    background: #f97316;
}

body[data-page="orders"] .status-print .status-badge {
    background: var(--orange);
}

body[data-page="orders"] .status-cocinando .status-badge {
    background: var(--blue);
}

body[data-page="orders"] .status-enviado .status-badge {
    background: var(--purple);
}

body[data-page="orders"] .status-entregado .status-badge {
    background: var(--green);
}

body[data-page="orders"] .order-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

body[data-page="orders"] .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}

body[data-page="orders"] .icon-btn img {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0;
    object-fit: contain;
}

body[data-page="orders"] .icon-view {
    background: linear-gradient(180deg, #fff7d6 0%, #fff 100%);
}

body[data-page="orders"] .icon-print {
    background: linear-gradient(180deg, #fff2d0 0%, #fff 100%);
}

body[data-page="orders"] .icon-next {
    background: linear-gradient(180deg, #d9fbf4 0%, #fff 100%);
}

body[data-page="orders"] .status-cocinando .icon-next {
    background: linear-gradient(180deg, #efe8ff 0%, #fff 100%);
}

body[data-page="orders"] .status-enviado .icon-next {
    background: linear-gradient(180deg, #e5fbe8 0%, #fff 100%);
}

body[data-page="orders"] .icon-btn.is-loading {
    opacity: .68;
    pointer-events: none;
}

@media (max-width: 1024px) {
    body[data-page="orders"] .order-row {
        grid-template-columns: minmax(260px, 1fr) 140px 200px;
    }

    body[data-page="orders"] .icon-btn {
        width: 62px;
        height: 62px;
    }

    body[data-page="orders"] .icon-btn img {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 760px) {
    body[data-page="orders"] .page-shell {
        padding: 10px;
    }

    body[data-page="orders"] .refresh-button {
        margin-left: 0;
    }

    body[data-page="orders"] .filter-btn {
        flex: 1 1 calc(50% - 8px);
    }

    body[data-page="orders"] .order-row {
        display: block;
        padding: 12px;
    }

    body[data-page="orders"] .order-status {
        justify-content: flex-start;
        margin-top: 10px;
    }

    body[data-page="orders"] .order-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 12px;
    }

    body[data-page="orders"] .icon-btn {
        width: 100%;
        height: 72px;
    }

    body[data-page="orders"] .icon-btn img {
        width: 38px;
        height: 38px;
    }

    body[data-page="orders"] .order-id {
        font-size: 26px;
    }

    body[data-page="orders"] .order-total {
        font-size: 22px;
    }

    body[data-page="orders"] .order-customer {
        font-size: 17px;
    }

    body[data-page="orders"] .order-address {
        font-size: 15px;
    }
}
