/* ============================
   RESET & BASE
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: montserrat, sans-serif;
}

body {
    display: flex;
    background: #eef0f3;
    min-height: 100vh;
}

/* ============================
   SIDEBAR
============================ */
/* --- Sidebar base (lo que ya tienes) --- */

.sidebar {
    width: 210px;
    background: #151515;
    backdrop-filter: blur(10px);
    height: auto;
    padding: 20px 18px;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar .logo {
    text-align: center;
    margin-bottom: 25px;
}

.sidebar .logo img {
    width: 120px;
    opacity: 0.9;
}

.sidebar h2 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-top: 8px;
}

.sidebar ul {
    list-style: none;
    margin-top: 15px;
}

.sidebar ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #b5b5b5;
    margin-bottom: 5px;
    transition: 0.25s;
    font-size: 12px;
}

.sidebar ul li i {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.sidebar ul li:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.sidebar ul li.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* --- NUEVO: Submenú Leads que se abre hacia abajo --- */

.has-submenu {
    flex-direction: column; /* Permite que el submenú quede abajo */
    align-items: flex-start;
}

.submenu-title {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ocultar submenú por defecto */
.submenu {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 5px;
    padding-left: 28px; /* Sangría para que se vea debajo */
}

/* Mostrar cuando está abierto */
.has-submenu.open .submenu {
    display: flex;
}

/* Estilo de los elementos del submenú */
.submenu li {
    margin-bottom: 4px;
    padding: 7px 8px !important;
    border-radius: 5px;
    font-size: 11px !important;
    color: #cfcfcf;
    display: flex;
    align-items: center;
}

.submenu li:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.submenu li i {
    font-size: 13px;
    width: 16px;
}



/* ============================
   MAIN
============================ */
.main {
    flex: 1;
    padding: 30px 40px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================
   FILTERS
============================ */
.filters {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.filters select,
.filters input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.filters button {
    padding: 7px 16px;
    background: #3b5bdb;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.25s;
    font-size: 13px;
}

.filters button:hover {
    background: #324fc7;
    transform: scale(1.03);
}

/* ============================
   CARDS
============================ */
.cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 35px;
}

.card {
    background: #151515;
    padding: 18px 22px;
    border-radius: 10px;
    border: 1px solid #1f1f1f;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card .icon {
    font-size: 22px;
    color: white;
    opacity: 0.9;
    margin-right: 12px;
}

.card h3 {
    font-size: 12px;
    color: #e6e6e6;
    font-weight: 500;
    text-transform: uppercase;
}

.card p {
    font-size: 22px;
    font-weight: 600;
    color: white;
}

/* ============================
   TOP BUTTONS
============================ */
.add-lead-btn,
#openLeadModal,
#openBookingModal {
    background: #3b5bdb;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: .25s;
}

#openBookingModal {
    background: #0f9d58 !important;
}

.add-lead-btn:hover,
#openLeadModal:hover,
#openBookingModal:hover {
    transform: scale(1.05);
}

/* ============================
   MODALS (OPTIMIZADO)
============================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Contenido del modal */
.modal-content {
    background: #151515;
    padding: 25px;
    width: 900px;
    border-radius: 12px;
    position: relative;
    border: 1px solid #222;
    max-width: 90%;
}

.modal-content h2 {
    color: white;
    text-align: center;
    margin-bottom: 15px;
}

.close {
    position: absolute;
    top: 12px;
    right: 14px;
    cursor: pointer;
    font-size: 20px;
    color: white;
}

/* ============================
   LEAD TYPE BUTTONS
============================ */
.lead-type-container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.lead-btn {
    flex: 1;
    background: #1f1f1f;
    border: 1px solid #444;
    padding: 14px 0;
    border-radius: 10px;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    color: white;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: .2s;
}

.lead-btn:hover {
    background: #2b2b2b;
}

.lead-btn i {
    font-size: 16px;
}

/* ============================
   FORMS
============================ */
form label {
    color: white;
    font-size: 14px;
    display: block;
    margin-top: 12px;
}

form input,
form select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    margin-top: 4px;
    background: #222;
    color: white;
}

.save-btn,
form button {
    margin-top: 18px;
    width: 100%;
    padding: 10px;
    background: #4caf50;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

.save-btn:hover,
form button:hover {
    background: #43a047;
}

/* Ajuste de ancho de contenido dentro del modal */
#leadFormContainer form {
    width: 100%;
    margin: 0 auto; /* centrar */
}

#leadFormContainer form input,
#leadFormContainer form select,
#leadFormContainer form button {
    width: 100%; /* mantiene full dentro del 90% */
}


/* ============================
   RESPONSIVE
============================ */
@media (max-width: 1000px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .sidebar {
        display: none;
    }

    .main {
        padding: 20px;
    }

    .cards {
        grid-template-columns: repeat(1, 1fr);
    }

    .modal-content {
        width: 90% !important;
    }
}

/* Contenedor que limita el alto del tbody */
.table-scroll {
    max-height: 210px; /* aprox. 5 filas */
    overflow-y: auto;
    display: block;
}

.table-scroll table {
    width: 100%;
    border-collapse: collapse;
}

/* Fijar el header */
.minimal-table thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

/* Asegura que el total quede fuera del scroll */
.total-row {
    font-weight: bold;
    background: #f0f0f0;
    text-align: right; /* Para que el total esté alineado a la derecha */
}

/* Estilo general para la tabla */
#vendorBookingsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Encabezado de la tabla */
#vendorBookingsTable thead {
    background-color: #f4f4f4;
    color: #333;
    text-align: left;
}

/* Estilo de las celdas del encabezado */
#vendorBookingsTable th {
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Estilo de las filas */
#vendorBookingsTable tbody tr {
    border-bottom: 1px solid #e1e1e1;
}

/* Estilo de las celdas de la tabla */
#vendorBookingsTable td {
    padding: 10px 15px;
    font-size: 14px;
    color: #555;
}

/* Alternar color de filas */
#vendorBookingsTable tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

/* Hover sobre las filas */
#vendorBookingsTable tbody tr:hover {
    background-color: #f0f0f0;
}

/* Estilo del contenedor de la tabla */
#vendorBookingsTable-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
}

/* Títulos */
h3 {
    text-align: center;
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}





