:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #d9e1ec;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #b91c1c;
    --success: #167a3a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.topbar {
    background: #0f172a;
    color: #fff;
    padding: 32px max(24px, calc((100vw - 1180px) / 2));
}

.topbar h1,
h2,
h3,
p {
    margin-top: 0;
}

.eyebrow {
    margin-bottom: 6px;
    color: #8fb4ff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.grid {
    display: grid;
    gap: 20px;
}

.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

button {
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 11px 14px;
}

button:hover {
    background: var(--primary-dark);
}

.secondary {
    background: #e8eefc;
    color: var(--primary-dark);
}

.secondary:hover {
    background: #dbe6ff;
}

.ghost {
    align-self: end;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--danger);
}

.ghost:hover {
    background: #fff4f4;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    font-weight: 700;
}

.success {
    background: #e8f8ee;
    color: var(--success);
}

.error {
    background: #fdecec;
    color: var(--danger);
}

.muted {
    color: var(--muted);
}

.project-list {
    display: grid;
    gap: 10px;
}

.project-list a {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 4px;
    padding: 12px;
    text-decoration: none;
}

.project-list a span {
    color: var(--muted);
    font-size: 14px;
}

.project-list a.active,
.project-list a:hover {
    border-color: var(--primary);
    background: #eef4ff;
}

.section-title {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    gap: 12px;
}

.badge {
    background: #eef4ff;
    border-radius: 999px;
    color: var(--primary-dark);
    font-weight: 700;
    padding: 8px 12px;
    white-space: nowrap;
}

.group-form {
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.student-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(160px, 0.8fr) auto;
    gap: 12px;
    margin-bottom: 12px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.form-message {
    color: var(--danger);
    font-weight: 700;
    min-height: 20px;
}

.field-error {
    background: #fff5f5;
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

.groups {
    display: grid;
    gap: 16px;
}

.group-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.group-card h3 {
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 12px 14px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #aeb2b6;
    padding: 10px 14px;
    text-align: left;
}

tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 820px) {
    .two,
    .content,
    .student-row {
        grid-template-columns: 1fr;
    }

    .layout {
        padding: 16px;
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.topnav a,
.button-link {
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
    padding: 10px 14px;
    text-decoration: none;
}

.topnav a:hover,
.topnav a.active {
    background: #fff;
    color: #0f172a;
}

.button-link {
    background: var(--primary);
    color: #fff;
}

.button-link:hover {
    background: var(--primary-dark);
}

.button-link.full {
    width: 100%;
}

.home-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-card {
    display: grid;
    gap: 12px;
    align-content: start;
}

.section-gap {
    margin-top: 20px;
}

.no-top-gap {
    margin-top: 0;
}

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

@media (max-width: 820px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

.narrow {
    max-width: 520px;
}

.login-card {
    margin-top: 20px;
}

.edit-panel {
    border-color: var(--primary);
    margin-bottom: 20px;
}

.is-hidden {
    display: none !important;
}

.compact-actions {
    justify-content: flex-start;
}

.secondary-link {
    background: #e8eefc;
    color: var(--primary-dark);
}

.secondary-link:hover {
    background: #dbe6ff;
}

.table-action {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.table-action:hover {
    text-decoration: underline;
}
.row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-form {
    display: grid;
    gap: 14px;
}

.group-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.group-header h3 {
    background: transparent;
    border: 0;
    padding: 0;
}

.edit-group-form {
    padding: 14px;
}

.edit-student-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.8fr) auto;
}

.check-label {
    align-self: end;
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.check-label input {
    width: auto;
}

.small-text {
    font-size: 13px;
    margin: 4px 0 0;
}

.consult-box {
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.inline-alert {
    margin: 12px 0 0;
}
.narrow-center {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}
.index-page {
    min-height: 100vh;
    background: linear-gradient(rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.48)), url("index-background.jpg") center / cover fixed no-repeat;
}

.index-page .topbar {
    background: transparent;
}

.index-page .layout {
    padding-top: 56px;
}

.index-page .panel {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}
.inline-edit-form {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.8fr) minmax(90px, 0.5fr) auto;
}

.inline-edit-form input {
    min-width: 0;
}

@media (max-width: 820px) {
    .inline-edit-form {
        grid-template-columns: 1fr;
    }
}
.nav-button {
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 10px 14px;
}

.nav-button:hover {
    background: #fff;
    color: #0f172a;
}

.create-admin-panel {
    display: none;
}

.create-admin-panel.is-open {
    display: grid;
}

.narrow-form {
    max-width: 520px;
}

.master-password-panel {
    display: none;
}

.master-password-panel.is-open {
    display: block;
}
.frontend-actions {
    justify-content: flex-start;
    margin: 18px 0;
}

.toggle-panel {
    display: none;
}

.toggle-panel.is-open {
    display: block;
}

form.toggle-panel.is-open {
    display: grid;
}

.frontend-actions button.active {
    background: var(--primary-dark);
    color: #fff;
}
.danger-badge {
    background: #fdecec;
    color: var(--danger);
}

.backend-create-actions {
    margin-top: 20px;
}
.group-extra-fields {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1.5fr) minmax(140px, 0.5fr);
}

.group-extra-fields .full-row {
    grid-column: 1 / -1;
}

.group-meta {
    align-items: start;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
    padding: 12px 14px;
}

.group-meta p {
    margin: 0;
}

@media (max-width: 820px) {
    .group-extra-fields,
    .group-meta {
        grid-template-columns: 1fr;
    }
}
.group-card--graded {
    background: #f0fdf4;
    border-color: #86efac;
}

.group-card--editing {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.group-card--updated {
    background: #fff7ed;
    border-color: #fb923c;
    box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.18);
}

.group-grade-box {
    background: #fff8db;
    border: 1px solid #f6d365;
    border-radius: 8px;
    margin: 12px 14px;
    padding: 12px;
}

.edit-group-form .group-grade-box {
    margin: 0 0 4px;
}

.project-link-row {
    align-items: center;
    display: flex;
    gap: 10px;
}

.project-link-button {
    width: fit-content;
}

.project-link-button.is-active {
    background: #16a34a;
    color: #fff;
}

.project-link-button.is-active:hover {
    background: #15803d;
}

.project-link-button.is-disabled {
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    opacity: 0.75;
}
.frontend-page {
    min-height: 100vh;
    background: linear-gradient(rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.52)), url("frontend-background.jpg") center / cover fixed no-repeat;
}

.frontend-page .topbar {
    background: transparent;
}

.frontend-page .panel {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}
.group-meta-link {
    align-items: flex-start;
    display: flex;
}

.group-meta-grade {
    display: grid;
    gap: 6px;
}
.search-form-inline {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.search-field {
    min-width: 0;
}

.search-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-bottom: 0;
}

.work-summary {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
}

.summary-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 14px 16px;
}

