/* ==========================================
   APP.CSS - Tema Barbershop (migrado del _Layout.cshtml del MVC)
   SB Admin 2 + colores dorados sobre fondo oscuro
   ========================================== */

html, body, #wrapper, #content-wrapper, #content, .container-fluid {
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d) !important;
    color: #fff !important;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
    background-color: #1c1c1c !important;
}

    .sidebar .nav-link,
    .sidebar .collapse-item,
    .sidebar .sidebar-brand {
        color: #ffcb74 !important;
        font-weight: bold;
        cursor: pointer;
    }

        .sidebar .nav-link i {
            color: #ffcb74 !important;
        }

        .sidebar .nav-link:hover,
        .sidebar .collapse-item:hover,
        .sidebar .nav-link.active {
            color: #ffa500 !important;
            text-decoration: underline;
        }

    .sidebar .collapse-inner {
        background-color: #262626 !important;
    }

    .sidebar .collapse-item.active {
        background-color: #333 !important;
    }

.logo-barberia {
    max-height: 60px;
    max-width: 100%;
}

/* ---------- TOPBAR ---------- */
.topbar {
    background-color: #1c1c1c !important;
}

    .topbar .nav-link {
        color: #ffcb74 !important;
        cursor: pointer;
    }

        .topbar .nav-link:hover {
            color: #ffa500 !important;
        }

    .topbar .dropdown-menu {
        background-color: #1c1c1c !important;
        border: 1px solid #333 !important;
    }

        .topbar .dropdown-menu .dropdown-item {
            color: #ffcb74 !important;
            font-weight: bold;
            cursor: pointer;
        }

            .topbar .dropdown-menu .dropdown-item:hover {
                background-color: #262626 !important;
                color: #ffa500 !important;
                text-decoration: underline;
            }

            .topbar .dropdown-menu .dropdown-item i {
                color: #ffcb74 !important;
            }

    .topbar .dropdown-divider {
        border-top: 1px solid #444 !important;
    }

main, .container, .container-fluid {
    background: transparent !important;
}

.sticky-footer {
    background: #141414 !important;
    color: #888;
}

