@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: var(--color-primario-texto, #fff);
    background-color: var(--color-primario, #1b6ec2);
    border-color: var(--color-primario-oscuro, #1861ac);
}

.btn-primary:hover,
.btn-primary:focus {
    color: var(--color-primario-texto, #fff);
    background-color: var(--color-primario-oscuro, #1861ac);
    border-color: var(--color-primario-oscuro, #1861ac);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,...(icon)...), #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* Layout principal con scroll arreglado */
.page {
    display: flex !important;
    flex-direction: row !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.sidebar {
    width: 250px !important;
    min-width: 250px !important;
    height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

main {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

main .top-row {
    flex-shrink: 0 !important;
}

main article.content {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.nav-link {
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

/* Responsive: ocultar sidebar en móvil */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        overflow-x: hidden;
    }

        .sidebar.d-block {
            transform: translateX(0);
        }

    .main {
        flex-grow: 1;
        padding-left: 0 !important;
    }
}

/* ============================================
   POS DASHBOARD - Estilo Odoo/SAP
   ============================================ */

.pos-container {
    background: #f0f0f0;
    min-height: calc(100vh - 60px);
    padding: 0;
    margin: -1rem -1.5rem;
}

/* Header del POS */
.pos-header {
    background: linear-gradient(135deg, #714B67 0%, #5a3d54 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.pos-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.pos-session-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 500;
}

.pos-stats {
    display: flex;
    gap: 1.5rem;
}

.pos-stat {
    text-align: center;
}

.pos-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.pos-stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
}

.pos-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pos-date {
    opacity: 0.9;
    font-size: 0.9rem;
}

.btn-close-pos {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-close-pos:hover {
    background: #dc3545;
    border-color: #dc3545;
}

/* Contenido Principal POS */
.pos-content {
    padding: 1.5rem;
}

/* Barra de acciones */
.pos-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pos-view-tabs {
    display: flex;
    gap: 0.5rem;
}

.pos-tab {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pos-tab:hover {
    border-color: #714B67;
    color: #714B67;
}

.pos-tab.active {
    background: #714B67;
    color: white;
    border-color: #714B67;
}

.pos-tab .badge {
    background: rgba(0,0,0,0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.pos-tab.active .badge {
    background: rgba(255,255,255,0.25);
}

.pos-quick-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-pos-action {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-pos-primary {
    background: #28a745;
    color: white;
}

.btn-pos-primary:hover {
    background: #218838;
}

.btn-pos-secondary {
    background: white;
    color: #714B67;
    border: 2px solid #714B67;
}

.btn-pos-secondary:hover {
    background: #714B67;
    color: white;
}

/* Grid de Mesas/Habitaciones */
.pos-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.pos-item-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 3px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.pos-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.pos-item-card.disponible {
    border-color: #28a745;
    background: linear-gradient(180deg, #ffffff 0%, #e8f5e9 100%);
}

.pos-item-card.disponible::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #28a745;
}

.pos-item-card.ocupada {
    border-color: #dc3545;
    background: linear-gradient(180deg, #ffffff 0%, #ffebee 100%);
}

.pos-item-card.ocupada::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #dc3545;
}

.pos-item-card.reservada {
    border-color: #007bff;
    background: linear-gradient(180deg, #ffffff 0%, #e3f2fd 100%);
}

.pos-item-card.reservada::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #007bff;
}

.pos-item-card.limpieza {
    border-color: #ffc107;
    background: linear-gradient(180deg, #ffffff 0%, #fff8e1 100%);
}

.pos-item-card.limpieza::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #ffc107;
}

.pos-item-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #714B67;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.pos-item-name {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.pos-item-status {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.pos-item-status.disponible {
    background: #c8e6c9;
    color: #2e7d32;
}

.pos-item-status.ocupada {
    background: #ffcdd2;
    color: #c62828;
}

.pos-item-status.reservada {
    background: #bbdefb;
    color: #1565c0;
}

.pos-item-status.limpieza {
    background: #fff9c4;
    color: #f57f17;
}

.pos-item-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc3545;
    margin-top: 0.5rem;
}

.pos-item-capacity {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Panel de Órdenes Recientes */
.pos-orders-panel {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pos-orders-panel h5 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pos-orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.pos-order-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #714B67;
}

.pos-order-item:hover {
    background: #eef2f7;
}

.pos-order-item.abierta {
    border-left-color: #17a2b8;
}

.pos-order-item.preparando {
    border-left-color: #ffc107;
}

.pos-order-item.pagada {
    border-left-color: #28a745;
}

.pos-order-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pos-order-number {
    font-weight: 700;
    color: #343a40;
}

.pos-order-location {
    font-size: 0.8rem;
    color: #6c757d;
}

.pos-order-amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: #343a40;
}

/* Pantalla de Bienvenida (sin sesión) */
.pos-welcome {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #714B67 0%, #5a3d54 100%);
    margin: -1rem -1.5rem;
}

.pos-welcome-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.pos-welcome-icon {
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 3rem;
}

.pos-welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pos-welcome-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.btn-open-pos {
    background: white;
    color: #714B67;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.btn-open-pos:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.pos-welcome-date {
    margin-top: 2rem;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Modal POS */
.pos-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
    pointer-events: none;
}

.pos-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    pointer-events: auto;
}

.pos-modal-header {
    background: #714B67;
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-modal-header.danger {
    background: #dc3545;
}

.pos-modal-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pos-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.pos-modal-body {
    padding: 1.5rem;
}

.pos-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Resumen de cierre */
.pos-close-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .pos-close-summary {
        grid-template-columns: 1fr;
    }
}

.pos-summary-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #714B67;
}

.pos-summary-table {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.pos-summary-row:last-child {
    border-bottom: none;
}

.pos-summary-row.total {
    background: #714B67;
    color: white;
    font-weight: 700;
}

.pos-summary-row.success span:last-child {
    color: #28a745;
    font-weight: 600;
}

.pos-payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pos-payment-item {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pos-payment-item i {
    color: #714B67;
}

.pos-payment-item span {
    flex: 1;
    color: #6c757d;
    font-size: 0.85rem;
}

.pos-payment-item strong {
    color: #343a40;
}

.pos-empty {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.pos-empty i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

/* Modal grande */
.pos-modal-lg {
    max-width: 700px;
    width: 95%;
}

/* Grid de selección */
.pos-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.pos-selection-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pos-selection-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pos-selection-item.disponible {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.pos-selection-item.ocupada {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.pos-selection-item.reservada {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.pos-selection-item.limpieza {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.pos-selection-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.pos-selection-name {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-selection-status {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.pos-selection-item.disponible .pos-selection-status { color: #28a745; }
.pos-selection-item.ocupada .pos-selection-status { color: #dc3545; }
.pos-selection-item.reservada .pos-selection-status { color: #007bff; }
.pos-selection-item.limpieza .pos-selection-status { color: #ffc107; }

.pos-selection-amount {
    font-size: 0.8rem;
    font-weight: bold;
    color: #dc3545;
    margin-top: 0.25rem;
}

/* Tabs de categorías */
.pos-category-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pos-category-tab {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pos-category-tab:hover {
    background: #f0f0f0;
    border-color: #714B67;
}

.pos-category-tab.active {
    background: #714B67;
    color: white;
    border-color: #714B67;
}

/* Responsive POS */
@media (max-width: 768px) {
    .pos-header {
        flex-direction: column;
        text-align: center;
    }

    .pos-header-left,
    .pos-header-right {
        justify-content: center;
    }

    .pos-actions-bar {
        flex-direction: column;
    }

    .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .pos-item-number {
        font-size: 2rem;
    }
}



/* Receipt Styles */
.receipt-paper {
    background: white;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-width: 300px;
    margin: 0 auto;
    border: 1px solid #ddd;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
}

.receipt-logo {
    max-width: 80px;
    max-height: 80px;
    margin-bottom: 10px;
}

.receipt-company {
    margin: 5px 0;
    font-size: 16px;
    font-weight: bold;
}

.receipt-info {
    margin: 2px 0;
    font-size: 11px;
    color: #555;
}

.receipt-divider {
    border: none;
    border-top: 1px dashed #999;
    margin: 10px 0;
}

.receipt-order-info {
    text-align: center;
    margin-bottom: 10px;
}

.receipt-order-info p {
    margin: 3px 0;
}

.receipt-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 10px;
}

.receipt-items th,
.receipt-items td {
    padding: 4px 2px;
    vertical-align: top;
}

.receipt-totals {
    font-size: 12px;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

.receipt-grand-total {
    font-size: 14px;
    margin-top: 8px;
    border-top: 2px solid #000;
    padding-top: 8px;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 11px;
}

.receipt-warning {
    font-weight: bold;
    color: #dc3545;
    margin-top: 8px;
}

@media print {
    .receipt-paper {
        border: none;
        box-shadow: none;
    }
}
