:root {
    --bg: #e8f1ec;
    --bg-strong: #d7e6dd;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-muted: rgba(238, 246, 241, 0.96);
    --line: rgba(19, 51, 40, 0.10);
    --line-strong: rgba(19, 51, 40, 0.18);
    --text: #133328;
    --muted: #62766e;
    --accent: #1d714f;
    --accent-strong: #114834;
    --accent-soft: #d9f0e4;
    --accent-alt: #166b78;
    --accent-alt-soft: #d9edf1;
    --accent-bright: #7dcb93;
    --warning: #b27a23;
    --warning-soft: #f6e8cb;
    --danger: #b84f46;
    --danger-soft: #f8dfdb;
    --info: #176c7a;
    --info-soft: #d8edf1;
    --success: #2f8a61;
    --success-soft: #daf1e4;
    --neutral-soft: #eef4f1;
    --shadow: 0 24px 60px rgba(18, 50, 39, 0.12);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Avenir Next", "Futura", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 18%, rgba(29, 113, 79, 0.18), transparent 26%),
        radial-gradient(circle at 84% 10%, rgba(22, 107, 120, 0.16), transparent 30%),
        radial-gradient(circle at 72% 78%, rgba(125, 203, 147, 0.14), transparent 28%),
        linear-gradient(180deg, #f5fbf7 0%, var(--bg) 44%, var(--bg-strong) 100%);
}

body::selection {
    background: rgba(29, 113, 79, 0.18);
}

.page-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.05) calc(100% - 1px)),
        linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.03) calc(100% - 1px));
    background-size: 100% 28px, 28px 100%;
    opacity: 0.22;
}

ambient,
.ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(18px);
    opacity: 0.6;
    pointer-events: none;
}

.ambient--one {
    top: 82px;
    right: 6vw;
    width: 300px;
    height: 300px;
    background: rgba(21, 108, 94, 0.14);
}

.ambient--two {
    left: 5vw;
    bottom: 48px;
    width: 260px;
    height: 260px;
    background: rgba(125, 203, 147, 0.18);
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 32px));
    margin: 28px auto;
}

.page-shell--auth {
    width: min(1080px, calc(100% - 32px));
    display: grid;
    min-height: calc(100vh - 56px);
    align-content: center;
    gap: 20px;
}

.content-stack {
    display: grid;
    gap: 20px;
}

.content-stack--auth {
    width: 100%;
    max-width: 980px;
    gap: 18px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.card--hero {
    position: relative;
    overflow: hidden;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    background:
        linear-gradient(135deg, rgba(17, 72, 52, 0.95), rgba(29, 113, 79, 0.92) 54%, rgba(22, 107, 120, 0.90) 100%);
    color: #f4fbf6;
}

.card--hero::before {
    content: "";
    position: absolute;
    inset: auto auto -90px -80px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.card--hero::after {
    content: "";
    position: absolute;
    top: -90px;
    right: -30px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(125, 203, 147, 0.34) 0%, rgba(125, 203, 147, 0) 68%);
}

.card--hero--auth {
    display: grid;
    gap: 10px;
    min-height: 220px;
    align-content: end;
}

.masthead__copy,
.auth-banner {
    position: relative;
    z-index: 1;
}

.masthead__copy h1,
.auth-banner h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.2rem, 3vw, 3.2rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.masthead__copy p,
.auth-banner p {
    margin: 0;
    max-width: 720px;
    color: rgba(244, 251, 246, 0.82);
    font-size: 1rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: currentColor;
    opacity: 0.45;
}

.profile-panel {
    position: relative;
    z-index: 1;
    min-width: 320px;
    padding: 16px 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(5, 23, 18, 0.42), rgba(7, 26, 20, 0.58));
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 12px;
}

.profile-panel__header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-panel__meta {
    display: grid;
    gap: 4px;
}

.profile-panel strong {
    font-size: 1.04rem;
    line-height: 1.15;
    color: #ffffff;
}

.profile-panel span {
    color: rgba(248, 252, 249, 0.88);
}

.profile-panel__email {
    font-size: 0.94rem;
    word-break: break-word;
}

.profile-panel__label {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 251, 247, 0.72);
}

