/* =========================================================
   ESTILOS GENERALES Y RESET - TEMA ROJO "EL 93"
========================================================= */
body {
    background-color: #fcfcfc;
    font-family: 'Roboto', Arial, sans-serif;
    color: #2c2c2c;
    padding-top: 56px;
    font-size: 1.07rem;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: #B71C1C;
    font-weight: 700;
    letter-spacing: 0.7px;
    margin-bottom: 0.7em;
}

/* =========================================================
   COMPONENTES BASE (CARDS Y FORMULARIOS)
========================================================= */
.form-container,
.card {
    border: 1.5px solid #ffcccc;
    background: #fff;
    padding: 36px 32px;
    border-radius: 14px;
    box-shadow: 0 6px 32px rgba(183, 28, 28, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-8px) scale(1.012);
    box-shadow: 0 10px 36px rgba(183, 28, 28, 0.15);
}

/* Inputs y Selects */
input.form-control,
select.form-control,
textarea.form-control {
    border: 1.5px solid #ffcccc;
    border-radius: 7px;
    padding: 0.55em 1em;
    font-size: 1.05rem;
    background: #fffafa;
    transition: border 0.2s, box-shadow 0.2s;
}

input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: #E53935;
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.15);
    background: #fff;
}

.is-invalid {
    border: 2px solid #E53935 !important;
}

label, .col-form-label {
    font-weight: 700;
    color: #B71C1C;
    margin-bottom: 0.3em;
}

/* =========================================================
   BOTONES PRINCIPALES
========================================================= */
button,
.btn-primary {
    background: linear-gradient(90deg, #E53935 0%, #B71C1C 100%);
    border: none;
    color: #fff !important;
    font-weight: 600;
    letter-spacing: 0.6px;
    border-radius: 7px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.2);
    padding: 0.7em 2.2em;
}

button:hover,
.btn-primary:hover {
    background: linear-gradient(90deg, #FF6B6B 0%, #E53935 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(183, 28, 28, 0.3);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =========================================================
   HERO SECTION Y NAVBAR
========================================================= */
.navbar {
    background-color: #B71C1C;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.hero-section {
    background: linear-gradient(120deg, rgba(229, 57, 53, 0.9) 0%, rgba(183, 28, 28, 0.9) 100%), url('/static/images/hero.png') no-repeat center center;
    background-size: cover;
    color: #fff;
    padding: 80px 0 60px 0;
    border-radius: 0 0 22px 22px;
}

.hero-content h1 {
    font-size: 3.4rem;
    font-weight: 800;
    color: #fff;
}

/* =========================================================
   GRILLAS DE BOTONES (PAGOS, IMPRESIÓN, CLIENTES)
========================================================= */
#imprimir_btns, #formas_pago_btns, #clientes_cc_btns, #formas_pago_btns1, #clientes_cc_btns1, #imprimir_btns1 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
    width: 100%;
}

/* Botones Estilo Celda */
.imprimir-btn, .forma-pago-btn, .cliente-cc-btn, .forma-pago-btn1, .cliente-cc-btn1, .imprimir-btn1 {
    background: #E53935 !important;
    border: 2px solid #B71C1C !important;
    color: #fff !important;
    padding: 0.8rem 0.5rem;
    font-weight: 500;
    border-radius: 0.6rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.imprimir-btn:hover, .forma-pago-btn:hover, .cliente-cc-btn:hover, .forma-pago-btn1:hover {
    background-color: #FF6B6B !important;
    transform: translateY(-3px);
}

.imprimir-btn.active, .forma-pago-btn.active, .cliente-cc-btn.active, .forma-pago-btn1.active {
    background-color: #ff6363 !important;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    transform: translateY(-5px);
}

/* =========================================================
   TABLAS Y LISTADOS
========================================================= */
table.table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

table.table th, #tabla-articulos1 th {
    background: linear-gradient(90deg, #E53935 0%, #B71C1C 100%);
    color: #fff;
    font-weight: 700;
    padding: 12px;
    font-size: 1rem;
}

table.table td, #tabla-articulos td, #tabla-articulos1 td {
    color: #333;
    padding: 0.8em 1em;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

/* =========================================================
   SUCURSALES
========================================================= */
.sucursal-card-sucursal {
    background: #ffffff;
    border: 2px solid #ffcccc;
    border-radius: 0.9rem;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 10px 22px rgba(183, 28, 28, 0.1);
}

.forma-pago-btn-sucursal {
    background: #E53935;
    border: 2px solid #B71C1C;
    color: #fff !important;
    padding: 1.2rem;
    border-radius: 0.8rem;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.forma-pago-btn-sucursal:hover {
    background: #B71C1C;
    box-shadow: 0 10px 18px rgba(183, 28, 28, 0.2);
    transform: translateY(-4px);
}

/* =================== SUGERENCIAS DNI =================== */
#sugerencias_dni1 {
    border: 1px solid #B71C1C;
    background: white;
    position: absolute;
    width: 85%;
    z-index: 1050;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
}

#sugerencias_dni1 li:hover {
    background: #E53935;
    color: #fff;
}

/* =========================================================
   ANIMACIONES Y OVERLAYS
========================================================= */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#overlay-sucursal, #overlay {
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(3px);
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 768px) {
    .container { padding: 12px 10px; margin-top: 20px; }
    .hero-content h1 { font-size: 2.2rem; }
    
    #imprimir_btns, #formas_pago_btns, #clientes_cc_btns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    table.table th, table.table td {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
}

