:root {
    --bg-start: #f3f6fb;
    --bg-end: #dde8f5;
    --card-bg: #ffffff;
    --card-border: #d8e1ee;
    --text-main: #1f2a37;
    --text-soft: #51627a;
    --heading: #1f2a37;
    --brand: #49698d;
    --primary-start: #2f5f95;
    --primary-end: #3f7cbc;
    --success: #147749;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(140deg, var(--bg-start) 0%, var(--bg-end) 100%);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.banner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(26, 43, 68, 0.08);
}

.banner {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.content-wrapper {
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background-color: var(--card-bg);
    box-shadow: 0 20px 45px rgba(26, 43, 68, 0.14);
    padding: 24px;
    margin: 22px auto;
    max-width: 980px;
    width: 95%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--heading);
}

h1 {
    text-align: center;
    font-weight: 700;
    margin-bottom: 20px;
}

label,
.form-group label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

input,
textarea,
select,
.form-control {
    border: 1px solid #c9d4e2;
    border-radius: 10px;
}

.form-control {
    height: 46px;
    padding: 0 14px;
}

textarea.form-control,
textarea {
    min-height: 120px;
    padding: 10px 14px;
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus {
    border-color: #4f7fb4;
    box-shadow: 0 0 0 0.18rem rgba(79, 127, 180, 0.22);
    outline: none;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary,
.btn-success {
    border: none;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    box-shadow: 0 10px 18px rgba(52, 99, 157, 0.26);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    transform: translateY(-1px);
}

.btn-secondary {
    border: 1px solid #c4cfdf;
    background: #eef3f9;
    color: #29405f;
}

.table {
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table,
th,
td {
    border: 1px solid #e3e9f2;
}

th,
td {
    padding: 9px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f0f5fb;
    color: #2a3f5a;
}

.total-evaluacion {
    font-weight: bold;
    color: #2f5f95;
}

.success-message,
.alert-success {
    color: #065f46;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}

.error-message,
.alert-danger {
    color: var(--danger);
    background-color: #fef3f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}

.alert-info {
    border-radius: 10px;
}

.logout-link {
    display: inline-block;
    margin-top: 16px;
    font-weight: 600;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.logout-top-btn {
    white-space: nowrap;
}

.asignatura-section {
    background: #f8fafd;
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    padding: 18px 20px 10px;
}

.asignatura-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-start, #1a3a5c);
    border-left: 4px solid var(--primary-start, #1a3a5c);
    padding-left: 10px;
    margin-bottom: 14px;
}

.ranking-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-start, #1a3a5c);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.card {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 10px 20px rgba(31, 42, 55, 0.08);
}

.card-header {
    background: #f3f7fc;
    border-bottom: 1px solid #dbe5f2;
}

.puntuacion-input {
    width: 78px;
    min-width: 70px;
    max-width: 78px;
    padding: 5px;
    box-sizing: border-box;
    text-align: center;
}

.criterio-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid #edf2f9;
    padding: 10px 0;
}

.criterio-container > div {
    flex: 1;
    min-width: 0;
}

.criterio-container .puntuacion-input {
    flex-shrink: 0;
    align-self: center;
}

.criterio-description {
    font-style: italic;
    color: #5f6f84;
    margin: 0;
}

.footer {
    text-align: center;
    margin: 16px auto 0;
    color: #617288;
    font-size: 0.92rem;
}

header,
footer {
    text-align: center;
    padding: 1em;
}

main {
    padding: 1em;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 14px;
        margin: 12px auto;
        width: 98%;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 6px;
    }

    .dashboard-header .btn,
    .table .btn,
    .list-group .btn,
    td .btn,
    .btn-sm {
        width: auto;
        margin-bottom: 0;
    }

    .logout-link {
        width: 100%;
        margin-bottom: 6px;
    }

    th,
    td {
        font-size: 0.85rem;
        padding: 6px 4px;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .logout-top-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 10px;
        margin: 8px auto;
        border-radius: 10px;
        width: 96%;
    }

    h1 {
        font-size: 1.2rem;
    }

    .criterio-container {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
    }

    .puntuacion-input {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }

    .criterio-container label {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .criterio-description {
        font-size: 0.82rem;
    }
}