.profile-panel__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.profile-panel .badge {
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.profile-panel .badge--neutral {
    background: rgba(255, 255, 255, 0.14);
    color: #f8fcf9;
}

.profile-panel .badge--info {
    background: rgba(125, 203, 147, 0.16);
    color: #f1fff6;
}

.nav-strip {
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    color: var(--muted);
    background: rgba(19, 51, 40, 0.04);
    border: 1px solid transparent;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-pill:hover {
    color: var(--accent-strong);
    border-color: rgba(29, 113, 79, 0.18);
    background: rgba(29, 113, 79, 0.10);
    transform: translateY(-1px);
}

.nav-pill.is-active {
    color: #f5fbf7;
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    border-color: transparent;
}

.panel {
    padding: 24px;
}

.panel--muted {
    background: linear-gradient(180deg, rgba(247, 252, 249, 0.96), rgba(233, 244, 238, 0.92));
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title h2,
.section-title h3,
.section-title p {
    margin: 0;
}

.section-title h2,
.section-title h3 {
    font-size: 1.15rem;
    line-height: 1.2;
}

.section-title p {
    margin-top: 6px;
    color: var(--muted);
}

.summary-grid,
.metrics-grid,
.two-column,
.three-column,
.record-grid,
.auth-grid,
.meta-grid,
.kpi-row,
.data-points,
.detail-list,
.insight-grid {
    display: grid;
    gap: 18px;
}

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

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

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

.three-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-grid,
.kpi-row,
.data-points,
.insight-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.detail-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.stat-card,
.metric-card,
.record-card,
.student-card,
.list-item,
.timeline-item,
.side-note,
.auth-card {
    position: relative;
    overflow: hidden;
}

.stat-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 242, 0.92));
    box-shadow: var(--shadow);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -36px auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(125, 203, 147, 0.20) 0%, rgba(125, 203, 147, 0) 72%);
}

.accent-card {
    background: linear-gradient(135deg, rgba(17, 72, 52, 0.98), rgba(29, 113, 79, 0.92));
    border-color: transparent;
    color: #f4fbf6;
}

.accent-card .stat-card__label,
.accent-card .stat-card__hint,
.accent-card .stat-card__value {
    color: inherit;
}

.stat-card__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.stat-card__value {
    display: block;
    margin-top: 14px;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.stat-card__hint {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.94rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge--neutral {
    background: var(--neutral-soft);
    color: var(--text);
}

.badge--info {
    background: var(--info-soft);
    color: var(--info);
}

.badge--success {
    background: var(--success-soft);
    color: var(--success);
}

.badge--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600;
}

.alert--success {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(47, 138, 97, 0.18);
}

.alert--danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(184, 79, 70, 0.18);
}

.alert--info {
    background: var(--info-soft);
    color: var(--info);
    border-color: rgba(23, 108, 122, 0.18);
}

.alert--warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: rgba(178, 122, 35, 0.18);
}

.dashboard-callout {
    margin-top: 16px;
}

.auth-grid {
    align-items: stretch;
}

.auth-card {
    padding: 26px;
}

.side-note {
    padding: 26px;
    background: linear-gradient(160deg, rgba(17, 72, 52, 0.96), rgba(22, 107, 120, 0.92));
    border-color: transparent;
    color: #f4fbf6;
}

.side-note h2 {
    margin: 14px 0 10px;
    font-size: 1.55rem;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.side-note p,
.side-note li {
    color: rgba(244, 251, 246, 0.84);
}

.side-note ul {
    margin: 18px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.field {
    display: grid;
    gap: 8px;
}

label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(19, 51, 40, 0.12);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #8a9a94;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(29, 113, 79, 0.36);
    box-shadow: 0 0 0 4px rgba(29, 113, 79, 0.12);
    background: #ffffff;
}

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

.form-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

button,
.button {
    appearance: none;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    font: inherit;
    font-weight: 800;
    color: #f5fbf7;
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    box-shadow: 0 14px 24px rgba(17, 72, 52, 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(17, 72, 52, 0.18);
}

button:active,
.button:active {
    transform: translateY(0);
}

.button--secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(19, 51, 40, 0.12);
    box-shadow: none;
}

.button--ghost {
    color: var(--accent-strong);
    background: rgba(29, 113, 79, 0.08);
    border: 1px solid rgba(29, 113, 79, 0.12);
    box-shadow: none;
}

.file-pill-grid {
    display: grid;
    gap: 12px;
}

.file-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px dashed rgba(19, 51, 40, 0.16);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
}

.empty-state {
    padding: 22px;
    border-radius: 16px;
    border: 1px dashed rgba(19, 51, 40, 0.18);
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    text-align: center;
}

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

