*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    min-height: 100vh;
    margin: 0;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

a:active {
    color: #236E9E;
}

a:visited {
    color: #1c5980;
}

.container {
    width: 90%;
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.container-informes {
    max-width: 960px;
    width: 90%;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.card {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border: 1px solid #334155;
    background: #0f172a;
    color: white;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background-color: #2563eb;
}

.status {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
}

table {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    table-layout: fixed;
    width: 100%;
    margin: 10px auto;
    border-collapse: collapse;
}

th {
    padding: 0.6em;
    background-color: #334155;
}
td {
    padding: 0.6em;
}

tbody tr:nth-child(even) {
  background-color: #1e3a52;
  text-align: center;
}

tbody tr:nth-child(odd) {
  background-color: #334155;
  text-align: center;
}

tbody tr:hover {
  background-color: #2d4a6a;
  transition: background-color 0.2s ease;
}

.navbar-custom {
    background-color: #1e293b;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #334155;
    width: 100%;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ecf0f1;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item {
    margin-left: 20px;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-user-badge {
    color: rgb(8, 224, 196);
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

table button {
    width: auto;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    width: 90%;
    max-width: 900px;
    margin-top: 1rem;
}

.home-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.home-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: white;
    text-decoration: none;
}

.home-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.home-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.home-card-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.btn-dashboard {
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 500;
}

.btn-dashboard:hover {
    background-color: #2980b9;
}

.btn-logout {
    color: #e74c3c !important;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background-color: #e74c3c;
    color: white !important;
}

.container-graph {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr; 
    grid-template-rows: auto auto; 
    gap: 20px;
    align-items: start;
    font-family: sans-serif;
}

.texto-explicacion {
    grid-column: 1; 
    grid-row: 1 / 3;
    background-color: #f9f9f9;
    color:  #000000;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    height: 100%; 
    box-sizing: border-box; 
    display: flex;
    flex-direction: column;
    white-space: pre-line;
}

.columna-grafico {
    background-color: white;
    color: #000000;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.footer-graficos {
    grid-column: 2 / 4; 
    grid-row: 2;
    color: #000000;
    background-color: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid #2ecc71;
}

.grafico-card div {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.grafico-card h3 {
    font-size: 1.1em;
    margin-top: 15px;
    border-bottom: 1px solid #ddd;
}

.grafico-card ul {
    list-style: none;
    padding: 0;
}

.grafico-card li {
    font-size: 14px;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .container-graph {
        grid-template-columns: 1fr;
    }

    .texto-explicacion, .columna-grafico, .footer-graficos {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .home-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 95%;
    }
}

/* ===== Login Page ===== */
.login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
}

.login-card {
    background: #1e293b;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 460px;
}

.login-title {
    text-align: center;
    margin: 0 0 1.75rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #f1f5f9;
}

.login-group {
    margin-bottom: 1.1rem;
}

.login-btn-primary {
    width: 100%;
    padding: 0.75rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.25rem;
}

.login-btn-primary:hover {
    background-color: #2563eb;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748b;
    font-size: 0.82rem;
    margin: 1.5rem 0 0.9rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #334155;
}

.login-btn-bio {
    width: 100%;
    padding: 0.72rem;
    background-color: transparent;
    color: #cbd5e1;
    border: 1px solid #475569;
    border-radius: 8px;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.login-btn-bio:hover {
    background-color: #1e293b;
    border-color: #3b82f6;
    color: white;
}

.login-bio-msg {
    margin-top: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.login-error {
    background-color: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.1rem;
    font-size: 0.88rem;
}

/* ===== Responsive mobile ===== */
@media (max-width: 600px) {
    .navbar-custom {
        padding: 0.7rem 1rem;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }

    .nav-item {
        margin-left: 0;
    }

    .container {
        width: 95%;
        padding: 1rem 0;
    }

    .card {
        max-width: 100%;
    }

    .home-grid {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 0.85rem;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.82rem;
    }

    th, td {
        padding: 0.45em 0.5em;
        min-width: 80px;
    }

    .login-wrapper {
        padding: 1rem 0;
    }

    .login-card {
        max-width: 100%;
        border-radius: 10px;
        padding: 1.75rem 1.25rem;
    }

    header h1 {
        font-size: 1.4rem;
    }
}