*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #eef2f6;
    color: #1d2939;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #22384b 0%, #162a3a 100%);
    color: #fff;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.brand-card,
.search-card,
.session-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
}

.brand-card {
    padding: 20px 14px;
    text-align: center;
    margin-bottom: 16px;
}

.brand-logo {
    width: 110px;
    max-width: 100%;
    display: inline-block;
    margin-bottom: 10px;
}

.brand-title {
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.15;
}

.search-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

.search-card input {
    width: 100%;
    background: transparent;
    border: 0;
    color: #fff;
    outline: none;
}

.search-card input::placeholder {
    color: rgba(255,255,255,0.65);
}

.sidebar-section-title {
    color: #afbdc9;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: .04em;
    margin: 6px 10px 10px;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 600;
    transition: .2s ease;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255,255,255,0.13);
    color: #fff;
}

.session-card {
    padding: 14px;
    margin-top: 16px;
    margin-bottom: 14px;
}

.session-card small {
    display: block;
    color: #c8d2db;
    font-weight: 700;
    margin-bottom: 6px;
}

.session-card strong {
    display: block;
    font-size: 1.1rem;
}

.session-card span {
    display: block;
    margin-top: 4px;
    color: #d8e0e6;
    font-size: 0.88rem;
}

.logout-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: #b62035;
    color: #fff;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
}

.logout-btn:hover {
    background: #991a2b;
    color: #fff;
}

