* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Merriweather', serif;
}

body {
    background-color: #fff;
}

.container-index {
    width: 100%;
    height: 100%;
    position: absolute;
    display: grid;
    align-items: center;
}

.row-index {
    width: 80%;
    height: 80%;
    margin: 10%;
    background-color: #fff;
    display: grid;
    grid-template-rows: 30% 65% 5%;
}

.logo {
    width: 150px;
    height: 150px;
}

.div-index {
    width: 100%;
    height: 95%;
    padding: 10px;
    text-align: center;
}

.formulario {
    width: 100%;
    height: 100%;
    padding: 10px;
    display: grid;
    text-align: center;
    overflow: auto;
}

.input-form {
    width: 100%;
    height: 50px;
    padding: 5px;
    outline: none;
    appearance: none;
    border: none;
    border-bottom: 2px solid #FF0000;
    border-radius: 5px 5px 5px 5px;
    color: #FF0000;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
    /*box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;*/
}

.input-small {
    width: 25%!important;
    height: 50px;
    padding: 5px;
    outline: none;
    appearance: none;
    border: none;
    border-bottom: 2px solid #FF0000;
    border-radius: 5px 5px 5px 5px;
    color: #FF0000;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
}

.button-form {
    width: 20px;
    height: 50px;
    margin-top: 5%;
    appearance: none;
    border: 2px solid #000;
    background: #000;
    color: #fff;
    border-radius: 20px;
    transition: all 1s ease;
}

.button-form:hover {
    background: #FF0000;
    border-color: #fff;
}

