*,
*::before,
*::after {
    box-sizing: border-box;
}

/* MENU - Estilo del contenedor lateral -- background-color: #2c3e50;    */
.sidebar {
    width: 220px;
    height: 100vh;
    background: linear-gradient(to bottom, #1E3A8A, #60A5FA);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    padding: 20px;
}

/* Encabezados del menú (secciones principales) */
.sidebar h2 {
    text-align: left;         /* Alinea el texto a la izquierda */
    padding-left: 10px;       /* Opcional: agrega un poco de espacio a la izquierda */
    margin: 10px 0 5px 0;
    font-size: 16px;
    cursor: pointer;
    color: #ffffff;
}


/* Lista principal de navegación */
.sidebar ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.sidebar .subitem {
    padding-left: 20px;       /* Desplaza los subitems hacia la derecha */
    font-size: 14px;
}

.sidebar .subitem a {
    text-decoration: none;
    color: #dddddd;
    display: block;
    padding: 4px 10px;
}

.sidebar .subitem a:hover {
    background-color: #444;
    color: #fff;
}

/* ------------------------------------------------------------- */

/* ORDENES */

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f6f8;
/*    display: flex;   */
/*    flex-direction: row;  si el sidebar está al lado */
/*    align-items: flex-start;  que los elementos se alineen arriba */
}


form {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 400px;      /* más chico */
    margin: 0 0 20px 0;     /* sin centrado */
    text-align: left;
}



/* main-content y .container como contenido principal */

.main-content {
    margin-left: 240px;
    padding: 20px;
    box-sizing: border-box;
    background-color: #e2e4f6;
    box-shadow: 0 4px 10px rgba(41, 128, 185, 0.1);
    border-radius: 8px;
    min-height: 100vh;

    /* 🔧 Limitar el ancho total del fondo gris */
    max-width: 1300px;         /* O ajustá según tu gusto */
    margin-right: auto;       /* Para que no se desborde */
}

/* NO pongas fondo ni 100% de ancho al contenedor */
.container {
    max-width: 700px;          /* Ancho del formulario */
    margin: 0 auto;            /* Centrado horizontal */
    padding: 20px;
    background-color: transparent;
}


/* Encabezados */ 
h1, h2, h3, h4 { 
    color: #1a3e6f; 
    margin-bottom: 15px; 
    font-weight: 600; 
} 

h3 { 
    text-align: left;         /* Alinea el texto a la izquierda */
    padding-left: 20px;       /* Opcional: agrega un poco de espacio a la izquierda */
    margin: 10px 0 5px 0;
    font-size: 32px;
}

/* Formularios */ 
form label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    color: #34495e; 
} 

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="date"], 
select, 
textarea { 
    width: 100%; 
    padding: 10px 12px; 
    margin-bottom: 18px; 
    border: 1.5px solid #bdc3c7; 
    border-radius: 5px; 
    font-size: 1rem; 
    transition: border-color 0.3s ease; 
} 

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus, 
input[type="date"]:focus, 
select:focus, 
textarea:focus { 
    border-color: #2980b9; 
    outline: none; 
} 

/* Botones */ 
button, input[type="submit"] { 
    background-color: #2980b9; 
    color: white; 
    padding: 10px 18px; 
    border: none; 
    border-radius: 5px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: background-color 0.3s ease; 
} 

button:hover, input[type="submit"]:hover { 
    background-color: #1c5980; 
} 
 
.btn-whatsapp {
    background: transparent !important;
    border: none !important;
    padding: 0;
}


/* Tablas */
table { 
    width: 100%; 
    padding-left: 15px;
    border-collapse: collapse; 
    border: 1px solid #ccc;
    margin-top: 15px;
    margin-bottom: 25px; 
} 

th, td { 
    border: 1px solid #dcdde1; 
    padding: 4px 8px; 
    text-align: left; 
    color: #2c3e50; 
    font-size: 12px;
} 

th { 
    background-color: #2980b9; 
    color: white; 
    font-weight: 480; 
} 


tr:nth-child(even) { 
    background-color: #f2f6fc; 
} 

/* Ajuste de alineación vertical en tabla de órdenes */
td {
    vertical-align: middle; /* Centra verticalmente cualquier contenido */
}