.summary-item span {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.summary-item strong {
    color: var(--text);
}

.summary-item--graded {
    background: #f0fdf4;
    border-color: #86efac;
}

.summary-item--pending {
    background: #fff7ed;
    border-color: #fdba74;
}

@media (max-width: 820px) {
    .search-form-inline,
    .work-summary {
        grid-template-columns: 1fr;
    }

    .search-actions {
        justify-content: flex-start;
    }
}
.grupos-page {
    background: linear-gradient(rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.52)), url("grupos-background.jpg") center / cover fixed no-repeat;
    min-height: 100vh;
}

.grupos-page .topbar {
    background: rgba(15, 23, 42, 0.88);
}

.grupos-page .panel,
.grupos-page .group-card,
.grupos-page .summary-item {
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.grupos-page .group-card {
    background: rgb(255 255 255 / 86%);
}
.index-page .intro-animate,
.frontend-page .intro-animate {
    animation: riseFadeIn 720ms ease forwards;
    opacity: 0;
    transform: translateY(34px);
}

.index-page .intro-header,
.frontend-page .intro-header {
    animation-delay: 120ms;
}

.index-page .intro-register,
.frontend-page .intro-register {
    animation-delay: 360ms;
}

.index-page .intro-backend,
.frontend-page .intro-backend {
    animation-delay: 600ms;
}

@keyframes riseFadeIn {
    from {
        opacity: 0;
        transform: translateY(34px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .index-page .intro-animate,
.frontend-page .intro-animate {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
.grupos-page .group-card--graded {
    background: rgba(240, 253, 244, 0.96);
    border-color: #22c55e;
}

.grupos-page .group-card--editing {
    background: rgba(239, 246, 255, 0.97);
    border-color: var(--primary);
}

.grupos-page .group-card--updated {
    background: rgba(255, 247, 237, 0.97);
    border-color: #fb923c;
}
.infographic-section {
    margin-top: 28px;
}

.index-page .intro-infographic {
    animation-delay: 840ms;
}
.project-action-list {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qr-content {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: auto minmax(0, 1fr);
}

.qr-image {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
    height: 260px;
    padding: 10px;
    width: 260px;
}

.qr-details {
    display: grid;
    gap: 12px;
}

@media (max-width: 640px) {
    .qr-content {
        grid-template-columns: 1fr;
    }
}
.infographic-carousel {
    position: relative;
}

.carousel-track {
    overflow: hidden;
}

.carousel-slide {
    display: none;
    margin: 0;
}

.carousel-slide.is-active {
    display: block;
}

.carousel-slide img {
    border-radius: 10px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.28);
    display: block;
    height: auto;
    width: 100%;
}

.carousel-control {
    align-items: center;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-size: 34px;
    height: 46px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    z-index: 2;
}

.carousel-control:hover {
    background: rgba(15, 23, 42, 0.92);
}

.carousel-control-prev {
    left: 14px;
}

.carousel-control-next {
    right: 14px;
}

.carousel-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.carousel-dots button {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 999px;
    height: 11px;
    padding: 0;
    width: 34px;
}

.carousel-dots button.is-active {
    background: #fff;
    border-color: #fff;
}

@media (max-width: 820px) {
    .carousel-control {
        font-size: 28px;
        height: 38px;
        width: 38px;
    }
}
.site-footer {
    padding: 22px 24px 30px;
    text-align: center;
}

.site-footer a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

body:not(.index-page):not(.frontend-page):not(.grupos-page) .site-footer a {
    color: var(--primary-dark);
}
.header-brand {
    align-items: center;
    display: flex;
    margin-bottom: 16px;
}

.header-brand-logo {
    display: block;
    height: auto;
    max-width: 220px;
    object-fit: contain;
    width: auto;
}

@media (max-width: 640px) {
    .header-brand-logo {
        height: auto;
        max-width: 180px;
    }
}
.brand-text-link {
    color: inherit;
    text-decoration: none;
}

.brand-text-link:hover {
    text-decoration: underline;
}
.topbar > div {
    align-items: center;
    column-gap: 20px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.topbar .header-brand {
    grid-column: 1;
    grid-row: 1 / span 3;
    margin-bottom: 0;
}

.topbar .eyebrow,
.topbar h1,
.topbar .topnav {
    grid-column: 2;
}

@media (max-width: 640px) {
    .topbar > div {
        grid-template-columns: 1fr;
    }

    .topbar .header-brand,
    .topbar .eyebrow,
    .topbar h1,
    .topbar .topnav {
        grid-column: 1;
    }

    .topbar .header-brand {
        grid-row: auto;
        margin-bottom: 14px;
    }
}