.main-content {
    padding: 28px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.page-subtitle {
    color: #667085;
}

.user-pill {
    background: #fff;
    border-radius: 999px;
    padding: 12px 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

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

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

.stat-card,
.panel-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.mini-panel {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #e4e7ec;
    height: 100%;
}

.mini-panel h6 {
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-card .label {
    color: #667085;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 1.55rem;
    font-weight: 800;
}

.panel-card + .panel-card {
    margin-top: 16px;
}

.form-card {
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1e3a4c, #10212f);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255,255,255,0.98);
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    font-size: 1.9rem;
    font-weight: 800;
}

.login-card p {
    color: #667085;
}

.login-logo {
    width: 140px;
    display: block;
    margin: 0 auto 12px;
}

.table thead th {
    border-bottom-width: 1px;
}

.sticky-card {
    position: sticky;
    top: 24px;
}

.product-filter-form .form-control,
.product-filter-form .form-select {
    min-width: 220px;
}

.table-modern thead th {
    color: #475467;
    font-size: 0.92rem;
    white-space: nowrap;
}

.table-modern tbody td {
    vertical-align: middle;
}

.product-code {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.92rem;
}

.text-truncate-table {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* POS */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-height: 620px;
    overflow: auto;
}

.catalog-item {
    background: #f8fafc;
    border: 1px solid #d0d5dd;
    border-radius: 16px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}

.catalog-item:hover {
    transform: translateY(-1px);
    border-color: #344054;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.catalog-item strong {
    display: block;
    font-size: 1rem;
    margin: 6px 0;
    color: #101828;
}

.catalog-item small {
    color: #667085;
}

.catalog-bottom {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #344054;
    font-weight: 700;
    font-size: 0.88rem;
}

.catalog-type {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.catalog-type.product {
    background: #e8f1ff;
    color: #1d4ed8;
}

.catalog-type.service {
    background: #f5ecff;
    color: #7c3aed;
}

.cart-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
    max-height: 360px;
    overflow: auto;
}

.cart-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
}

.cart-info strong {
    display: block;
}

.cart-info small {
    color: #667085;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-qty {
    width: 90px;
}

.cart-line-total {
    min-width: 88px;
    text-align: right;
    font-weight: 800;
}

.summary-card {
    background: #0f172a;
    color: #fff;
    border-radius: 20px;
    padding: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    padding: 4px 0;
}

.summary-row.total {
    font-size: 1.2rem;
    margin-top: 8px;
    border-top: 1px dashed rgba(255,255,255,0.3);
    padding-top: 10px;
}


.pos-client-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.pos-client-inline {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 12px;
    margin-top: 14px;
}

.quick-client-feedback {
    margin-top: 12px;
    min-height: 22px;
    font-size: 0.92rem;
    font-weight: 600;
}

.quick-client-feedback.success {
    color: #067647;
}

.quick-client-feedback.error {
    color: #b42318;
}

.quick-client-feedback.info {
    color: #344054;
}

/* Ticket */
.ticket-body,
.label-page {
    background: #f3f4f6;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ticket-wrapper {
    padding: 24px;
}

.ticket-actions,
.label-toolbar {
    max-width: 820px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.btn-back,
.btn-print {
    text-decoration: none;
    border: 0;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    display: inline-block;
    cursor: pointer;
}

.ticket-card {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background: #fff;
    padding: 18px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.ticket-header {
    text-align: center;
    border-bottom: 1px dashed #d0d5dd;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.ticket-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.ticket-header p {
    margin: 4px 0 0;
    color: #475467;
    font-size: 0.9rem;
}

.ticket-meta {
    font-size: 0.88rem;
    margin-bottom: 12px;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.ticket-table th,
.ticket-table td {
    padding: 8px 0;
    border-bottom: 1px dashed #eaecf0;
    vertical-align: top;
    text-align: left;
}

.ticket-table th:last-child,
.ticket-table td:last-child {
    text-align: right;
}

.ticket-line-meta {
    color: #667085;
    font-size: 0.76rem;
    margin-top: 4px;
}

.ticket-summary {
    margin-top: 14px;
}

.ticket-summary > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.95rem;
}

.ticket-notes {
    margin-top: 12px;
    font-size: 0.88rem;
    color: #475467;
}

.ticket-footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed #d0d5dd;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Barcode labels */
.label-toolbar {
    max-width: 1100px;
    padding: 18px 24px 0;
}

.label-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.label-form input[type="number"] {
    width: 90px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #d0d5dd;
}

.labels-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.barcode-label {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.barcode-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.barcode-price {
    margin-bottom: 6px;
    color: #475467;
    font-weight: 700;
}

.barcode-svg svg {
    width: 100%;
    height: auto;
}

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

    .ticket-body,
    .label-page {
        background: #fff;
    }

    .ticket-wrapper {
        padding: 0;
    }

    .ticket-card {
        box-shadow: none;
        max-width: 300px;
        border-radius: 0;
        padding: 0;
    }

    .labels-grid {
        padding: 0;
        gap: 8px;
    }

    .barcode-label {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

@media (max-width: 1199px) {
    .sticky-card {
        position: static;
    }

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

@media (max-width: 992px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }

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

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

@media (max-width: 576px) {
    .main-content {
        padding: 18px;
    }

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

    .ticket-actions,
    .label-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .cart-controls {
        justify-content: space-between;
    }
}


.purchase-grid-inputs {
    display: grid;
    grid-template-columns: 110px 130px 1fr 42px;
    gap: 8px;
    align-items: center;
}

.thermal-ticket {
    max-width: 302px;
    padding: 12px 10px;
}

.thermal-ticket .ticket-header {
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.thermal-ticket .ticket-header h2 {
    font-size: 0.98rem;
}

.thermal-ticket .ticket-header p,
.thermal-ticket .ticket-meta,
.thermal-ticket .ticket-table,
.thermal-ticket .ticket-summary > div,
.thermal-ticket .ticket-notes,
.thermal-ticket .ticket-footer {
    font-size: 0.72rem;
}

.thermal-ticket .ticket-table th,
.thermal-ticket .ticket-table td {
    padding: 5px 0;
}

.thermal-ticket .ticket-line-meta {
    font-size: 0.62rem;
}

.ticket-barcode-block {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #d0d5dd;
    text-align: center;
}

.ticket-barcode-svg svg {
    width: 100%;
    max-width: 260px;
    height: auto;
}

.ticket-barcode-text {
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

@media print {
    .thermal-ticket {
        max-width: 280px;
        padding: 0;
    }

    .ticket-barcode-svg svg {
        max-width: 260px;
    }
}

@media (max-width: 576px) {
    .purchase-grid-inputs {
        grid-template-columns: 1fr 1fr;
    }
}


.brand-logo {
    max-height: 90px;
    object-fit: contain;
}

.login-page-split {
    grid-template-columns: minmax(320px, 520px) minmax(320px, 460px);
    gap: 28px;
    align-items: center;
    justify-content: center;
}

.login-side-panel {
    color: #eef6ff;
    padding: 24px;
}

.login-logo-split {
    width: 100%;
    max-width: 520px;
    max-height: 260px;
    object-fit: contain;
    display: block;
    margin-bottom: 24px;
}

.login-side-panel h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.login-side-panel p,
.login-side-panel li {
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
}

.login-side-panel ul {
    padding-left: 18px;
    margin-top: 18px;
}

.split-card {
    max-width: 520px;
}

@media (max-width: 991px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }

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

    .login-side-panel {
        display: none;
    }
}


.brand-link {
    display: block;
    color: #fff;
    text-decoration: none;
}

.brand-link:hover {
    color: #fff;
}

.login-body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 30%),
        linear-gradient(135deg, #1e2f3d 0%, #243b55 45%, #314b68 100%);
    color: #ffffff;
}

.login-shell {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255,255,255,0.10);
}

.login-info {
    padding: 48px 42px;
    background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-info img {
    width: 220px;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: 26px;
}

.login-info h1 {
    margin: 0 0 14px 0;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    color: #ffffff;
}

.login-info p {
    margin: 0 0 14px 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    max-width: 460px;
}

.login-features {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.feature-item {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.92);
    font-size: 14px;
}

.login-box-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    padding: 30px 26px;
    backdrop-filter: blur(18px);
}

.login-box h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
}

.login-box .subtitulo {
    margin: 0 0 22px 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.6;
}

.message-box {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid rgba(255,255,255,0.08);
    color: #ffffff;
}

.message-error {
    background: rgba(139, 30, 45, 0.20);
}

.message-success {
    background: rgba(22, 101, 52, 0.25);
}

.form-group {
    margin-bottom: 16px;
}

.login-box .form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.input-wrap {
    position: relative;
}

.input-wrap span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.70);
    font-size: 14px;
    pointer-events: none;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: 0.2s ease;
}

.login-box input[type="text"]::placeholder,
.login-box input[type="password"]::placeholder {
    color: rgba(255,255,255,0.62);
}

.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus {
    background: rgba(255,255,255,0.26);
    border-color: rgba(255,255,255,0.24);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}

.login-submit {
    width: 100%;
    height: 48px;
    background: #ffffff;
    color: #1f2d3d;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 6px;
    transition: 0.2s ease;
    font-size: 15px;
}

.login-submit:hover {
    background: #eef3f8;
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.6;
}

.login-note {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.68);
    text-align: center;
}

.service-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-info {
        padding: 34px 26px 20px 26px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .login-box-wrap {
        padding: 24px;
    }
}

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

    .login-info {
        padding: 26px 20px 16px 20px;
    }

    .login-box-wrap {
        padding: 18px;
    }

    .login-box {
        padding: 22px 18px;
    }

    .login-info h1 {
        font-size: 28px;
    }

    .service-form-grid {
        grid-template-columns: 1fr;
    }

    .pos-client-grid,
    .pos-client-inline {
        grid-template-columns: 1fr;
    }
}

/* Corrección crítica: sidebar fijo sin traslape.
   El menú se desplaza internamente y la sesión/cerrar sesión queda abajo sin tapar opciones. */
@media (min-width: 993px) {
    html,
    body {
        min-height: 100%;
        overflow-x: hidden !important;
    }

    .app-shell {
        display: block !important;
        min-height: 100vh !important;
    }

    aside.sidebar,
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
        z-index: 9999 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: 14px !important;
    }

    aside.sidebar > div:first-child,
    .sidebar > div:first-child {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-right: 4px !important;
        padding-bottom: 10px !important;
    }

    aside.sidebar > div:last-child,
    .sidebar > div:last-child {
        flex: 0 0 auto !important;
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin-top: 0 !important;
    }

    main.main-content,
    .main-content {
        margin-left: 280px !important;
        width: calc(100% - 280px) !important;
        min-height: 100vh !important;
    }

    aside.sidebar > div:first-child::-webkit-scrollbar,
    .sidebar > div:first-child::-webkit-scrollbar {
        width: 6px;
    }

    aside.sidebar > div:first-child::-webkit-scrollbar-thumb,
    .sidebar > div:first-child::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.25);
        border-radius: 999px;
    }

    aside.sidebar > div:first-child::-webkit-scrollbar-track,
    .sidebar > div:first-child::-webkit-scrollbar-track {
        background: transparent;
    }
}

