/* General Body and Container Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* Header Styles */
.header {
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    position: relative; /* Necesario para posicionar el logo absolutamente */
}

.header-content {
    display: flex;
    align-items: center; /* Alineación vertical al centro */
    justify-content: center; /* Centrar contenido horizontalmente */
    width: 100%; /* Asegura que ocupe todo el ancho */
    position: relative; /* Para posicionamiento interno si es necesario */
}

.header h1 {
    color: #0056b3;
    margin: 0;
    font-size: 2.2em;
    flex-grow: 1; /* Permite que el h1 ocupe el espacio disponible */
    text-align: center; /* Centra el texto del h1 dentro de su espacio flex */
}

.header-logo {
    position: absolute; /* Posiciona el logo absolutamente dentro del header-content */
    left: 0;
    top: 50%; /* Centra verticalmente */
    transform: translateY(-50%); /* Ajusta para un centrado vertical preciso */
    height: 93.08px; /* Restaurado al tamaño anterior */
    width: auto; /* Mantiene la relación de aspecto */
    margin-left: 10px; /* Pequeño margen desde el borde izquierdo */
    z-index: 10; /* Asegura que el logo esté por encima de otros elementos si hay superposición */
}


/* Navigation Styles */
.nav {
    display: flex;
    justify-content: center;
    background-color: #007bff;
    padding: 10px 0;
    border-radius: 5px;
    margin-bottom: 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav a:hover,
.nav a.active {
    background-color: #0056b3;
}

/* Form Styles */
form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="number"],
form input[type="date"],
form select {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

form input[type="submit"],
form button[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

form input[type="submit"]:hover,
form button[type="submit"]:hover {
    background-color: #0056b3;
}

/* Messages (Success/Error) */
.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden; /* Ensures border-radius is applied to children */
}

table thead {
    background-color: #007bff;
    color: white;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

table tbody tr:hover {
    background-color: #e9ecef;
}

/* Action Buttons in Tables (NEW ADDITION) */
.action-buttons button {
    padding: 8px 15px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.action-buttons button.edit {
    background-color: #28a745; /* Green */
    color: white;
}

.action-buttons button.edit:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.action-buttons button.delete {
    background-color: #dc3545; /* Red */
    color: white;
}

.action-buttons button.delete:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

/* Style for the Export PDF button */
.btn-export {
    background-color: #007bff; /* Blue color */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    display: block; /* Make it a block element */
    width: fit-content; /* Fit content width */
    margin: 20px auto; /* Center the button */
}

.btn-export:hover {
    background-color: #0056b3; /* Darker blue on hover */
}


/* Hide 'Acciones' column in services.php table */
.data-table th.action-column,
.data-table td.action-buttons {
    display: none;
}

/* Small text/helper text */
small {
    display: block;
    color: #666;
    margin-top: -10px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    .nav {
        flex-direction: column;
    }

    .nav a {
        margin: 5px 0;
    }

    form input[type="text"],
    form input[type="password"],
    form input[type="email"],
    form input[type="number"],
    form input[type="date"],
    form select {
        width: calc(100% - 20px); /* Adjust for smaller screens */
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    table tr {
        border: 1px solid #ccc;
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
    }

    table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    table td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }

    /* Data labels for responsive table */
    table td:nth-of-type(1):before { content: "ID"; }
    table td:nth-of-type(2):before { content: "Cliente"; }
    table td:nth-of-type(3):before { content: "Cédula"; }
    table td:nth-of-type(4):before { content: "Fecha"; }
    table td:nth-of-type(5):before { content: "Ruta"; }
    table td:nth-of-type(6):before { content: "KM"; }
    table td:nth-of-type(7):before { content: "Tipo Vehículo"; } /* Updated label */
    table td:nth-of-type(8):before { content: "Tipo Servicio"; }
    table td:nth-of-type(9):before { content: "Costo Sin Espera"; } /* Adjusted index */
    table td:nth-of-type(10):before { content: "Costo Total"; } /* Adjusted index */
    /* Removed old index 9 for "Tiempo Espera (min)" as it's not in reports.php table */

    .action-buttons {
        text-align: center;
        padding-top: 10px;
    }

    /* Responsive adjustments for logo */
    .header-logo {
        height: 60px; /* MODIFICADO: Reducido para ser menos invasivo en móviles */
        margin-left: 5px;
    }
    .header h1 {
        font-size: 1.8em; /* Smaller title on mobile */
    }
}