.list-item,
.metric-card,
.record-card,
.student-card,
.timeline-item {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.list-item:hover,
.metric-card:hover,
.record-card:hover,
.student-card:hover,
.timeline-item:hover,
.polo-map__item:hover {
    transform: translateY(-2px);
    border-color: rgba(29, 113, 79, 0.18);
    box-shadow: 0 18px 30px rgba(17, 72, 52, 0.08);
}

.list-item__head,
.metric-card__head,
.record-card__head,
.student-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.list-item__head h3,
.metric-card__head h3,
.record-card__head h3,
.student-card__head h3 {
    margin: 6px 0 0;
    font-size: 1.05rem;
    line-height: 1.2;
}

.data-point {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(232, 242, 236, 0.72);
    border: 1px solid rgba(19, 51, 40, 0.08);
    display: grid;
    gap: 6px;
}

.data-point strong {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.data-point span {
    font-weight: 700;
    color: var(--text);
}

.polo-map__item {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.polo-map__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.polo-map__item h3 {
    margin: 8px 0 0;
    font-size: 1.04rem;
    line-height: 1.2;
}

.polo-map__meta {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.polo-map__meta strong {
    color: var(--text);
}

.polo-map__tracks {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.polo-map__item--info {
    background: linear-gradient(180deg, rgba(247, 252, 249, 0.96), rgba(223, 239, 243, 0.92));
}

.polo-map__item--warning {
    background: linear-gradient(180deg, rgba(255, 251, 240, 0.96), rgba(247, 235, 205, 0.92));
}

.polo-map__item--danger {
    background: linear-gradient(180deg, rgba(255, 247, 246, 0.96), rgba(248, 224, 221, 0.92));
}

.metric-card__charts {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.metric-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.metric-line strong {
    font-size: 0.95rem;
}

.bar-track {
    position: relative;
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
    background: rgba(19, 51, 40, 0.08);
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
}

.bar-fill--gold {
    background: linear-gradient(90deg, #b27a23, #d3a24f);
}

.bar-fill--danger {
    background: linear-gradient(90deg, #b84f46, #de7a71);
}

.microcopy {
    color: var(--muted);
    font-size: 0.92rem;
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(29, 113, 79, 0.10);
    color: var(--accent-strong);
    font-weight: 700;
}

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

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 6px 0;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.box,
.meta,
.pill {
    border-radius: 14px;
}

@media (max-width: 1100px) {
    .summary-grid,
    .three-column,
    .two-column,
    .auth-grid,
    .metrics-grid,
    .record-grid,
    .polo-map,
    .form-grid--compact {
        grid-template-columns: 1fr 1fr;
    }

    .masthead,
    .card--hero {
        flex-direction: column;
    }

    .profile-panel {
        min-width: 100%;
    }
}

@media (max-width: 760px) {
    .page-shell,
    .page-shell--auth {
        width: min(100% - 20px, 100%);
        margin: 18px auto;
    }

    .summary-grid,
    .three-column,
    .two-column,
    .auth-grid,
    .metrics-grid,
    .record-grid,
    .polo-map,
    .form-grid,
    .form-grid--compact,
    .detail-list,
    .meta-grid,
    .kpi-row,
    .data-points,
    .insight-grid,
    .pagination,
    .page-footer {
        grid-template-columns: 1fr;
        display: grid;
    }

    .section-title,
    .list-item__head,
    .metric-card__head,
    .record-card__head,
    .student-card__head,
    .pagination,
    .page-footer {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .button-row {
        width: 100%;
    }

    button,
    .button,
    .nav-pill {
        width: 100%;
    }

    .nav-strip {
        display: grid;
        grid-template-columns: 1fr;
    }

    .card--hero,
    .auth-card,
    .side-note,
    .panel,
    .stat-card {
        padding: 20px;
    }

    .masthead__copy h1,
    .auth-banner h1 {
        font-size: 2rem;
    }
}

.panel--compact {
    padding: 18px;
}

.stat-card__value--compact {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    word-break: break-word;
}

.list-stack--compact {
    gap: 10px;
}

.list-item--compact {
    padding: 14px 16px;
    border-radius: 16px;
}

.compact-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.compact-kpis strong {
    color: var(--text);
}

.bar-track--compact {
    height: 8px;
    margin-top: 10px;
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(29, 113, 79, 0.24), rgba(22, 107, 120, 0.22));
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar--sm {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 1rem;
}

.user-avatar--xl {
    width: 96px;
    height: 96px;
    border-radius: 26px;
    font-size: 1.8rem;
    color: var(--text);
    border-color: rgba(19, 51, 40, 0.10);
}

.profile-form__intro {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(19, 51, 40, 0.08);
}

.profile-inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(19, 51, 40, 0.08);
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
}

.checkbox-line label {
    margin: 0;
    font-weight: 600;
}

.field-help {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

@media (max-width: 760px) {
    .profile-form__intro,
    .checkbox-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .compact-kpis {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .stat-card__value--compact {
        word-break: break-word;
    }
}
