@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter_18pt-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter_18pt-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter_18pt-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter_18pt-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html, body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ===================== APP LAYOUT ===================== */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background-color: var(--gris-claro);
}

/* Topbar (visible solo en movil/tablet) */
.app-topbar {
    display: none;
    align-items: center;
    gap: 1rem;
    background-color: var(--azul-oscuro);
    padding: 0.85rem 1.2rem;
}

.topbar-titulo {
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

/* Boton hamburguesa */
.btn-hamburguesa {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.btn-hamburguesa span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: white;
    border-radius: 2px;
}

/* Overlay oscuro al abrir sidebar en movil */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: 250px;
    min-width: 250px;
    background-color: var(--azul-oscuro);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-logo {
    padding: 1.5rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 4px;
}

.sidebar-brand {
    color: white;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-item {
    margin: 0.1rem 0.75rem;
}

.sidebar-link {
    display: block;
    padding: 0.65rem 1rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92rem;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background-color: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-link-active {
    background-color: var(--naranja) !important;
    color: white !important;
    font-weight: 600;
}

/* Grupos colapsables del sidebar */
.sidebar-grupo {
    margin: 0.1rem 0.75rem;
}

.sidebar-grupo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: normal;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-grupo-header:hover {
    background-color: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
}

.sidebar-grupo-arrow {
    font-size: 1.1rem;
    transition: transform 0.2s;
    display: inline-block;
}

.sidebar-grupo-arrow.expandido {
    transform: rotate(90deg);
}

.sidebar-subitems {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-sublink {
    display: block;
    padding: 0.55rem 1rem 0.55rem 1.75rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-sublink:hover {
    background-color: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.sidebar-user-name {
    color: white;
    font-size: 0.88rem;
    font-weight: 600;
}

.sidebar-user-rol {
    color: var(--naranja);
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

.btn-cerrar-sesion {
    width: 100%;
    background-color: transparent;
    border: 1.5px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.75);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cerrar-sesion:hover {
    background-color: rgba(255,255,255,0.08);
    color: white;
    border-color: rgba(255,255,255,0.5);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #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 {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* ===================== VARIABLES ===================== */
:root {
    --azul-oscuro: #051E42;
    --azul-medio: #254d8f;
    --naranja: #E8732A;
    --naranja-hover: #d4621f;
    --gris-texto: #4a4a4a;
    --gris-claro: #e4e6e9;
}

/* ===================== LOGIN ===================== */
html, body {
    height: 100%;
    margin: 0;
}

.login-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.login-left {
    flex: 1;
    background-color: var(--azul-oscuro);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left-content {
    text-align: center;
    color: white;
    z-index: 1;
    padding: 2rem;
}

.brand-name {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.brand-tagline {
    font-size: 1rem;
    color: var(--naranja);
    font-weight: 500;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo-img {
    width: 120px;
    margin-bottom: 1.5rem;
}

.hero-img {
    width: 100%;
    max-width: 380px;
    border-radius: 16px;
    opacity: 0.9;
    margin-top: 1rem;
}

.login-left::before {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(232, 115, 42, 0.08);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.login-left::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}

.login-right {
    flex: 1;
    background-color: var(--gris-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--azul-oscuro);
    margin-bottom: 0.4rem;
}

.login-subtitle {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.form-label {
    font-weight: 600;
    color: var(--gris-texto);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-control {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--azul-oscuro);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.1);
}

.btn-login {
    background-color: var(--naranja);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.btn-login:hover:not(:disabled) {
    background-color: var(--naranja-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-olvidaste {
    text-align: center;
    margin-top: 1rem;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--azul-oscuro);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--naranja);
}

.modal-titulo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--azul-oscuro);
    margin-bottom: 0;
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.btn-modal-cerrar {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0 0.25rem;
}

.btn-modal-cerrar:hover:not(:disabled) {
    color: var(--azul-oscuro);
}

.cfg-acciones {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.form-acciones {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.input-ojo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-ojo-wrapper .form-control {
    padding-right: 2.75rem;
}

.btn-ojo {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    color: #666;
    line-height: 1;
}

.btn-ojo:hover {
    color: var(--azul-oscuro);
}

/* ===================== RESPONSIVE ===================== */

/* Tablet y movil: sidebar se oculta y aparece como panel deslizante */
@media (max-width: 991px) {
    .app-topbar {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 100;
        transition: left 0.25s ease;
        width: 260px;
        min-width: 260px;
        overscroll-behavior: contain;
    }

    .sidebar.sidebar-open {
        left: 0;
    }

    .app-content {
        padding: 1.25rem;
    }
}

/* Movil pequeno */
@media (max-width: 576px) {
    .app-content {
        padding: 1rem;
    }

    .login-left {
        display: none;
    }

    .login-right {
        flex: 1;
    }
}

/* ===================== PAGINAS GENERALES ===================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1.5px solid #e8ecf0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.page-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--azul-oscuro);
}

.btn-volver {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 1rem;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    transition: background-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.btn-volver:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-volver-blanco {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===================== BOTONES DE ACCION ===================== */

.btn-accion {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-accion-primary {
    background-color: var(--naranja);
    color: white;
    border: 1.5px solid transparent;
}

.btn-accion-primary:hover {
    background-color: var(--naranja-hover);
    color: white;
}

.btn-accion-secondary {
    background-color: white;
    color: var(--gris-texto);
    border: 1.5px solid #ddd;
}

.btn-accion-secondary:hover {
    background-color: #f5f5f5;
    color: var(--gris-texto);
}

.btn-accion-danger {
    background-color: #dc3545;
    color: white;
}

.btn-accion-danger:hover {
    background-color: #c82333;
    color: white;
}

/* ===================== FILTROS ===================== */

.filtros-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filtro-busqueda {
    flex: 2;
    min-width: 200px;
}

.filtro-select {
    flex: 1;
    min-width: 150px;
}

.filtro-fecha {
    flex: 0 0 auto;
    width: 145px;
}

.filtros-fechas {
    display: flex;
    gap: 0.75rem;
    flex: 2;
    min-width: 200px;
}

.filtro-fecha-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.filtro-fecha-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    line-height: 1;
}

/* ===================== TABLA ===================== */

.tabla-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tabla thead tr {
    background-color: var(--azul-oscuro);
    color: white;
}

.th-sortable {
    cursor: pointer;
    user-select: none;
}

.th-sortable:hover {
    background-color: rgba(255,255,255,0.1);
}


.tabla th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
}

.tabla td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--gris-texto);
    vertical-align: middle;
    font-size: 0.88rem;
}

.tabla tbody tr:last-child td {
    border-bottom: none;
}

.tabla tbody tr:hover td {
    background-color: #fafafa;
}

.fila-clickeable { cursor: pointer; }
.fila-anulada td { opacity: 0.5; text-decoration: line-through; }

.col-angosta {
    width: 80px;
    white-space: nowrap;
}

.col-acciones {
    width: 1%;
    white-space: nowrap;
}

.texto-secundario {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

.acciones-fila {
    display: flex;
    gap: 0.4rem;
}

.btn-fila {
    padding: 0.25rem 0.45rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
}

.btn-fila-ver {
    background-color: #e8f0fb;
    color: var(--azul-oscuro);
}

.btn-fila-ver:hover {
    background-color: #d0e1f9;
    color: var(--azul-oscuro);
}

.btn-fila-editar {
    background-color: #fff3e0;
    color: #c85a00;
}

.btn-fila-editar:hover {
    background-color: #ffe0b2;
    color: #c85a00;
}

.btn-fila-anular {
    background-color: #fdecea;
    color: #c0392b;
}

.btn-fila-anular:hover {
    background-color: #fad7d4;
    color: #c0392b;
}

.btn-fila-activar {
    background-color: #e8f5e9;
    color: #27ae60;
}

.btn-fila-activar:hover {
    background-color: #c8e6c9;
    color: #27ae60;
}

/* ===================== PAGINACION ===================== */

.paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-pagina {
    padding: 0.4rem 0.9rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-pagina:hover:not(:disabled) {
    background-color: var(--azul-oscuro);
    color: white;
    border-color: var(--azul-oscuro);
}

.btn-pagina:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagina-info {
    font-size: 0.9rem;
    color: var(--gris-texto);
}

/* ===================== ESTADOS ===================== */

.estado-carga,
.estado-vacio {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 0.95rem;
}

/* ===================== ALERTAS ===================== */

.alerta {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.alerta-error {
    background-color: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alerta-exito {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alerta-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===================== MODAL ===================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.modal-advertencia {
    color: #888;
    font-size: 0.9rem;
}

.modal-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ===================== FORMULARIOS ===================== */

.form-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-weight: 700;
    color: var(--azul-oscuro);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--naranja);
    display: inline-block;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

/* ===================== DETALLE CLIENTE ===================== */

.cliente-header {
    background-color: var(--azul-oscuro);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.cliente-header-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}


.cliente-header-nombre {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.cliente-header-sub {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    margin-top: 0.3rem;
}

.header-sep {
    margin: 0 0.4rem;
    opacity: 0.4;
}

.cliente-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cliente-header-right .btn-accion {
    min-width: 100px;
    text-align: center;
}

.ficha-cliente {
    background: white;
    border-radius: 12px;
    padding: 0 1.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.ficha-cliente .ficha-seccion-titulo:first-child {
    margin-top: 0;
}

.ficha-seccion-titulo {
    font-weight: 700;
    color: white;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--azul-oscuro);
    padding: 0.4rem 1.75rem;
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    margin-left: -1.75rem;
    margin-right: -1.75rem;
}

.ficha-fila {
    display: flex;
    align-items: flex-start;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 0;
}

.ficha-fila:last-child {
    border-bottom: none;
}

.ficha-label {
    font-size: 0.88rem;
    color: #888;
    width: 200px;
    min-width: 200px;
}

.ficha-valor {
    font-size: 0.9rem;
    color: var(--gris-texto);
    font-weight: 500;
}

@media (max-width: 576px) {
    .cliente-header {
        padding: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .cliente-header-left {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cliente-header-nombre {
        font-size: 1.2rem;
    }

    .cliente-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .ficha-cliente {
        padding: 0.5rem 1.25rem 1.25rem;
    }

    .ficha-seccion-titulo {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        margin-left: -1.25rem;
        margin-right: -1.25rem;
    }
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-activo {
    background-color: #d4edda;
    color: #155724;
}

.badge-inactivo {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-alerta {
    background-color: #fff3cd;
    color: #856404;
}

.badge-peligro {
    background-color: #f8d7da;
    color: #842029;
}

.badge-info {
    background-color: #cce5ff;
    color: #004085;
}

.badge-pendiente {
    background-color: #e2e3e5;
    color: #383d41;
}

.badge-secundario {
    background-color: #f0f0f0;
    color: #6c757d;
}

.badge-lg {
    font-size: 0.95rem;
    padding: 0.3rem 0.9rem;
}

/* ===================== FILTRO FECHA DESPLEGABLE ===================== */

.btn-filtro-fecha {
    background: white;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}

.btn-filtro-fecha:hover {
    border-color: var(--naranja);
    color: var(--naranja);
}

.btn-filtro-fecha-activo {
    border-color: var(--naranja);
    background: #fff5ee;
    color: var(--naranja);
}

.filtro-fecha-panel {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filtro-fecha-tabs {
    display: flex;
    gap: 0.5rem;
}

.filtro-fecha-tab {
    background: #f3f4f6;
    border: 1.5px solid transparent;
    border-radius: 6px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}

.filtro-fecha-tab:hover {
    border-color: var(--naranja);
    color: var(--naranja);
}

.filtro-fecha-tab-activo {
    background: var(--naranja);
    border-color: var(--naranja);
    color: white;
}

.filtro-fecha-inputs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filtro-fecha-inputs .filtro-fecha-group {
    flex: 1;
    min-width: 140px;
}

/* ===================== PEDIDOS ===================== */

/* Tarjetas móvil */
.lista-tarjetas {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tarjeta-pedido {
    background: white;
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    border-left: 3px solid var(--naranja);
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.tarjeta-pedido:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

.tarjeta-pedido-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.tarjeta-codigo {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--azul-oscuro);
}

.tarjeta-pedido-cliente {
    font-size: 0.93rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.tarjeta-pedido-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: #555;
    margin-top: 0.1rem;
}

.tarjeta-total {
    font-weight: 700;
    color: #1a1a2e;
}

.tarjeta-pedido-entrega {
    font-size: 0.83rem;
    color: #777;
    margin-top: 0.3rem;
}

/* Estado bar en detalle */
.detalle-estado-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Reserva countdown */
.reserva-timer {
    font-weight: 600;
    color: #004085;
    background: #cce5ff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.88rem;
}

/* Alerta inline (junto a badge estado) */
.alerta-inline {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.88rem;
}

.alerta-advertencia {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Acciones sobre el pedido */
.acciones-pedido {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-accion-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.btn-accion-danger:hover:not(:disabled) { background-color: #b02a37; }
.btn-accion-danger:disabled { opacity: 0.6; cursor: not-allowed; }

/* Tabla compact (líneas pedido) */
.tabla-compact { margin-bottom: 0; }

/* Grid de detalle */
.detalle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem 1.5rem;
}

.detalle-campo {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.detalle-campo-full { grid-column: 1 / -1; }

.detalle-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Resumen totales */
.resumen-totales {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    max-width: 380px;
    margin-left: auto;
}

.resumen-totales-compact {
    margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DETALLE PEDIDO — rediseño completo
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero header ─────────────────────────────────────────────────────────── */
.pd-hero {
    border-radius: 12px;
    padding: 1.25rem 1.5rem 1rem;
    margin-bottom: 1rem;
    color: #fff;
}
.pd-hero-pendiente  { background: linear-gradient(135deg, #051E42 0%, #2a5298 100%); }
.pd-hero-confirmado { background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%); }
.pd-hero-entregado  { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); }
.pd-hero-anulado    { background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%); }

.pd-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.pd-hero-volver {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s;
}
.pd-hero-volver:hover { color: #fff; }
.pd-hero-codigo {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.9);
}

.pd-hero-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
}
.pd-hero-estado-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    padding: 0.2rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}
.pd-hero-cliente {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}
.pd-hero-fecha {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    margin-top: 0.2rem;
}
.pd-hero-total { text-align: right; }
.pd-hero-total-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pd-hero-total-monto {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

/* Timer bar */
.pd-timer-bar {
    margin-top: 0.9rem;
    padding: 0.5rem 0.9rem;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255,255,255,0.25);
}
.pd-timer-vencido {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
}

/* ── Acciones ────────────────────────────────────────────────────────────── */
.pd-acciones {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.pd-btn-confirmar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #E8732A;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.pd-btn-confirmar:hover:not(:disabled) { background: #d4621f; }
.pd-btn-confirmar:active:not(:disabled) { transform: scale(0.98); }
.pd-btn-confirmar:disabled { opacity: 0.6; cursor: not-allowed; }

.pd-btn-anular {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    color: #dc2626;
    border: 2px solid #dc2626;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pd-btn-anular:hover:not(:disabled) { background: #dc2626; color: #fff; }
.pd-btn-anular:disabled { opacity: 0.5; cursor: not-allowed; }

.pd-btn-facturar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: 2px solid #16a34a;
    background: transparent;
    color: #16a34a;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pd-btn-facturar:hover:not(:disabled) { background: #16a34a; color: #fff; }
.pd-btn-facturar:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===================== FACTURACION DETALLE ===================== */
.fc-hero       { padding: 1.25rem 1rem 1rem; border-radius: 10px; margin-bottom: 1rem; color: #fff; }
.fc-hero-top   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.fc-hero-body  { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 0.5rem; }
.fc-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.fc-tipo-badge { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; }
.fc-cliente    { font-size: 1.1rem; font-weight: 600; margin-top: 0.2rem; }
.fc-sub        { font-size: 0.8rem; opacity: 0.8; }
.fc-total      { font-size: 1.5rem; font-weight: 700; }
.fc-fecha      { font-size: 0.8rem; opacity: 0.8; }

/* ── Layout de cuerpo: 2 columnas en escritorio ──────────────────────────── */
.pd-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 900px) {
    .pd-body { grid-template-columns: 1fr 320px; align-items: start; }
}

/* ── Secciones ───────────────────────────────────────────────────────────── */
.pd-seccion {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}
.pd-col-side .pd-seccion { margin-bottom: 0.75rem; }

.pd-seccion-titulo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #051E42;
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #f0f0f0;
}
.pd-seccion-badge {
    background: #051E42;
    color: #fff;
    border-radius: 20px;
    padding: 0.05rem 0.55rem;
    font-size: 0.72rem;
    margin-left: auto;
}

/* ── Items de producto ───────────────────────────────────────────────────── */
.pd-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.pd-item:last-of-type { border-bottom: none; }

.pd-item-left { flex: 1; min-width: 0; }
.pd-item-nombre {
    font-weight: 700;
    font-size: 0.95rem;
    color: #051E42;
    margin-bottom: 0.35rem;
}
.pd-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}
.pd-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
}
.pd-tag-marca {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}
.pd-item-codigo {
    font-size: 0.72rem;
    color: #9ca3af;
}

.pd-item-right {
    text-align: right;
    flex-shrink: 0;
}
.pd-item-cantidad {
    font-size: 0.8rem;
    color: #64748b;
}
.pd-item-precio {
    font-size: 0.78rem;
    color: #94a3b8;
}
.pd-item-subtotal {
    font-size: 1rem;
    font-weight: 700;
    color: #051E42;
    margin-top: 0.2rem;
}

.pd-item-bono {
    background: #fffbeb;
    border-left: 3px solid #fbbf24;
}

.pd-item-subtotal-bono {
    color: #16a34a;
}

/* ── Totales ─────────────────────────────────────────────────────────────── */
.pd-totales {
    border-top: 2px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}
.pd-total-fila {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #555;
    padding: 0.25rem 0;
}
.pd-total-descuento span:last-child { color: #16a34a; font-weight: 600; }
.pd-total-final {
    font-size: 1.05rem;
    font-weight: 800;
    color: #051E42;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}

/* ── Info lateral ────────────────────────────────────────────────────────── */
.pd-info-fila {
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.pd-info-fila:last-child { border-bottom: none; }
.pd-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.15rem;
}
.pd-info-valor {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}
.pd-seccion-obs { border-left: 3px solid #E8732A; }
.pd-obs-texto {
    font-size: 0.875rem;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* ── Historial timeline ──────────────────────────────────────────────────── */
.pd-historial { padding-left: 1rem; }
.pd-historial-item {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1.1rem;
}
.pd-historial-item:last-child { padding-bottom: 0; }
.pd-historial-linea {
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}
.pd-historial-item:last-child .pd-historial-linea { display: none; }
.pd-historial-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #cbd5e1;
}
.pd-historial-dot.badge-info     { background: #0284c7; box-shadow: 0 0 0 2px #0284c7; }
.pd-historial-dot.badge-activo   { background: #16a34a; box-shadow: 0 0 0 2px #16a34a; }
.pd-historial-dot.badge-inactivo { background: #b91c1c; box-shadow: 0 0 0 2px #b91c1c; }
.pd-historial-dot.badge-pendiente{ background: #9ca3af; box-shadow: 0 0 0 2px #9ca3af; }

.pd-historial-contenido { }
.pd-historial-estados {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}
.pd-historial-flecha { color: #9ca3af; font-size: 0.8rem; }
.pd-historial-obs {
    font-size: 0.82rem;
    color: #555;
    margin-bottom: 0.2rem;
}
.pd-historial-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

.text-right  { text-align: right; }
.text-center { text-align: center; }
.col-derecha { text-align: right; }

.resumen-fila {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #444;
}

.resumen-total {
    border-top: 2px solid #dee2e6;
    margin-top: 0.4rem;
    padding-top: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: #111;
}

/* Historial */
.historial-lista {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.historial-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.historial-item:last-child { border-bottom: none; }

.historial-estados {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.historial-flecha { color: #888; font-weight: 700; }

.historial-obs {
    font-size: 0.88rem;
    color: #444;
    margin-bottom: 0.15rem;
}

.historial-meta {
    font-size: 0.78rem;
    color: #999;
}

/* Formulario nuevo pedido */
.agregar-producto-row {
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.fg-flex { flex: 1; min-width: 180px; }
.fg-small { width: 100px; flex-shrink: 0; }
.fg-btn { flex-shrink: 0; }

.btn-fila-eliminar {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 1rem;
    transition: background 0.15s;
}

.btn-fila-eliminar:hover { background: #f8d7da; }

/* ===================== NUEVO PEDIDO ===================== */

/* Spinner carga */
.np-cargando {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: #888;
    font-size: 0.95rem;
}

.np-cargando-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--azul-oscuro);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Padding extra cuando aparece la barra sticky */
.np-con-barra { padding-bottom: 90px; }

/* Card base del formulario */
.np-card {
    background: white;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
}

/* Cabecera numerada de cada paso */
.np-paso-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.np-paso-numero {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--azul-oscuro);
    color: white;
    font-weight: 800;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.np-paso-opcional { background: #aaa; }

.np-paso-titulo {
    font-weight: 700;
    font-size: 1rem;
    color: #222;
    flex: 1;
}

.np-badge-cantidad {
    background: var(--naranja);
    color: white;
    border-radius: 20px;
    padding: 0.1rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Select grande (más alto, más legible en móvil) */
.np-select-grande {
    height: 52px;
    font-size: 0.95rem;
    border-radius: 10px;
}

/* Ficha del cliente seleccionado */
.np-ficha-cliente {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #eef3ff;
    border: 1.5px solid #c5d3f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.np-ficha-check {
    font-size: 1.5rem;
    color: #2a6de8;
    flex-shrink: 0;
}

.np-ficha-nombre {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a2e6b;
}

.np-ficha-doc {
    font-size: 0.8rem;
    color: #667;
    margin-top: 0.1rem;
}

/* Bloque de dirección */
.np-direccion-bloque {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}

.np-direccion-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.35rem;
}

.np-direccion-valor {
    font-size: 0.92rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.np-btn-cambiar-dir {
    background: none;
    border: none;
    color: var(--azul-oscuro);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.np-btn-cambiar-dir:hover { color: var(--naranja); }

/* Campos opcionales colapsables */
.np-opcionales { margin-top: 0.75rem; }

.np-btn-opcionales {
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.np-btn-opcionales:hover { color: var(--azul-oscuro); }

.np-opcionales-contenido {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

/* Preview del producto seleccionado */
.np-preview-producto {
    background: #fff8f0;
    border: 1.5px solid #E8732A33;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin: 0.75rem 0;
}

.np-preview-nombre {
    font-weight: 700;
    font-size: 0.97rem;
    color: #222;
    margin-bottom: 0.2rem;
}

.np-preview-codigo {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #E8732A;
    background: #fff3e8;
    border: 1px solid #E8732A55;
    border-radius: 4px;
    padding: 0 5px;
    margin-right: 4px;
    vertical-align: middle;
}

.np-preview-detalle {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.np-preview-stock { margin-bottom: 0.85rem; }

/* Fila de cantidad + precio en el preview */
.np-agregar-fila {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 0.85rem;
}

.np-agregar-campo {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.np-agregar-campo label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #666;
}

.np-agregar-subtotal { margin-left: auto; text-align: right; }

.np-subtotal-preview {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--azul-oscuro);
    line-height: 44px;
}

/* Stepper de cantidad */
.np-stepper {
    display: flex;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    height: 44px;
}

.np-stepper-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #f4f5f7;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.np-stepper-btn:hover { background: #e2e6ea; }

.np-stepper-input {
    width: 56px;
    text-align: center;
    border: none;
    border-left: 1.5px solid #dee2e6;
    border-right: 1.5px solid #dee2e6;
    height: 44px;
    font-size: 1rem;
    font-weight: 700;
    -moz-appearance: textfield;
}

.np-stepper-input::-webkit-outer-spin-button,
.np-stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Botón "Agregar al pedido" */
.np-btn-agregar {
    width: 100%;
    background: var(--naranja);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.15s;
}

.np-btn-agregar:hover { background: var(--naranja-hover); }

/* Lista de productos (carrito) */
.np-carrito { margin-top: 1rem; }

.np-carrito-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.6rem;
}

.np-carrito-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: #fafafa;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.np-carrito-info { flex: 1; min-width: 0; }

.np-carrito-nombre {
    font-weight: 600;
    font-size: 0.9rem;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-carrito-detalle {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.05rem;
}

.np-carrito-precio {
    font-size: 0.78rem;
    color: #888;
    margin-top: 0.1rem;
}

.np-carrito-subtotal {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--azul-oscuro);
    white-space: nowrap;
    flex-shrink: 0;
}

.np-carrito-delete {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.np-carrito-delete:hover { color: #dc3545; background: #fde8e8; }

/* Estado vacío del carrito */
.np-carrito-vacio {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #bbb;
    font-size: 0.9rem;
    line-height: 1.8;
}

.np-carrito-vacio-icon { font-size: 2.2rem; display: block; margin-bottom: 0.25rem; }

/* Toggle de descuento */
.np-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.np-toggle input { opacity: 0; width: 0; height: 0; }

.np-toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}

.np-toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.np-toggle input:checked + .np-toggle-slider { background: var(--naranja); }
.np-toggle input:checked + .np-toggle-slider::before { transform: translateX(20px); }

/* Bloque de descuento */
.np-descuento-bloque {
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    margin-top: 0.25rem;
}

.np-descuento-fila {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.np-descuento-pct { flex: 0 0 160px; }

.np-descuento-input-wrapper {
    position: relative;
}

.np-descuento-input-wrapper .form-control {
    padding-right: 2rem;
}

.np-descuento-pct-sym {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-weight: 700;
    pointer-events: none;
}

.np-descuento-calculo {
    text-align: center;
}

.np-descuento-calculo-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.15rem;
}

.np-descuento-calculo-monto {
    font-size: 1.1rem;
    font-weight: 800;
    color: #28a745;
}

/* Footer escritorio */
.np-footer-escritorio {
    display: none;
    justify-content: flex-end;
    padding: 0.5rem 0 1rem;
}

.np-btn-crear {
    background: var(--azul-oscuro);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s;
}

.np-btn-crear:hover:not(:disabled) { background: var(--azul-medio); }
.np-btn-crear:disabled { opacity: 0.6; cursor: not-allowed; }

/* Barra sticky de total */
.np-barra-total {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--azul-oscuro);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 200;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
}

.np-barra-info { flex: 1; }

.np-barra-items {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 0.1rem;
}

.np-barra-monto {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
}

.np-btn-crear-barra {
    background: var(--naranja);
    color: white;
    border: none;
    padding: 0.75rem 1.4rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.np-btn-crear-barra:hover:not(:disabled) { background: var(--naranja-hover); }
.np-btn-crear-barra:disabled { opacity: 0.6; cursor: not-allowed; }

/* En escritorio: mostrar botón footer, ocultar barra */
@media (min-width: 768px) {
    .np-footer-escritorio { display: flex; }
    .np-barra-total { display: none; }
    .np-con-barra { padding-bottom: 0; }
}

/* Dirección de entrega en pedidos */
.check-entrega {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.check-entrega input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.direccion-registrada {
    background: #f0f4ff;
    border: 1px solid #d0d9f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Ocultar/mostrar por breakpoint (sin Bootstrap d-*) */
@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-none.d-md-block { display: block !important; }
}

@media (max-width: 767px) {
    .d-none { display: none !important; }
    .d-md-none { display: block !important; }
    .lista-tarjetas.d-md-none { display: flex !important; }
}

/* ===================== CONTACTOS ===================== */

.seccion-contactos {
    background: white;
    border-radius: 12px;
    padding: 0 1.5rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.seccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--azul-oscuro);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 0.5rem 1.5rem;
    margin-bottom: 1rem;
}

.seccion-titulo {
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.form-contacto {
    background-color: #fafafa;
    border: 1px solid #e8e8e8;
    box-shadow: none;
    margin-bottom: 1.25rem;
}

/* ===================== DESPACHO ===================== */

.despacho-fecha-titulo {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--azul-oscuro);
    margin: 1rem 0 1.25rem;
    letter-spacing: 0.01em;
}

.tarjeta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.badge-zona {
    font-size: 0.75rem;
    font-weight: 600;
    background: #e8f0fe;
    color: var(--azul-oscuro);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
}

.tarjeta-cliente {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.tarjeta-direccion {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.6rem;
}

.tarjeta-acciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ===================== RESPONSIVE TABLA ===================== */

.mostrar-movil {
    display: none;
}

@media (max-width: 768px) {
    .ocultar-movil {
        display: none;
    }

    .mostrar-movil {
        display: flex;
    }

    .filtros-bar {
        flex-direction: column;
    }

    .filtro-busqueda,
    .filtro-select,
    .filtro-fecha {
        flex: none;
        width: 100%;
    }

    .filtros-fechas {
        width: 100%;
        min-width: unset;
    }

    .filtro-fecha-group {
        flex: 1;
    }

    .filtros-fechas .filtro-fecha {
        width: 100%;
    }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===================== DASHBOARD ===================== */

.dash-bienvenida {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1.5px solid #e8ecf0;
}

.dash-titulo {
    margin: 0 0 0.25rem 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--azul-oscuro);
}

.dash-fecha {
    font-size: 0.85rem;
    color: var(--gris-texto);
    text-transform: capitalize;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.dash-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border: 1px solid #edf0f4;
}

.dash-card-icono {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.dash-icono-clientes  { background-color: #e8edf5; color: var(--azul-oscuro); }
.dash-icono-productos { background-color: #fef3e8; color: #E8732A; }
.dash-icono-empleados { background-color: #e8f5ee; color: #1a7f4b; }

.dash-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dash-card-numero {
    font-size: 2rem;
    font-weight: 700;
    color: var(--azul-oscuro);
    line-height: 1;
}

.dash-card-label {
    font-size: 0.82rem;
    color: var(--gris-texto);
    font-weight: 500;
}

@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================== BUSCADOR CLIENTE (Nuevo Pedido) ===================== */

.np-cliente-search {
    position: relative;
}

.np-cliente-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.np-cliente-icon {
    position: absolute;
    left: 0.75rem;
    color: #888;
    font-size: 0.9rem;
    pointer-events: none;
}

.np-cliente-input {
    padding-left: 2.2rem !important;
    padding-right: 2.4rem !important;
    height: 52px;
    font-size: 0.95rem;
    border-radius: 10px;
}

.np-cliente-clear {
    position: absolute;
    right: 0.65rem;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1;
}

.np-cliente-clear:hover { color: #333; }

.np-cliente-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.np-cliente-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    cursor: pointer;
    gap: 0.5rem;
    border-bottom: 1px solid #f2f4f7;
}

.np-cliente-option:last-child { border-bottom: none; }

.np-cliente-option:hover {
    background: #f5f7fa;
}

.np-cliente-option-nombre {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    flex: 1;
}

.np-cliente-option-doc {
    font-size: 0.82rem;
    color: #666;
    white-space: nowrap;
}

.np-cliente-vacio {
    padding: 1rem;
    text-align: center;
    color: #888;
    font-size: 0.88rem;
}

/* ===================== PEDIDOS POR FECHA ===================== */

.fecha-hero {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    padding: 2rem 2rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.fecha-hero-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--azul-oscuro);
    margin: 0 0 1.5rem 0;
}

.fecha-hero-inputs {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.fecha-hero-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: left;
}

.fecha-hero-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.fecha-hero-input {
    min-width: 160px;
    font-size: 1rem;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
}

.fecha-hero-input:focus {
    border-color: var(--naranja);
    box-shadow: 0 0 0 3px rgba(232,115,42,0.15);
    outline: none;
}

.fecha-hero-separador {
    font-size: 1.2rem;
    color: #aaa;
    padding-bottom: 0.5rem;
}

.fecha-hero-filtros {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fecha-hero-filtros .filtro-select {
    max-width: 200px;
    flex: 1;
}

@media (max-width: 767px) {
    .fecha-hero {
        padding: 1.25rem 1rem 1rem;
    }

    .fecha-hero-titulo {
        font-size: 1.05rem;
        margin-bottom: 1.1rem;
    }

    .fecha-hero-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .fecha-hero-separador {
        display: none;
    }

    .fecha-hero-input {
        min-width: unset;
        width: 100%;
    }

    .fecha-hero-filtros .filtro-select {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   Bonificaciones — Nuevo Pedido
═══════════════════════════════════════════════════════════ */
.np-bono-info {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.85rem;
    color: #7a5c00;
    margin-bottom: 1rem;
}

.np-bono-info i {
    color: #f59e0b;
    font-size: 0.95rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.np-btn-agregar-bono {
    background: #f59e0b;
}

.np-btn-agregar-bono:hover {
    background: #d97706;
}

.np-bono-gratis {
    color: #16a34a;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.03em;
}

.np-bono-gratis-small {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.78rem;
}

.np-badge-bono {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    margin-left: 0.4rem;
    vertical-align: middle;
    letter-spacing: 0.04em;
}

.np-carrito-item-bono {
    background: #fffbeb;
    border-left: 3px solid #fbbf24;
}

.np-carrito-subtotal-bono {
    color: #16a34a;
    font-weight: 700;
}

.np-barra-bono-count {
    color: #fbbf24;
    font-weight: 600;
}
}