/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #e8e8e8;
    color: #333;
    line-height: 1.6;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Login */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 35px 45px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 420px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    width: 75px;
    height: auto;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 23px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.login-header .subtitle {
    font-size: 14px;
    color: #888;
    font-weight: 400;
}

.divider {
    height: 1px;
    background: #e0e0e0;
    margin: 16px 0;
}

/* Formularios */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 400;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #f9f9f9;
}

.form-group input:focus {
    outline: none;
    border-color: #4a7c4e;
    background: white;
}

/* Botones */
.btn {
    padding: 11px 30px;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #4a7c4e;
    color: white;
}

.btn-primary:hover {
    background: #3d6741;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 78, 0.3);
}

.btn-full {
    width: 100%;
}

.login-actions {
    margin-top: 16px;
}

/* Mensaje exclusivo */
.access-note {
    text-align: center;
    margin-top: 14px;
    color: #888;
    font-size: 13px;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    color: #999;
    font-size: 12px;
}

/* Mensajes de alerta */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 15px;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

/* Dashboard */
.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 28px;
    color: #1a1a1a;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.btn-secondary {
    background: #666;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #555;
}

/* Cards */
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* Navegación */
.nav-menu {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-menu .btn {
    padding: 12px 24px;
    font-size: 16px;
}

/* Formularios inline para admin */
.form-inline {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.form-inline select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
    cursor: pointer;
}

.form-inline select:focus {
    outline: none;
    border-color: #4a7c4e;
    background: white;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.tabla-usuarios {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabla-usuarios thead {
    background: #f5f5f5;
}

.tabla-usuarios th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.tabla-usuarios td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.tabla-usuarios tbody tr:hover {
    background: #f9f9f9;
}

.tabla-usuarios .usuario-inactivo {
    opacity: 0.6;
    background: #f9f9f9;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-user {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-inactive {
    background: #ffebee;
    color: #c62828;
}

/* Botones pequeños */
.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-edit {
    background: #2196f3;
    color: white;
    margin-right: 5px;
}

.btn-edit:hover {
    background: #1976d2;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
}

/* Modal */
.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: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.modal-content input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 15px;
    }

    .login-container {
        padding: 30px 25px;
        max-width: 100%;
    }

    .login-header h1 {
        font-size: 20px;
    }

    .login-header .subtitle {
        font-size: 13px;
    }

    .logo {
        width: 65px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-menu .btn {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tabla-usuarios {
        font-size: 12px;
    }

    .tabla-usuarios th,
    .tabla-usuarios td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px;
    }

    .logo {
        width: 60px;
        margin-bottom: 12px;
    }

    .login-header h1 {
        font-size: 18px;
    }

    .login-header .subtitle {
        font-size: 12px;
    }

    .form-group input[type="email"],
    .form-group input[type="password"],
    .form-group input[type="text"] {
        padding: 10px 12px;
        font-size: 16px; /* 16px previene zoom en iOS */
    }

    .btn {
        padding: 10px 25px;
        font-size: 14px;
    }

    .login-footer {
        font-size: 11px;
    }
}
