html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.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;
}

body {
    font-family: Arial, sans-serif;
    padding: 0;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

.btn-primary {
    color: #fff;
    background-color: #2061ad;
    border-color: #1861ac;
}

/*--------SIDEBAR MENU-------*/
.sidebar {
    display: flex;
    flex-direction: column; /* necesario para que mt-auto funcione */
    min-width: 250px;
    max-width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #0d6efd;
    color: white;
    overflow-y: auto;
    padding-top: 1rem;
}

    .sidebar .brand {
        font-weight: bold;
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
    }

    .sidebar .user-section {
        padding: 0.5rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        margin-bottom: 1rem;
    }

.list-group-item a {
    display: block;
    width: 100%;
}

.list-group-item a.menu-item:hover,
.list-group-item a.menu-toggle:hover {
    background-color: rgba(255,255,255,0.15);
    border-radius: 0.25rem;
    text-decoration: none;
}

.list-group-item .icon {
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.list-group-item .collapse.show + .icon,
.list-group-item .menu-toggle[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

/* Iconos hijos */
.icon-child {
    font-size: 0.7rem;
}

.content {
    margin-left: 250px;
    padding: 1rem;
}
/* MainMenu */

.navbar .nav-link:hover {
    background-color: rgba(255,255,255,.1);
}

.navbar .nav-link.text-danger:hover {
    background-color: rgba(220,53,69,.15);
    color: #ff6b6b;
}

.navbar .dropdown-item:hover {
    background-color: rgba(255, 255, 255, .1);
}

.navbar {
    min-height: 46px;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

nav ul,
nav li {
    list-style: none !important;
}

    nav li::marker {
        content: "";
    }

.dropdown-menu {
    font-size: .85rem;
    border-radius: 6px;
    padding: .35rem 0;
    background-color: #0d6efd;
}


    .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-left: .1rem;
    }


.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu .dropdown-menu {
        top: 0;
        left: 100%; 
        margin-top: -1px;
    }

   
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }

 
    .dropdown-submenu > .dropdown-toggle:after {
        display: inline-block;
        margin-left: 0.255em;
        vertical-align: 0.255em;
        content: "";
        border-top: 0.3em solid transparent;
        border-right: 0;
        border-bottom: 0.3em solid transparent;
        border-left: 0.3em solid;
    }

/*--------Arrancan estilos a parte-------*/

h4 {
    text-align: center;
    margin: 0.5rem 0;
    font-size: 1.6rem;
    color: #333;
}

.card {
    width: 97%;
    max-width: 1350px;
    margin: 15px auto;
    background-color: white;
    border-radius: 7px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.card-body {
    padding: 1.5rem;
    padding-top: 0.5rem;
}




/*-------El button panel-------*/
.button-panel {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 12px;
    margin: 15px auto;
    width: 97%;
    max-width: 1350px;
    height: 3.2rem;
    border-radius: 7px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    background-color: #fafafa;
}

.button-panel .actualizar,
.button-panel .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    width: 110px;
    height: 32px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 5px;
    border: 1.5px solid transparent;
    color: white;
    background-color: #006cfd;
    transition: all 0.3s ease;
    cursor: pointer;
}



.button-panel .actualizar:hover,
.button-panel .btn:hover {
    background-color: #0056b3;
}



/*---------Contenedor KPI--------*/
.kpi-container {
    width: 97%;
    max-width: 1350px;
    margin: 1.2rem auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
}



/*-------La parte de los KPI-------*/
.kpi-card {
    padding: 0.9rem;
    border-radius: 7px;
    border-left: 3px solid;
    background-color: transparent;
    box-shadow: 0 0.1rem 1.5rem 0 rgba(58, 59, 69, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    box-shadow: 0 0.4rem 1.3rem 0 rgba(58, 59, 69, 0.2);
    transform: translateY(-2px);
}



/*--------Contenido KPI---------*/
.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-title {
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #5a5c69;
}

.kpi-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2e2e2e;
}





/*-------Lists container------*/
.lists-container {
    width: 97%;
    max-width: 1350px;
    margin: 15px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.list-card {
    background-color: white;
    border-radius: 7px;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    min-height: 380px;
    flex: 1 1 auto;
}

.list-card.summary-list {
    flex: 0 0 30%;
    max-width: 30%;
}

.card-header {
    padding: 12px 18px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    margin: 0;
    color: #444;
    font-size: 1rem;
}

.list-body {
    padding: 15px;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}



/*-------Los filtros------*/
.filter-group {
    display: flex;
    gap: 8px;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
    font-size: 0.85rem;
    transition: border-color 0.3s;
}

.filter-input:focus {
    border-color: #006cfd;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 108, 253, 0.2);
}




/*----------Tablas-------------*/
.table-responsive {
    overflow-x: auto;
    max-height: 380px;
    overflow-y: auto;
}

.clientes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.clientes-table th {
    background-color: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #444;
    position: sticky;
    top: 0;
    z-index: 10;
}

.clientes-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

/*---------Seleccionar tablas-----------*/
.clientes-table tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clientes-table tr:hover {
    background-color: #f0f7ff !important;
}

.clientes-table tr.selected {
    background-color: #e1f0ff !important;
    position: relative;
}

.clientes-table tr.selected::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #006cfd;
}

.clientes-table tr:last-child td {
    border-bottom: none;
}

.client-list-container {
    scroll-behavior: smooth;
    transition: scroll-behavior 0.3s ease;
}

.selected-client {
    background-color: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}






/*-------Tabla detalle-----*/
.list-card.detail-list {
    flex: 0 0 68%;
    max-width: 68%;
}

.detalle-summary {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid #EDF2F7;
    background: white;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    color: #4A5568;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row.total {
    font-weight: 600;
    color: #1A202C;
    font-size: 14px;
    margin-top: 8px;
}

.text-discount {
    color: #E53E3E;
}




/*-------Tabla detalle-----*/
.pedidos-table {
    border-collapse: collapse;
    width: 100%;
    font-weight: normal;
}

.pedidos-table th {
    background-color: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #444;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pedidos-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: normal;
}

.pedidos-table tr.pedido-header {
    background-color: #e9ecef;
    border-top: 2px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.pedidos-table tr.pedido-header td:last-child {
    color: #2e2e2e;
}



.pedidos-table .hr-row {
    height: 1px;
    padding: 0;
}

.pedidos-table .hr-row td {
    padding: 0;
    border: none;
}

.pedidos-table hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 5px 0;
    width: 100%;
}

.pedidos-table th,
.pedidos-table td,
.pedidos-table tr.pedido-header td {
    font-weight: normal;
}

.text-muted {
    color: #6c757d;
}

.badge {
    font-size: 0.9em;
    margin-left: 10px;
}

.fa-mouse-pointer {
    margin-right: 5px;
}



/*-------Responsive---------*/
@media (max-width: 992px) {
    .list-card.summary-list,
    .list-card.detail-list {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .kpi-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kpi-container {
        grid-template-columns: 1fr;
    }

    .button-panel {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
    }

        .button-panel .actualizar,
        .button-panel .btn {
            margin: 4px;
            width: 100%;
        }
}