footer {
    background: #B71C1C;
    color: #fff;
    padding: 30px 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

#btn-finalizar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.is-invalid {
    border: 2px solid #E53935 !important;
}

#imprimir_btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
    width: 100%;
}

.imprimir-btn {
    background: #E53935 !important;
    border: 2px solid #B71C1C !important;
    color: #fff !important;
    padding: 0.6rem;
    font-weight: 600;
    border-radius: 0.6rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.9rem;
}

/* Hover */
.imprimir-btn:hover {
    background-color: #FF6B6B !important;
    transform: translateY(-3px);
}

/* Activo */
.imprimir-btn.active,
.imprimir-btn:active {
    background-color: #a82a00 !important;
    border-color: #B71C1C !important;
    color: #fff !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    transform: translateY(-5px);
}

/* 📱 Responsive */
@media (max-width: 768px) {
    #imprimir_btns {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    .imprimir-btn {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    #imprimir_btns {
        grid-template-columns: repeat(2, 1fr);
    }
    .imprimir-btn {
        font-size: 0.75rem;
        padding: 0.4rem;
    }
}

#formas_pago_btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
    width: 100%;
}

.forma-pago-btn {
    background: #E53935 !important;
    border: 2px solid #B71C1C !important;
    color: #fff !important;
    padding: 0.6rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.9rem;
}

/* Hover */
.forma-pago-btn:hover {
    color: #fff;
    transform: translateY(-3px);
    background:#FF6B6B;
}

/* Activo */
.forma-pago-btn.active {
    background-color: #a82a00 !important;
    border-color: #B71C1C !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transform: translateY(-5px);
}

/* 📱 Responsive */
@media (max-width: 768px) {
    #formas_pago_btns {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    .forma-pago-btn {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    #formas_pago_btns {
        grid-template-columns: repeat(2, 1fr);
    }
    .forma-pago-btn {
        font-size: 0.75rem;
        padding: 0.4rem;
    }
}

#tabla-articulos th, 
#tabla-articulos td {
  white-space: nowrap;
  font-size: 0.85rem;
  padding: 0.4rem;
}

@media (max-width: 768px) {
  #tabla-articulos th,
  #tabla-articulos td {
    font-size: 0.75rem;
    padding: 0.3rem;
  }
}

/* overlay  */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================= CLIENTES ================= */

#clientes_cc_btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
    width: 100%;
}

.cliente-cc-btn {
    background: #FF6B6B !important;
    border: 2px solid #B71C1C !important;
    color: #fff !important;
    padding: 0.6rem;
    font-weight: 600;
    border-radius: 0.6rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.9rem;
}

.cliente-cc-btn:hover {
    transform: translateY(-3px);
}

.cliente-cc-btn.active {
    background-color: #a82a00 !important;
    border-color: #B71C1C !important;
    color: #fff !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    transform: translateY(-5px);
}

/* ================= CUENTA CORRIENTE ================= */

.forma-pago-btn1,
.cliente-cc-btn1,
.imprimir-btn1 {
    background: #E53935;
    border: 2px solid #B71C1C;
    color: #fff !important;
    padding: 0.8rem 0.5rem;
    font-weight: 600;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.75rem;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.forma-pago-btn1:hover,
.cliente-cc-btn1:hover,
.imprimir-btn1:hover {
    background: #FF6B6B;
}

.forma-pago-btn1.active,
.cliente-cc-btn1.active,
.imprimir-btn1.active {
    background: #a82a00 !important;
    color: #fff !important;
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    border-color: #B71C1C;
}

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

#tabla-articulos1 th {
    background-color: #F4F4F4;
    color: #ffffff;
    font-weight: 700;
}

#tabla-articulos1 th,
#tabla-articulos1 td {
    font-size: 0.85rem;
    padding: 0.6rem 0.4rem;
    white-space: nowrap;
}

/* ================= SUGERENCIAS ================= */

#sugerencias_dni1 {
    border: 1px solid #B71C1C;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    position: absolute;
    background: white;
    width: 85%;
    list-style: none;
    padding-left: 0;
    z-index: 1050;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

#sugerencias_dni1 li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

#sugerencias_dni1 li:hover {
    background: #E53935;
    color: #fff;
}

/* ================= BOTON REGISTRAR ================= */

.btn-success1 {
    background-color: #E53935 !important;
    color: #fff;
    border: 2px solid #B71C1C !important;
}

/* ================= SUCURSALES ================= */

.forma-pago-btn-sucursal {
    background: #E53935;
    border: 2px solid #B71C1C;
    color: #fff !important;
    padding: 1rem 0.75rem;
    font-weight: 600;
    border-radius: 0.7rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    font-size: 0.8rem;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.forma-pago-btn-sucursal:hover {
    background: #FF6B6B;
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.18);
}

.sucursal-btn-sucursal {
    min-height: 120px;
    gap: 0.4rem;
    position: relative;
}

.sucursal-btn-sucursal i {
    font-size: 1.6rem;
}

.sucursal-btn-sucursal::after {
    font-size: 0.65rem;
    letter-spacing: 1px;
    opacity: 0.85;
}

.sucursal-card-sucursal {
    background: #ffffff;
    border: 2px solid #B71C1C;
    border-radius: 0.9rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

#sucursales_btns-sucursal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
}

#overlay-sucursal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}