body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #444;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

.fichaje-form {
    background-color: #fdfdfd;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="datetime-local"], input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="time"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

/* Ajuste: quitamos flex-grow del botón genérico */
button {
    padding: 12px;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    background-color: #007bff;
}

button:hover:not(:disabled) {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Contenedor de botones tradicional (para el modal) */
.buttons {
    display: flex;
    gap: 10px;
}
.buttons button {
    flex-grow: 1; /* El crecimiento solo se aplica a botones dentro de .buttons */
}

/* =============================================== */
/* ==== ESTILOS PARA LA NUEVA PARRILLA DE BOTONES ==== */
/* =============================================== */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas de igual tamaño */
    gap: 10px; /* Espacio entre los botones */
}


#clock-in { background-color: #28a745; }
#clock-in:hover:not(:disabled) { background-color: #218838; }
#clock-out { background-color: #dc3545; }
#clock-out:hover:not(:disabled) { background-color: #c82333; }

/* #start-trip { background-color: #17a2b8; } */
#start-trip { background-color: #FD7E14; }
/* #start-trip:hover:not(:disabled) { background-color: #138496; } */
#start-trip:hover:not(:disabled) { background-color: #ED6E04; }
#end-trip { background-color: #6610f2; }
#end-trip:hover:not(:disabled) { background-color: #510bc4; }


.btn-danger { background-color: #6c757d; }
.btn-danger:hover { background-color: #5a6268; }


#message, #login-message, #create-worker-message {
    text-align: center;
    padding: 10px;
    margin: 15px 0;
    border-radius: 4px;
    display: block;
    font-weight: bold;
}
#message:empty, #login-message:empty, #create-worker-message:empty { display: none; }
.success { background-color: #d4edda; color: #155724; }
.error { background-color: #f8d7da; color: #721c24; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
th { background-color: #f2f2f2; }
tr:nth-child(even) { background-color: #f9f9f9; }

.actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.edit-btn { background-color: #007bff; color: white; padding: 5px 10px; border-radius: 4px; border: none; cursor: pointer; }
.edit-btn:hover { background-color: #0056b3; }
.delete-btn { background-color: #dc3545; color: white; padding: 5px 10px; border-radius: 4px; border: none; cursor: pointer; }
.delete-btn:hover { background-color: #c82333; }

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fefefe; margin: 10% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 8px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3); animation: fadeIn 0.3s; }
@keyframes fadeIn { from {opacity: 0; transform: translateY(-20px);} to {opacity: 1; transform: translateY(0);} }
.close-button { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-button:hover, .close-button:focus { color: black; }
#edit-form fieldset { border: 1px solid #ddd; border-radius: 4px; padding: 10px; margin-bottom: 15px; }
#edit-form legend { padding: 0 5px; font-weight: bold; }
#edit-form label { display: block; margin-top: 10px; }
#edit-form input, #edit-form textarea { width: 100%; box-sizing: border-box; padding: 8px; margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; }
#edit-form button { margin-top: 20px; width: 100%; }

.admin-card { background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 20px; margin-top: 25px; }
#logout-button { float: right; padding: 8px 15px; }

.export-form { display: flex; flex-direction: column; gap: 5px; }
.export-form input[type="date"] { padding: 5px; }
.export-form button { font-size: 14px; padding: 8px; }

.token-cell { max-width: 200px; }
.token-cell span { display: block; word-break: break-all; font-size: 0.8em; color: #555; margin-bottom: 5px; }
.copy-token-btn { padding: 3px 8px; font-size: 0.8em; background-color: #6c757d; border-radius: 4px; border: none; color: white; cursor: pointer; }
.copy-token-btn:hover { background-color: #5a6268; }

.admin-row { background-color: #fffbe6 !important; font-weight: 500; }
.role-badge-admin { font-size: 0.8em; font-weight: bold; color: #856404; margin-left: 8px; }

.install-button { display: block; width: 100%; margin: 0 auto 20px auto; background-color: #5a6268; border: 2px solid #343a40; font-weight: bold; }
.install-button:hover:not(:disabled) { background-color: #343a40; }

.login-container { display: flex; justify-content: center; align-items: center; padding: 40px 20px; margin: 20px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
a.google-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 4px; background-color: #fff; color: #444; font-size: 16px; font-weight: 500; text-decoration: none; border: 1px solid #ccc; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: all 0.2s ease-in-out; }
a.google-btn:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.15); border-color: #aaa; }
a.google-btn img { width: 20px; height: 20px; margin-right: 15px; }
.admin-link { text-align: center; margin-top: 20px; font-size: 0.9em; color: #666; }

.header-container { text-align: center; margin-bottom: 20px; }
#welcome-message { margin-bottom: 5px; }
.admin-nav-link { display: inline-block; font-size: 0.9em; color: #007bff; text-decoration: none; margin-bottom: 15px; }
.admin-nav-link:hover { text-decoration: underline; }

.record-type-badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 0.8em; font-weight: bold; color: white; text-transform: capitalize; }
.badge-fichaje { background-color: #6c757d; }
.badge-viaje { background-color: #17a2b8; }

@media screen and (max-width: 1024px) {
    #registros-table thead, #workers-table thead { border: none; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
    #registros-table, #registros-table tbody, #workers-table, #workers-table tbody { display: block; width: 100%; }
    #registros-table tr, #workers-table tr { display: block; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
    #registros-table td, #workers-table td { display: block; text-align: right; font-size: 1em; border-bottom: 1px dotted #ccc; padding-left: 50%; position: relative; }
    #registros-table td:last-child, #workers-table td:last-child { border-bottom: 0; }
    #registros-table td::before, #workers-table td::before { content: attr(data-label); position: absolute; left: 10px; width: calc(50% - 20px); padding-right: 10px; white-space: nowrap; text-align: left; font-weight: bold; }
    #registros-table td:empty, #workers-table td:empty { min-height: 1.2em; }
    #registros-table td:empty::after, #workers-table td:empty::after { content: "\00a0"; }
    .actions-grid { grid-template-columns: 1fr; } /* En móvil, los botones ocupan todo el ancho */
}

.location-type-selector {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
.location-type-selector > label {
    margin-bottom: 8px;
    font-size: 0.9em;
}
.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}
.radio-group input[type="radio"] {
    width: auto; /* Ancho automático para el radio button */
    margin: 0;
}
.radio-group label {
    margin: 0;
    font-weight: normal;
}