td .estado-select {
    font-size: 12px;
    padding: 1px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    color: #333;
    height: auto;          /* Ajusta la altura al contenido */
    line-height: normal;   /* Centra el texto internamente */
}

/* Centrado vertical real del campo Estado */
td.estado-cell {
    vertical-align: middle;          /* Centrar verticalmente */
    text-align: left;                 /* Ajusta si quieres a la izquierda o al centro */
    height: 100%;                     /* Para asegurar ocupación completa */
}

td.estado-cell select.estado-select {
    display: inline-block;
    vertical-align: middle;           /* Hace que el select se centre respecto a la línea base */
    font-size: 12px;
    padding: 2px 6px;
    line-height: 1.4;                  /* Altura interna equilibrada */
    margin: 0;                         /* Evita que margenes lo suban/bajen */
}

/* ancho maximo campos de tabla ordenes */
.ancho-cell {
    max-width: 140px;
    word-wrap: break-word;
    white-space: normal;
    vertical-align: top; /* para que el texto empiece desde arriba */
}

.ancho-cell100 {
    max-width: 100px;
    word-wrap: break-word;
    white-space: normal;
    vertical-align: top; /* para que el texto empiece desde arriba */
}

.filters {
    margin-bottom: 20px;
    text-align: left;
}
.actions {
    margin-top: 10px;
    text-align: right;
}
.search-results {
    border: 1px solid #ccc;
    background-color: white;
    max-height: 150px;
    overflow-y: auto;
    display: none;
    position: absolute;
    z-index: 1000;
    width: 300px;
}
.search-results div {
    padding: 5px;
    cursor: pointer;
}
.search-results div:hover {
    background-color: #ecf0f1;
}



a { 
    color: #a8becc; 
    text-decoration: none; 
    transition: color 0.3s ease; 
} 

a:hover { 
    color: #1c5980; 
} 


.icono-observacion {
    cursor: pointer;    
    font-size: 18px;
    margin-left: 8px;
    color: #1E3A8A; /* azul oscuro */
}
.icono-observacion:hover {
    color: #2563EB; /* azul más vivo al pasar el mouse */
}


/* Mensajes de error o éxito */ 

.alert { 
    padding: 12px 15px; 
    margin-bottom: 20px; 
    border-radius: 5px; 
} 

.alert-error { 
    background-color: #f8d7da; 
    color: #842029; 
} 

.alert-success { 
    background-color: #d1e7dd; 
    color: #0f5132; 
} 

/* filtros en ordenes */ 

/* Contenedor general de filtros */

.filtros-container {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
}

/* Fila que contiene filtros y botón nueva orden */
.filtros-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

/* Formulario de filtros */
.filtros-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    grid-gap: 12px;
    align-items: end;
    flex: 1; /* ocupa todo el espacio disponible */
    max-width: none;
    width: 100%;
}