@media (max-width: 992px) {
    .app-shell {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    aside.sidebar,
    .sidebar {
        position: static !important;
        width: auto !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
    }

    aside.sidebar > div:first-child,
    .sidebar > div:first-child {
        overflow: visible !important;
        max-height: none !important;
        padding-right: 0 !important;
    }

    aside.sidebar > div:last-child,
    .sidebar > div:last-child {
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }

    main.main-content,
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ===== Etiquetas de producto v6 - Code128 Zebra 50x30 impresion limpia ===== */
body.label-page,
.label-page{
    background:#eef2f7;
    padding:16px;
    color:#0f172a;
}
.label-toolbar{
    max-width:none;
    display:grid;
    grid-template-columns:minmax(260px,.75fr) minmax(640px,2fr);
    gap:14px;
    align-items:start;
    margin-bottom:14px;
    padding:0;
}
.label-toolbar > div:first-child,
.label-form,
.label-save-form{
    background:rgba(255,255,255,.96);
    border:1px solid #d9e2ef;
    border-radius:18px;
    box-shadow:0 14px 36px rgba(15,23,42,.08);
}
.label-toolbar > div:first-child{
    padding:14px 16px;
}
.label-help-text{
    display:none;
}
.label-alert{
    margin-top:8px;
    border-radius:12px;
    padding:9px 11px;
    font-size:.84rem;
    font-weight:800;
}
.label-alert-warning{
    color:#92400e;
    background:#fffbeb;
    border:1px solid #fcd34d;
}
.label-alert-success{
    color:#065f46;
    background:#ecfdf3;
    border:1px solid #a7f3d0;
}
.label-alert-error{
    color:#991b1b;
    background:#fef2f2;
    border:1px solid #fecaca;
}
.label-form{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(96px,1fr));
    align-items:end;
    gap:10px;
    padding:14px;
}
.label-form .field{
    display:flex;
    flex-direction:column;
    gap:5px;
    min-width:0;
}
.label-form .field-wide{
    grid-column:span 2;
    min-width:220px;
}
.label-form label,
.label-save-form label{
    font-size:.76rem;
    letter-spacing:.01em;
    font-weight:900;
    color:#1e293b;
}
.label-form input,
.label-form select,
.label-save-form input{
    width:100%;
    min-width:0;
    height:40px;
    border-radius:12px;
    border:1px solid #cbd5e1;
    padding:0 11px;
    background:#fff;
    color:#0f172a;
    font-weight:700;
    outline:none;
    transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.label-form input:focus,
.label-form select:focus,
.label-save-form input:focus{
    border-color:#3b82f6;
    box-shadow:0 0 0 4px rgba(59,130,246,.14);
}
.label-form .checks-field{
    grid-column:span 2;
    min-width:230px;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}
.checks-field > label:first-child{
    grid-column:1 / -1;
}
.mini-check{
    display:flex !important;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    min-height:36px;
    margin:0 !important;
    padding:0 10px;
    border:1px solid #dbe3ef;
    border-radius:12px;
    background:#f8fafc;
    color:#334155 !important;
    font-size:.78rem !important;
    font-weight:850 !important;
    line-height:1 !important;
    white-space:nowrap;
}
.mini-check input[type="checkbox"]{
    appearance:auto !important;
    -webkit-appearance:checkbox !important;
    flex:0 0 17px !important;
    width:17px !important;
    min-width:17px !important;
    max-width:17px !important;
    height:17px !important;
    min-height:17px !important;
    max-height:17px !important;
    margin:0 !important;
    padding:0 !important;
    accent-color:#2563eb;
    box-shadow:none !important;
}
.label-save-form{
    grid-column:1 / -1;
    display:flex;
    align-items:flex-end;
    gap:10px;
    padding:14px;
}
.label-save-form label{
    display:flex;
    flex-direction:column;
    gap:5px;
}
.label-save-form input{
    min-width:250px;
}
.btn-print,
.btn-soft,
.btn-danger-soft{
    height:40px;
    border:1px solid transparent;
    border-radius:13px;
    padding:0 16px;
    font-weight:900;
    cursor:pointer;
    transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn-print{
    background:#0f172a !important;
    color:#fff !important;
    box-shadow:0 8px 18px rgba(15,23,42,.16);
}
.btn-print:hover:not(:disabled){
    transform:translateY(-1px);
    box-shadow:0 10px 22px rgba(15,23,42,.20);
}
.btn-soft{
    background:#eaf2ff !important;
    color:#1849a9 !important;
    border-color:#bfdbfe !important;
    box-shadow:none;
}
.btn-danger-soft{
    background:#fff1f3 !important;
    color:#be123c !important;
    border-color:#fecdd3 !important;
    box-shadow:none;
}
.btn-print:disabled{
    opacity:.45;
    cursor:not-allowed;
    transform:none !important;
    box-shadow:none !important;
}
.labels-mm-grid{
    max-width:none;
    width:max-content;
    margin:0;
    padding:0;
    display:flex;
    flex-wrap:wrap;
    align-items:flex-start;
    gap:3mm;
    background:transparent;
    border:0;
    border-radius:0;
}
.label-mm{
    box-sizing:border-box;
    padding:1.6mm 2mm 1.2mm !important;
    border:0.25mm dashed #94a3b8;
    border-radius:2mm;
    background:#fff;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
    align-items:stretch;
    box-shadow:0 10px 24px rgba(15,23,42,.08);
}
.label-mm .barcode-title{
    width:100%;
    line-height:1.03 !important;
    min-height:0 !important;
    max-height:5mm;
    text-align:center;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    margin:0 0 .6mm !important;
    font-weight:900;
    color:#0f172a;
}
.label-mm .barcode-price{
    width:100%;
    line-height:1 !important;
    text-align:center;
    margin:0 0 .8mm !important;
    font-weight:950;
    color:#334155;
}
.barcode-svg-mm{
    width:100%;
    min-height:0;
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
    margin:.1mm 0 .4mm;
}
.barcode-svg-mm svg,
.barcode-svg-mm .code128-svg{
    display:block;
    max-width:100%;
    height:auto;
}
.label-mm .barcode-code{
    width:100%;
    line-height:1 !important;
    text-align:center;
    letter-spacing:.08em;
    color:#475569 !important;
    margin:.3mm 0 0 !important;
    font-weight:800;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
@media (max-width: 980px){
    .label-toolbar{
        grid-template-columns:1fr;
    }
    .label-form .field-wide,
    .label-form .checks-field{
        grid-column:span 1;
    }
    .label-save-form{
        flex-direction:column;
        align-items:stretch;
    }
    .label-save-form input{
        min-width:0;
    }
}
/* Bloque de impresion de etiquetas retirado del CSS global.
   La pagina barcode_label.php ya genera sus propias reglas @page dinamicas.
   Dejar este @page global afectaba los tickets y los partia en hojas de 50x30mm. */


/* Fix fuerte para impresoras termicas: texto 100% negro en vista previa e impresion */
.label-mm .barcode-title,
.label-mm .barcode-price,
.label-mm .barcode-code{
    color:#000000 !important;
    -webkit-text-fill-color:#000000 !important;
    opacity:1 !important;
    filter:none !important;
    text-shadow:none !important;
    font-weight:950 !important;
}
@media print{
    .label-mm .barcode-title,
    .label-mm .barcode-price,
    .label-mm .barcode-code{
        color:#000000 !important;
        -webkit-text-fill-color:#000000 !important;
        opacity:1 !important;
        filter:none !important;
        text-shadow:none !important;
        font-weight:950 !important;
        -webkit-print-color-adjust:exact !important;
        print-color-adjust:exact !important;
    }
}


/* ===== Correccion definitiva de impresion de tickets termicos =====
   Esta regla deja que Chrome use el tamano de rollo seleccionado en la impresora
   y evita que reglas de etiquetas de 50x30mm afecten los recibos. */
@media print {
    @page {
        size: auto;
        margin: 0;
    }

    html,
    body.ticket-body {
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    body.ticket-body .ticket-wrapper {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.ticket-body .ticket-card,
    body.ticket-body .thermal-ticket {
        width: 100% !important;
        max-width: 72mm !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 auto !important;
        padding: 2mm !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        page-break-before: auto !important;
        page-break-after: auto !important;
        page-break-inside: auto !important;
        break-before: auto !important;
        break-after: auto !important;
        break-inside: auto !important;
    }

    body.ticket-body .ticket-table,
    body.ticket-body .ticket-summary,
    body.ticket-body .ticket-barcode-block,
    body.ticket-body .ticket-footer,
    body.ticket-body .ticket-notes {
        page-break-before: auto !important;
        page-break-after: auto !important;
        break-before: auto !important;
        break-after: auto !important;
    }
}