.header {
    width: 100%;
    height: 80px;
    color: #fff;
    background-image: linear-gradient(165deg, #000 40%, #FF0000 100%);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

.menu {
    position: relative;
    display: inline-block;
}

.menu-button {
    background-color: transparent;
    color: white;
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.menu-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-content {
    position: absolute;
    right: 0;
    background-color: #ff0000;
    min-width: 180px;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.menu-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.menu-content a:hover {
    background-color: #520000;
}

.menu:hover .menu-content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.container-menu {
    width: 100%;
    height: 100%;
    position: fixed;
}

.row-menu {
    width: 90%;
    height: 85%;
    margin: 5%;
    position: absolute;
    display: grid;
    grid-template-columns: 50% 50%;
    grid-template-rows: 20% 20% 20% 20% 20%;
    overflow: auto;
}

.div-option {
    width: 90%;
    height: 90%;
    padding: 15px;
    margin: 5%;
    border: solid 2px #FF0000;
    border-radius: 20px;
    background: #fff;
    display: grid;
    grid-template-rows: 80% 20%;
    text-align: center;
    font-size: 12px;
    box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.div-option:hover {
    background: #CACACA;
}

.iconos-menu {
    width: 70%;
    height: 90%;
    margin-left: 15%;
}

.label-form {
    width: 100%;
    height: 40px;
    color: #000;
    padding-top: 20px;
    padding-left: 5px;
    font-size: 14px;
    text-align: left;
}

.label-title {
    width: 100%;
    height: 40px;
    color: #000;
    font-size: 25px;
    margin-top: 20px;
}

.button-white {
    width: 50%;
    height: 50px;
    margin-top: 40px;
    margin-left: 0%;
    background: #FF0000;
}

.button-white:hover {
    background: #fff;
    border-color: #FF0000;
    color: #FF0000;
}

.row-ventas {
    width: 100%;
    margin: 20px auto;
    padding: 15px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.row-title {
    font-size: 17px;
    font-weight: bold;
    color: #222;
    margin-bottom: 5px;
}

.cold-ventas {
    display: grid;
    grid-template-columns: 120px repeat(4, 1fr);
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cold-ventas:last-child {
    border-bottom: none;
}

.label-ventas {
    font-size: 15px;
    color: #444;
    font-weight: 500;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.input-ventas {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fdfdfd;
    font-size: 15px;
    transition: all 0.2s ease-in-out;
}

.input-ventas:focus {
    border-color: #ff0000;
    box-shadow: 0 0 3px rgba(255,0,0,0.3);
    outline: none;
}

.col-art {
    display: grid;
    grid-template-columns: 50% 50%;
}

.ui-autocomplete {
    background: #fff;
    color: #fff;
}

.button-form-articulos {
    width: 25%;
    height: 50px;
    margin-top: 10px;
    appearance: none;
    border: none;
    background: #FF0000;
    color: #fff;
    border-radius: 8px;
    transition: all 1s ease;
}

.button-form-articulos:hover {
    background: #eee;
    color: #FF0000;
}

.input-textarea {
    resize: vertical;
}

.div-form-clientes {
    display: flex;
}

.div-form-clientes-row {
    width: 50%;
    display: grid;
}

.container-historial {
    width: 100%;
    height: 150px;
    display: grid;
    margin-bottom: 15px;
    overflow-y: auto;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
    margin-top: 8px;
}

#container-historial {
    width: 100%;
    box-sizing: border-box;
}

.history-list {
    max-height: 280px;
    overflow: auto;
    border: 1px solid #e6e6e6;
    background: #fff;
    padding: 6px;
    border-radius: 4px;
}

.history-item {
    padding: 8px 6px;
    border-bottom: 1px solid #333333;
}

.history-item:last-child {
    border-bottom: none;
}

.history-header {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.history-desc {
    font-size: 14px;
    color: #222;
    white-space: normal;
    text-align: left;
}

.row-historial {
    width: 100%;
    height: 50px;
    font-size: 12px;
    padding: 8px;
    display: grid;
    border: solid 1px #FF0000;
}

.cell-historial {
    display: flex;
    justify-content: space-between;
}

.radio {
    width: 100%;
    height: 60px;
    border: 1px solid #FF0000;
    color: #FF0000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.div-radio {
    width: 150px;
    height: 60px;
    margin-top: 30px;
}

.input-radio {
    appearance: none;
    width: 16px;
    height: 16px;
    background-color: #fff;
    position: relative;
    border: 2px solid #000;
    border-radius: 50%;
    transition: 0.2s all linear;
    top: 2px;
}

.input-radio:checked {
    border: 6px solid #000;
}

.div-abonos {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
}

.div-abonos-centro {
    width: 250px;
    height: 100%;
    display: grid;
}

.div-abonos-row {
    width: 100%;
    display: grid;
}

.input-abonos {
    width: 90%;
    height: 40px;
    padding: 5px;
    outline: none;
    appearance: none;
    border: none;
    border-bottom: 2px solid #FF0000;
    border-radius: 5px 5px 5px 5px;
    color: #FF0000;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
}

.ui-autocomplete.ui-widget {
    font-size: 22px; /* Cambia el tamaño de la fuente */
    color: #FF0000;
}

.graficos {
    display: grid;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
}

.container-contadores {
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: grid;
    padding: 40px;
    justify-content: center;
}

.row-contadores {
    background-color: #00aeff;
    color: white;
    padding: 15px;
    border-radius: 8px 8px 0px 0px;
    text-align: center;
    width: 100%;
    font-size: 18px;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    display: flex;
    justify-content: space-between;
}

.block-contadores {
    width: 250px;
    display: grid;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
    margin: 15px;
}

.label-contadores {
    background-color: aliceblue;
    padding: 5px;
    color: #2d2d2d;
    border-radius: 0px 0px 8px 8px;
    border: solid 1px #00aeff;
}

.img-contadores {
    width: 40px;
    height: 40px;
}

.texto-mayusculas {
    text-transform: uppercase;
}

textarea.input-form {
    min-height: 90px;
    resize: vertical;
    line-height: 1.4;
    padding-top: 8px;
}

select.input-form {
    cursor: pointer;
}

select.input-form:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    background-color: #111;
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 60px;
    color: #fff;
}

.sidebar.open {
    width: 250px;
}

.sidebar a {
    padding: 10px 20px;
    text-decoration: none;
    color: #ddd;
    display: block;
    transition: 0.2s;
}

.sidebar a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar .closebtn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
}

.sidebar .user {
    padding: 0 20px 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
}

.sidebar .has-config {
    padding: 0 20px 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 30px;
}

/* Main content shifts when sidebar open */
.main {
    transition: margin-left 0.3s;
    padding: 20px;
}

.open-menu-btn {
    font-size: 22px;
    cursor: pointer;
    background: none;
    border: none;
    color: #FFF;
    padding: 8px 12px;
    margin-left: 15px;
}

.brand {
    padding: 8px 12px;
    text-decoration: none;
    color: #f5f5f5;
    white-space: nowrap;
}

.sidebar .menu-item {
    display: block;
    padding: 10px 20px;
    color: #ddd;
    text-decoration: none;
    cursor: pointer;
}

.sidebar .menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.sidebar .submenu {
    display: none;
    padding-left: 12px;
    background: rgba(0, 0, 0, 0.02);
}

.sidebar .submenu a {
    display: block;
    padding: 8px 20px;
    color: #ccc;
    text-decoration: none;
}

.sidebar .submenu a:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.sidebar .has-sub.open > .submenu {
    display: block;
}

.submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: none;
    background: none;
    color: inherit;
    padding: 10px 20px;
    text-align: left;
    cursor: pointer;
}

.submenu-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.08);
}

.table-results {
    width: 100%;
    overflow: auto;
    margin-top: 30px;
    border-collapse: collapse;
    table-layout: fixed;
}

.table-results th,
.table-results td {
    padding: 8px;
    border: 1px solid #e6e6e6;
    text-align: left;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.table-results tr.selected {
    background: #f0f8ff;
}

.formulario {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.div-form-clientes {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.div-form-clientes-row {
    flex: 1 1 48%;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}

.label-form,
.label-title {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.input-form {
    width: 100% !important;
    box-sizing: border-box;
    display: block;
}

.formulario > * {
    width: 100%;
    box-sizing: border-box;
}

.resultados-container,
#resultados {
    width: 100%;
    margin-top: 8px;
    box-sizing: border-box;
}

.foto-articulo-container {
    margin-top: 15px;
}

.preview-foto {
    margin-top: 10px;
    width: 100%;
    text-align: center;
}

.preview-foto img {
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 7px rgba(0,0,0,0.15);
}

.tabla-ventas-container {
    width: 100%;
    height: 200px;
    border: 2px solid #3e3e3e;
    overflow-x: auto;
    box-sizing: border-box;
}

.tabla-ventas {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #3e3e3e;
    table-layout: fixed;
}

.fila-vencida {
    background:#ffe5e5;
    color:#900;
    font-weight:bold;
}

.tabla-wrapper {
    margin-top: 25px;
    overflow-x: auto;
}

.tabla-sistema {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
}

.tabla-sistema thead {
    background: #1f2937;
    color: #ffffff;
}

.tabla-sistema th,
.tabla-sistema td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.tabla-sistema tbody tr:hover {
    background-color: #f3f4f6;
    transition: 0.2s ease;
}

.fila-vacia td {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
}

.btn-accion {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

.btn-editar {
    background: #2563eb;
    color: white;
}

.btn-eliminar {
    background: #dc2626;
    color: white;
}

#loader {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(3px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-content {
    background: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.2s ease-in-out;
}

.loader-content p {
    margin-top: 15px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #111827;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.div-row-ventas {
    width: 100;
    display: flex;
    justify-content: center;
}

.div-col-ventas {
    width: 30%;
    margin: 20px;
}

.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: 0.3s ease;
    gap: 15px;
    box-shadow:0 5px 18px rgba(0,0,0,0.05);
    transition:.25s;
    cursor: pointer;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow:0 10px 25px rgba(0,0,0,0.12);
}

.kpi-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.kpi-card p {
    font-size: 22px;
    font-weight: bold;
    color: #1f2937;
}

.kpi-card.warning {
    border-left: 5px solid #e74c3c;
}

.filtros-erp {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.filtros-erp label {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: #444;
}

.acciones-filtros {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paginacion-erp {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.paginacion-erp button {
    padding: 6px 10px;
    border: none;
    background: #e5e7eb;
    cursor: pointer;
    border-radius: 4px;
}

.paginacion-erp button.active {
    background: #2563eb;
    color: white;
}

.badge {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.badge-activa {
    background: #d1fae5;
    color: #065f46;
}

.badge-liquidada {
    background: #dbeafe;
    color: #1e40af;
}

.badge-cancelada {
    background: #fee2e2;
    color: #991b1b;
}

.dashboard{
    padding:20px;
}

.kpi-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-bottom:25px;
}

.kpi-icon{
    font-size:26px;
    background:#eef2ff;
    padding:2px;
    border-radius:10px;
}

.kpi-title{
    font-size:18px;
    color:#6b7280;
}

.counter{
    font-size:22px;
    font-weight:700;
}

.dashboard-charts{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:20px;
    margin-bottom:20px;
}

.card{
    background:white;
    border-radius:14px;
    padding:20px;
    box-shadow:0 5px 18px rgba(0,0,0,0.05);
}

.card.full{
    margin-top:20px;
}

.tabla-dashboard{
    width:100%;
    border-collapse:collapse;
}

.tabla-dashboard th,
.tabla-dashboard td{
    padding:10px;
    border-bottom:1px solid #eee;
    text-align:left;
}

/* Animaciones */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* -----------------------------------
   RESPONSIVO (TABLET)
----------------------------------- */
@media (max-width: 850px) {
    .cold-ventas {
        grid-template-columns: 100px repeat(4, 1fr);
        gap: 6px;
    }

    .label-ventas {
        font-size: 14px;
    }

    .input-ventas {
        font-size: 14px;
        padding: 5px;
    }
}

@media (min-width: 768px) {
    .container-contadores {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

/* Ajustes responsivos */
@media (max-width: 700px) {
    .div-form-clientes-row {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* -----------------------------------
   RESPONSIVO (CELULAR)
----------------------------------- */
@media (max-width: 600px) {

    .sidebar.open {
        width: 200px;
    }

    .table-results th,
    .table-results td {
        white-space: normal;
    }

    /* Contenedor general */
    .row-ventas {
        padding: 12px;
        gap: 10px;
    }

    /* Tabla convertida en bloques */
    .cold-ventas {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
        padding: 10px 0;
        border-bottom: 1px solid #e6e6e6;
    }

    .cold-ventas label:nth-child(1) {
        font-weight: bold;
        grid-column: span 2;
        padding-bottom: 5px;
    }

    /* Inputs */
    .label-ventas {
        font-size: 14px;
    }

    .input-ventas {
        width: 100%;
        font-size: 14px;
    }

    /* Títulos */
    .row-title {
        font-size: 16px;
    }

    .row-title.cold-ventas {
        display: none; /* Ocultamos encabezados grandes en móvil */
    }

    .div-row-ventas {
        display: grid;
    }

    .div-col-ventas {
        width: 100%;
    }
}