/* Cada columna se comporta igual */
.columna-filtro,
.columna-busqueda,
.columna-estado {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Columna de fechas y cliente */
.columna-filtro label,
.columna-busqueda label,
.columna-estado label {
    display: block;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 1px;
    font-weight: bold;
}

/* Hacer la columna de búsqueda más ancha */
.columna-busqueda {
    grid-column: span 1; /* Ocupa 2 espacios del grid */
    min-width: 300px;    /* Asegura un ancho mínimo cómodo */
}

/* Inputs */
.columna-filtro input,
.columna-busqueda input,
.columna-estado select {
    width: 100%;
    min-height: 36px;
    padding: 6px;
    font-size: 12px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Ajustar multiselect */
#estado {
    min-width: 180px;
    min-height: 90px;
}

/* Botones */
.filtros-form button,
.btn-nueva-orden {
    padding: 8px 14px;
    font-size: 14px;
    background: #1E3A8A;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.filtros-form button:hover,
.btn-nueva-orden:hover {
    background: #0d2560;
}




/* Estilos básicos del MODAL */
.modal {
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.modal-lg {
    width:700px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: #000;
}

.acciones-modal {
    text-align: right;
    margin-top: 15px;
}


.btn-small {
            padding: 6px 10px;
            font-size: 13px;
            border-radius: 6px;
            cursor: pointer;
            border: none;
        }
        .btn-edit {
            background: #27ae60;
            color: #fff;
            margin-right: 6px;
        }
        .btn-edit:hover { background: #1e8449; }
        .btn-danger {
            background: #c0392b;
            color: #fff;
        }
        .btn-danger:hover { background: #922b21; }

        /* pequeño ajuste para formulario de creación */
        .form-container { margin-bottom: 18px; }
        .modal-actions { text-align: right; margin-top: 10px; }
        .btn-secondary {
            background: #bdc3c7;
            color: #1c2330;
            border-radius: 6px;
            padding: 8px 12px;
            border: none;
            cursor: pointer;
            margin-left: 8px;
        }

.btn-secundario {
    display: inline-block;
    text-decoration: none;
}

.filtros-grid {
    display: flex;
    gap: 20px;
    background: #f7f7f7;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    max-width: 700px;
    width: 100%;           /* 🔥 clave */
    box-sizing: border-box;
}

.filtro-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    flex: 1; /* 🔥 importante */
}

.filtro-col:last-child {
    flex: 1.5;
}

.acciones-filtros {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.acciones-filtros button {
    height: 34px;
}

.filtro-col select,
.filtro-col input {
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.btn-nuevo {
    font-size: 16px;
    color: rgb(10, 128, 239);
    padding: 12px 20px;
}

.acciones-bar.destacada {
    background: #f7f7f7;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.formulario input[type="number"] {
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
}

.formulario input,
.formulario select,
.formulario textarea {
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    margin-bottom: 12px; /* 🔥 clave */
}


/* Colores de fuente para los estados */
.estado-select.estado-pendiente {
    color: orange;

}
.estado-select.estado-proceso {
    color: blue;

}
.estado-select.estado-finalizada {
    color: green;

}
.estado-select.estado-entregada {
    color: brown;

}
.estado-select.estado-cerrada {
    color: black;

}


.modal-cache {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999999;
  justify-content: center;
  align-items: center;
}

.modal-content-cache {
  background: white;
  padding: 20px 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.modal-buttons {
  margin-top: 15px;
  display: flex;
  justify-content: space-around;
}

.modal-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.modal-buttons button:first-child {
  background: #e74c3c;
  color: white;
}

.modal-buttons button:last-child {
  background: #ddd;
}


/* Dashboard gastos*/
.dashboard-grid {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card h3 {
    margin-bottom: 10px;
}


.badge-verde { background: #2ecc71; color: #fff; padding: 4px 8px; border-radius: 5px; }
.badge-amarillo { background: #f1c40f; color: #000; padding: 4px 8px; border-radius: 5px; }
.badge-azul { background: #3498db; color: #fff; padding: 4px 8px; border-radius: 5px; }


/* Contenedor centrado */
.contenedor-tabla {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 10px;
}

.estado-logistico-wrap{
    display:flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}

.chk-orden{
    margin:0;
}


/* ========================= */
/* 📱 MOBILE RESPONSIVE */
/* ========================= */


@media (max-width: 768px) {
    /* celulares */


    /* 🔹 Sidebar oculto */
    .sidebar {
        position: fixed;
        left: -220px;
        transition: left 0.3s;
        z-index: 1000;
    }

    .sidebar.active {
        left: 0;
    }

    /* 🔹 Main ocupa todo */
    .main-content {
        margin-left: 0;
        padding: 10px;
    }

    /* 🔹 Botón menú */
    .btn-menu {
        display: inline-block;
        background: #1E3A8A;
        color: white;
        padding: 10px;
        border-radius: 5px;
        margin-bottom: 10px;
        cursor: pointer;
    }

    /* 🔹 Filtros en columna */
    .filtros-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* 🔹 TABLA → CARDS */
    table thead {
        display: none;
    }

    table, tbody, tr, td {
        display: block;
        width: 100%;
    }

    tr {
        background: white;
        margin-bottom: 12px;
        padding: 10px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    td {
        border: none;
        padding: 6px 0;
        font-size: 14px;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        color: #555;
        font-size: 12px;
    }

    /* 🔹 Botones más grandes */
    button {
        padding: 10px;
        font-size: 15px;
    }

  
.acciones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

}