/* === General & Layout === */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
}

.container {
    width: 90%;
    max-width: 1500px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

h1,
h2,
h3 {
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* === Barra de navegacion === */


.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1500px;
    margin: 0 auto;
    background-color: #383c3f;
    position: relative;
    /* Necesario para el posicionamiento del menú móvil */
    z-index: 1000;
    padding: 10px 2%;
    width: 100%;

}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    /* Esto evita que los botones se salgan de la pantalla */
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 10px;
}

.nav-list li a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    /* Alinea icono arriba y texto abajo como en tu captura */
    align-items: center;
    font-size: 11px;
    /* Un poco más pequeño para prevenir el desborde temprano */
    transition: 0.3s;
    white-space: nowrap;
    /* Evita que el texto de un solo botón se rompa en dos líneas */
}

/* Estilo del botón Hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 10px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
}


/* === Tablas (Listados) === */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: auto;
}


th,
td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: left;
}

td {
    max-width: 200px;
    word-wrap: break-word;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px;
    font-size: 0.85rem;
}

th {
    background-color: #434951;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

/* === Formularios & Fieldsets === */
fieldset {
    border: 1px solid #ccc;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

legend {
    font-weight: bold;
    color: #007bff;
    padding: 0 10px;
}

label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    /* Crucial para que el padding no cambie el ancho */
}

/* === Botones === */
button,
.button,
a.button {
    display: inline-block;
    padding: 10px 15px;
    margin-top: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}

button[type="submit"],
.button.primary {
    background-color: #4343d5;
    /* Verde para acciones principales (Guardar) */
    color: white;
}

button[type="submit"]:hover,
.button.primary:hover {
    background-color: #7f97f7;
}

.button.secondary {
    background-color: #6c757d;
    /* Gris para volver o secundario */
    color: white;
}

.button.secondary:hover {
    background-color: #5a6268;
}

/* === Mensajes (message_display.php) === */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* === Dashboard Cards === */
.dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.dashboard-cards p {
    flex: 1 1 200px;
    /* Permite 3-4 columnas */
    background: #e9ecef;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 1.1em;
    border-left: 5px solid #007bff;
    box-sizing: border-box;
}

/* === Colores de Estado (Listados) === */
.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-inactive {
    color: #dc3545;
}

.status-box strong {
    font-size: 1.1em;
}

/* Para el detalle del pedido */

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: bold;
}

.status-pendiente {
    background: #ffeeba;
    color: #856404;
}

.status-proceso {
    background: #b8daff;
    color: #004085;
}

.status-entregado {
    background: #c3e6cb;
    color: #155724;
}

.status-cancelado {
    background: #f5c6cb;
    color: #721c24;
}

/* Cards para el Dashboard */
.card {
    border: 1px solid #e1e1e1;
    padding: 20px;
    border-radius: 8px;
    background: white;
}

/* --- Formulario de registro --- */
form button:hover {
    background-color: #27ae60 !important;
    /* Cambia a verde al pasar el mouse */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #27ae60 !important;
    box-shadow: 0 0 5px rgba(39, 174, 96, 0.2);
}


/* tabla de gestion de clientes */

.tabla-gestion {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.tabla-gestion th {
    background-color: #333;
    color: white;
    padding: 15px;
    text-align: left;
}

.tabla-gestion td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.badge-rfc {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
}

.btn-edit,
.btn-delete {
    padding: 5px 8px;
    border-radius: 4px;
    margin-right: 5px;
    display: inline-block;
    transition: 0.3s;
}

.btn-edit {
    background: #fff3e0;
}

.btn-delete {
    background: #ffebee;
}

.btn-edit:hover {
    background: #ffe0b2;
}

.btn-delete:hover {
    background: #ffcdd2;
}


.btn-detail {
    background-color: #3228ea;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* ---------  Empleados -------------*/

.badge-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge-status.active {
    background: #c8e6c9;
    color: #256029;
}

.badge-status.inactive {
    background: #ffcdd2;
    color: #c62828;
}

.btn-add {
    background-color: #27ae60;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-add:hover {
    background-color: #219150;
}

.btn-acciones {
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: 0.3s;
}

.btn-delete:hover {
    background-color: #f8d7da;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .nav-list {
        display: none;
        flex-direction: column;
        width: 50%;
        background-color: rgba(56, 60, 63, 0.5);
        position: absolute;
        top: 60px;
        left: 0;

    }

    .nav-list.active {
        display: flex;
    }

    .nav-list li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #444;
    }

    .nav-list li a {
        padding: 15px;
        color: white;
        display: block;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .navbar {
        padding: 5px 2%;
        /* Reducimos márgenes laterales */
    }

    .nav-list li a {
        padding: 8px 10px;
        font-size: 11px;
    }

    .nav-list li img,
    .nav-list li i {
        transform: scale(0.9);
    }
}

@media (max-width: 1000px) {
    .menu-toggle {
        display: flex;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 50%;
        background-color: rgba(56, 60, 63, 0.5);
        /* Tu transparencia solicitada */
        backdrop-filter: blur(10px);
    }

    .nav-list.active {
        display: flex !important;
    }
}

.dropdown-menu {
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.bar {
    transition: all 0.3s ease-in-out;
}

.dropdown-menu-custom li a:hover {
    background-color: #4f5457;
    border-radius: 3px;
    transition: background 0.3s ease;
}

#menu-perfil {
    top: 100%;
    margin-top: 10px;
}

/* --------------- Stock---------- */

.stock-critico {
    background-color: #ffd7d7;
    color: #d9534f;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
}

.stock-bajo {
    background-color: #fff3cd;
    color: #856404;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
}

.stock-ok {
    color: #28a745;
}


/* Estilos para el select de estado en el detalle del pedido */
.status-select {
    width: 100%;
    padding: 8px;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-select:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.spinner {
    font-size: 12px;
    margin-left: 5px;
    vertical-align: middle;
}

th:hover {
    background-color: #f1f1f1;
    color: #3498db;
}

/* Estilo del Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2ecc71;
}

input:checked+.slider:before {
    transform: translateX(20px);
}


/* Estilos para los iconos de acción en el listado de despacho */
.fa-list-check,
.fa-trash-can {
    color: #e74c3c;
    font-size: 1.2em;
    transition: all 0.2s ease;
}

.fa-list-check:hover,
.fa-trash-can:hover {
    opacity: 0.7;
    transform: scale(1.1);
    transition: all 0.2s ease;
}


/* Estilos para el dropdown menu de navegacion */

.dropdown {
    position: relative;
    display: inline-block;
}

/* Estilos de la lista oculta */
.dropdown-menu {
    display: none;
    /* Oculto por defecto */
    position: absolute;
    background-color: #343a40;
    /* Color oscuro como el resto de tu sistema */
    min-width: 260px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 10px 0;
    margin: 0;
    list-style: none;
    border-radius: 4px;
    border: 1px solid #444;
}

/* Estilos de los enlaces dentro del desplegable */
.dropdown-menu li a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background 0.3s;
}

/* Cambio de color al pasar el mouse por las opciones */
.dropdown-menu li a:hover {
    background-color: #495057;
}

/* LA MAGIA: Muestra el menú al pasar el mouse sobre el padre */
.dropdown:hover .dropdown-menu {
    display: block;
}

/* Ajuste para los iconos dentro del menú */
.dropdown-menu img {
    margin-right: 10px;
    vertical-align: middle;
}