* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* ==================== LOGIN ==================== */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a5276 0%, #2e86c1 50%, #3498db 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1a5276, #2e86c1);
    color: white;
    padding: 28px 32px;
    text-align: center;
}

.login-header h1 {
    font-size: 1.6em;
    margin-bottom: 4px;
}

.login-header p {
    opacity: 0.85;
    font-size: 0.9em;
}

.login-card form {
    padding: 28px 32px 20px;
}

.login-card .alert {
    margin: 16px 32px 0;
}

.login-footer {
    text-align: center;
    padding: 0 32px 24px;
    color: #999;
    font-size: 0.82em;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

/* ==================== HEADER CON LOGOUT ==================== */

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-email {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85em;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 16px;
    font-size: 0.85em;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==================== GENERAL ==================== */

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

header {
    background: linear-gradient(135deg, #1a5276, #2e86c1);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
    font-size: 1.6em;
    margin-bottom: 4px;
}

header p {
    opacity: 0.85;
    font-size: 0.95em;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card h2 {
    color: #1a5276;
    margin-bottom: 16px;
    font-size: 1.2em;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2e86c1;
    box-shadow: 0 0 0 3px rgba(46,134,193,0.1);
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #2e86c1;
    color: white;
}

.btn-primary:hover {
    background: #1a5276;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #1e8449;
}

.btn-info {
    background: #17a2b8;
    color: white;
    padding: 6px 14px;
    font-size: 0.85em;
}

.btn-info:hover {
    background: #117a8b;
}

.btn-warning {
    background: #e67e22;
    color: white;
    padding: 6px 14px;
    font-size: 0.85em;
}

.btn-warning:hover {
    background: #d35400;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85em;
}

.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.95em;
}

.alert-danger {
    background: #fdf0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #abebc6;
}

.alert-warning {
    background: #fef9e7;
    color: #7d6608;
    border: 1px solid #f9e79f;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

table thead th {
    background: #1a5276;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tbody tr:nth-child(even) {
    background: #fafafa;
}

table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.actions {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge-ok {
    background: #d5f5e3;
    color: #1e8449;
}

.badge-fail {
    background: #fadbd8;
    color: #c0392b;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-card .number {
    font-size: 2em;
    font-weight: 700;
    color: #1a5276;
}

.stat-card .label {
    color: #777;
    font-size: 0.85em;
    margin-top: 4px;
}

.table-responsive {
    overflow-x: auto;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #ddd;
    border-top-color: #2e86c1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    table {
        font-size: 0.8em;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-actions {
        flex-direction: column;
        gap: 8px;
    }
}