/* ---------- PAGINAS (cards / tablas) ---------- */
.header-barber {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

    .header-barber h2 {
        margin: 0;
        font-size: 1.5rem;
    }

.toolbar-barber {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

    .toolbar-barber .input-modern {
        max-width: 320px;
    }

.table-wrapper-modern {
    overflow-x: auto;
}

.modern-table-barber {
    color: #f1f1f1 !important;
    margin-bottom: 0;
}

    .modern-table-barber thead th {
        background: #262626;
        color: #ffcb74;
        border-color: #333 !important;
        border-bottom: 2px solid #df9d39 !important;
    }

    .modern-table-barber td {
        border-color: #333 !important;
        vertical-align: middle !important;
    }

    .modern-table-barber tbody tr:hover {
        background: #232323;
    }

.pager-barber {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    color: #aaa;
    flex-wrap: wrap;
    gap: 10px;
}

    .pager-barber button:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

.form-label-barber {
    color: #ffcb74;
    font-weight: 600;
    margin-bottom: 4px;
}

.validation-message {
    color: #ffb4a9;
    font-size: .85rem;
}

/* ---------- MODAL ---------- */
.modal-barber {
    background: #1b1b1b !important;
    border: 1px solid #323232 !important;
    border-radius: 16px !important;
    color: #f1f1f1;
}

    .modal-barber .modal-header,
    .modal-barber .modal-footer {
        border-color: #333 !important;
    }

    .modal-barber .modal-title {
        color: #ffcb74;
        font-weight: bold;
    }

/* ---------- TARJETAS DE DETALLE ---------- */
.stat-barber {
    background: #262626;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 16px;
    height: 100%;
}

    .stat-barber span {
        display: block;
        color: #aaa;
        font-size: .8rem;
    }

    .stat-barber strong {
        color: #ffcb74;
        font-size: 1.1rem;
    }

/* ---------- LOGIN (body.login-barber en el MVC) ---------- */
.login-barber {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    font-family: 'Open Sans', sans-serif;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Blazor ---------- */
h1:focus {
    outline: none;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    color: #000;
    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;
    }

/* =========================================================
   LAYOUT PÚBLICO (catálogo de inicio, antes _Layout_Home)
   ========================================================= */
.public-barber {
    min-height: 100vh;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    color: #fff;
}

.public-barber .navbar-public {
    background-color: #1c1c1c;
    border-bottom: 1px solid #323232;
}

.public-barber .navbar-public .navbar-brand,
.public-barber .navbar-public .nav-link {
    color: #ffcb74;
    font-weight: bold;
}

.public-barber .navbar-public .nav-link:hover {
    color: #ffa500;
}

.public-barber .page-container-barber {
    margin: 0 auto;
}

.public-barber .text-light-gray {
    color: #bdbdbd;
}

.public-barber footer a {
    color: #ffcb74;
}

/* Colores del chat n8n (igual que el original) */
:root {
    --chat--color--primary: #ffcb74;
    --chat--color--primary-shade-50: #df9d39;
    --chat--color--primary--shade-100: #c98a2e;
    --chat--color--secondary: #1b1b1b;
    --chat--color-secondary-shade-50: #141414;
    --chat--color-white: #ffffff;
    --chat--color-light: #2a2a2a;
    --chat--color-dark: #0d0d0d;
    --chat--color-typing: #ffcb74;
    --chat--border-radius: 12px;
    --chat--window--width: 380px;
    --chat--window--height: 560px;
    --chat--header--background: linear-gradient(90deg, #0d0d0d, #df9d39);
    --chat--header--color: #fff;
    --chat--background-color: #0d0d0d;
    --chat--message--bot--background: #1b1b1b;
    --chat--message--bot--color: #ffcb74;
    --chat--message--user--background: #1b1b1b;
    --chat--message--user--color: #ffcb74;
}

/* Pantalla de carga inicial (mientras descarga/arranca WebAssembly) */
#app-loading {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    background: #111; color: #d4a017; font-family: Nunito, sans-serif; font-weight: 600;
}
#app-loading img { max-width: 160px; }
.app-loading-spinner {
    width: 3rem; height: 3rem; border-radius: 50%;
    border: .3rem solid rgba(212,160,23,.25); border-top-color: #d4a017;
    animation: app-loading-spin .8s linear infinite;
}
@keyframes app-loading-spin { to { transform: rotate(360deg); } }
/* En cuanto Blazor pinta cualquier elemento después del splash, éste se oculta */
body:has(#app-loading ~ :not(script)) #app-loading { display: none; }

/* ===== Ticket de venta (80 mm) ===== */
.ticket { width: 76mm; margin: 0 auto; padding: 4mm 3mm; background: #fff; color: #000;
          font-family: "Courier New", Courier, monospace; font-size: 12px; line-height: 1.35;
          box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.ticket .t-center { text-align: center; }
.ticket .t-left { text-align: left; }
.ticket .t-right { text-align: right; }
.ticket .t-small { font-size: 10px; }
.ticket .t-negocio { font-size: 18px; font-weight: bold; letter-spacing: 2px; }
.ticket .t-logo { max-width: 60%; max-height: 90px; object-fit: contain; display: block; margin: 0 auto 4px; filter: grayscale(100%); }
.ticket .t-anulada { font-weight: bold; font-size: 14px; margin: 2px 0; }
.ticket .t-linea { border-top: 1px dashed #000; margin: 4px 0; }
.ticket .t-tabla { width: 100%; border-collapse: collapse; }
.ticket .t-tabla th { font-weight: bold; border-bottom: 1px dashed #000; }
.ticket .t-tabla td, .ticket .t-tabla th { padding: 1px 0; vertical-align: top; }
.ticket .t-fila { display: flex; justify-content: space-between; }
.ticket .t-total { font-size: 14px; font-weight: bold; }

#zona-impresion { display: none; }

@media print {
    /* Con el botón Imprimir: solo se deja el ticket copiado en #zona-impresion */
    body.imprimiendo > *:not(#zona-impresion) { display: none !important; }
    body.imprimiendo #zona-impresion { display: block; }
    body.imprimiendo, html { height: auto !important; min-height: 0 !important; background: #fff !important; }
    #zona-impresion .ticket { margin: 0; box-shadow: none; page-break-inside: avoid; }

    /* Con Ctrl+P (sin el botón) */
    body:not(.imprimiendo) * { visibility: hidden !important; }
    body:not(.imprimiendo) .ticket, body:not(.imprimiendo) .ticket * { visibility: visible !important; }
    body:not(.imprimiendo) .ticket { position: absolute; left: 0; top: 0; box-shadow: none; margin: 0; }
    .no-print { display: none !important; }
}

/* ===== Combos (select): .input-modern tiene 12px de relleno y Bootstrap fija el alto en 38px,
   por eso el texto se cortaba. Se deja que el alto crezca y el relleno vertical sea menor. ===== */
select.input-modern,
select.form-control.input-modern {
    height: auto !important;
    min-height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
    line-height: 1.5 !important;
    font-size: 0.95rem;
    text-overflow: ellipsis;
}
select.input-modern option { background: #2a2a2a; color: #fff; }

/* ===== Buscador de cliente (Crear venta) ===== */
.cliente-elegido {
    display: flex; align-items: center; justify-content: space-between;
    min-height: calc(1.5em + 1rem + 2px);
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
    background: #1f2a1f; border: 1px solid #2e7d32; border-radius: 10px; color: #fff;
}
.lista-clientes {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px;
    background: #262626; border: 1px solid #555; border-radius: 10px; overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
.lista-clientes .item-cliente {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    padding: 0.5rem 0.75rem; border: 0; background: transparent; color: #f1f1f1; text-align: left;
}
.lista-clientes .item-cliente small { color: #aaa; margin-left: 0.5rem; }
.lista-clientes .item-cliente.activo { background: #ffcb74; color: #111; }
.lista-clientes .item-cliente.activo small { color: #333; }
.lista-clientes .pie-lista { padding: 0.35rem 0.75rem; font-size: 0.8rem; color: #aaa; border-top: 1px solid #444; }

/* ===== Modales: si el contenido es alto, aparece la barra de desplazamiento dentro del modal ===== */
.modal.d-block { overflow-y: auto; }
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 3.5rem); }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
