:root {
    --ui-green: #14733f;
    --ui-green-deep: #0b4f2a;
    --ui-green-soft: #eef7f0;
    --ui-gold: #ffd24d;
    --ui-cream: #f7f4ea;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f5faf6;
    --ui-line: rgba(13, 63, 28, 0.11);
    --ui-line-strong: rgba(13, 63, 28, 0.18);
    --ui-text: #143321;
    --ui-muted: #5a7260;
    --ui-shadow: 0 20px 50px rgba(12, 44, 22, 0.08);
    --ui-shadow-soft: 0 12px 30px rgba(12, 44, 22, 0.06);
    --ui-radius: 28px;
}

body {
    color: var(--ui-text);
    background:
        radial-gradient(circle at top left, rgba(255, 210, 77, 0.18), transparent 22%),
        radial-gradient(circle at 82% 0%, rgba(20, 115, 63, 0.16), transparent 28%),
        linear-gradient(180deg, #f8fbf7 0%, #e6eee7 100%);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-content {
    width: min(1220px, calc(100% - 1.5rem));
    padding: 1.5rem 0 3rem;
}

.topbar {
    width: min(1280px, calc(100% - 1.5rem));
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    position: relative;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 1rem 1.2rem;
    border-radius: 30px;
    overflow: visible;
}

.topbar__brand,
.topbar__menu {
    min-width: 0;
}

.topbar__menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
}

body.app-guest .topbar__nav,
body.app-guest .topbar__account,
body.app-authenticated .topbar__nav,
body.app-authenticated .topbar__account {
    display: flex;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
}

.portal-brand__logo {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
}

.portal-brand__text {
    min-width: 0;
}

.topbar__nav {
    justify-content: center;
    gap: 0.45rem;
    min-width: 0;
}

.topbar__nav a {
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar__account {
    justify-content: flex-end;
}

.topbar__account form {
    margin: 0;
}

.topbar__user {
    min-width: min(100%, 210px);
    padding: 0.85rem 1rem;
    border-radius: 20px;
}

.topbar__toggle {
    display: none;
    width: 3rem;
    height: 3rem;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.28rem;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.topbar__toggle-line {
    width: 1.15rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.topbar__toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

.topbar.is-open .topbar__toggle {
    background: rgba(255, 255, 255, 0.26);
}

.topbar.is-open .topbar__toggle-line:nth-child(2) {
    transform: translateY(6px) rotate(45deg);
}

.topbar.is-open .topbar__toggle-line:nth-child(3) {
    opacity: 0;
}

.topbar.is-open .topbar__toggle-line:nth-child(4) {
    transform: translateY(-6px) rotate(-45deg);
}

.alert {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    width: min(760px, 100%);
    margin: 0 auto 1rem;
    padding: 1rem 1.1rem;
    border-radius: 24px;
    border: 1px solid transparent;
    box-shadow: 0 18px 38px rgba(17, 44, 28, 0.08);
    overflow: hidden;
}

.alert::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: currentColor;
    opacity: 0.85;
}

.alert__icon {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 18px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.alert__body {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.alert__title {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.alert__message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.alert-success {
    color: #0c5c2e;
    background: linear-gradient(135deg, #f5fcf7 0%, #ecf8ef 100%);
    border-color: rgba(20, 115, 63, 0.14);
}

.alert-success .alert__icon {
    background: linear-gradient(135deg, rgba(20, 115, 63, 0.14), rgba(20, 115, 63, 0.22));
    box-shadow: inset 0 0 0 1px rgba(20, 115, 63, 0.08);
}

.alert-error {
    color: #9f362d;
    background: linear-gradient(135deg, #fff7f5 0%, #fff0ed 100%);
    border-color: rgba(159, 54, 45, 0.14);
}

.alert-error .alert__icon {
    background: linear-gradient(135deg, rgba(159, 54, 45, 0.14), rgba(159, 54, 45, 0.2));
    box-shadow: inset 0 0 0 1px rgba(159, 54, 45, 0.08);
}

.page-content > .section-header {
    padding: clamp(1.25rem, 2vw, 1.8rem);
    border-radius: 32px;
    background: linear-gradient(135deg, #0d6c33, #1f8a4a);
    box-shadow: 0 24px 44px rgba(12, 62, 28, 0.14);
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
}

.page-content > .section-header .eyebrow {
    color: rgba(255, 218, 96, 0.98);
}

.page-content > .section-header h1 {
    margin: 0.25rem 0 0.35rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 0.98;
    color: #ffffff;
}

.page-content > .section-header p {
    margin: 0;
    max-width: 62ch;
    color: rgba(255, 255, 255, 0.84);
}

.grid--cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.card.stat {
    min-height: 9.75rem;
    padding: 1.2rem 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(180deg, #ffffff 0%, #f5faf6 100%);
    border-radius: 24px;
    box-shadow: var(--ui-shadow-soft);
}

.card.stat span {
    color: var(--ui-muted);
    font-weight: 700;
    font-size: 0.92rem;
}

.card.stat strong {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    color: var(--ui-green-deep);
}

.dashboard-metrics {
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.9rem;
}

.dashboard-metrics .stat {
    --stat-accent: #0d6b37;
    --stat-accent-2: #ffd24d;
    --stat-glow: rgba(13, 107, 55, 0.16);
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 0.85rem;
    align-content: space-between;
    min-height: 8.6rem;
    padding: 1.15rem 1.1rem 1.05rem;
    border: 1px solid rgba(13, 63, 28, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f3f8f4 100%);
    box-shadow: 0 14px 28px rgba(17, 44, 28, 0.08);
}

.dashboard-metrics .stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--stat-accent), var(--stat-accent-2));
}

.dashboard-metrics .stat::after {
    content: "";
    position: absolute;
    top: -18px;
    right: -12px;
    width: 88px;
    height: 88px;
    border-radius: 28px;
    background: radial-gradient(circle, var(--stat-glow), transparent 72%);
    pointer-events: none;
}

.dashboard-metrics .stat span {
    margin: 0;
    max-width: 12ch;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}

.dashboard-metrics .stat strong {
    font-size: clamp(2.15rem, 4vw, 3rem);
    line-height: 0.95;
    color: var(--stat-accent);
}

.dashboard-metrics .stat--total {
    --stat-accent: #0f5e31;
    --stat-accent-2: #ffd24d;
    --stat-glow: rgba(255, 210, 77, 0.22);
}

.dashboard-metrics .stat--pending {
    --stat-accent: #ad7b00;
    --stat-accent-2: #ffd24d;
    --stat-glow: rgba(209, 160, 24, 0.22);
}

.dashboard-metrics .stat--paid {
    --stat-accent: #0f7b40;
    --stat-accent-2: #6fd39a;
    --stat-glow: rgba(21, 143, 77, 0.18);
}

.dashboard-metrics .stat--processing {
    --stat-accent: #0a7b73;
    --stat-accent-2: #7ad8d0;
    --stat-glow: rgba(10, 123, 115, 0.16);
}

.dashboard-metrics .stat--released {
    --stat-accent: #0a5630;
    --stat-accent-2: #73cc8f;
    --stat-glow: rgba(10, 86, 48, 0.18);
}

.dashboard-metrics .stat--failed {
    --stat-accent: #b42318;
    --stat-accent-2: #f39a92;
    --stat-glow: rgba(180, 35, 24, 0.16);
}

.dashboard-metrics .stat--refunded {
    --stat-accent: #4e6a83;
    --stat-accent-2: #b5c8dd;
    --stat-glow: rgba(78, 106, 131, 0.18);
}

.panel,
.table-card,
.receipt,
.card {
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.panel,
.table-card,
.receipt {
    padding: clamp(1rem, 2vw, 1.35rem);
}

.table-card > h2,
.panel > h2 {
    margin: 0 0 1rem;
}

.panel .section-header,
.table-card .section-header,
.receipt .section-header {
    margin-bottom: 1rem;
}

.button {
    min-height: 3rem;
    padding: 0.95rem 1.3rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

body.app-authenticated .button--soft {
    background: linear-gradient(180deg, #f4fbf6 0%, #e3f2e7 100%);
    color: #0d5a28;
    border: 1px solid rgba(13, 90, 40, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

body.app-authenticated .page-content > .section-header > .button:not(.button--ghost):not(.button--soft),
body.app-authenticated .page-content > .section-header .inline-actions > .button:not(.button--ghost):not(.button--soft) {
    background: linear-gradient(135deg, #ffd24d, #ffea92);
    color: #124221;
    border: 1px solid rgba(110, 82, 0, 0.18);
    box-shadow: 0 14px 28px rgba(61, 49, 6, 0.18);
}

body.app-authenticated .page-content > .section-header > .button:not(.button--ghost):not(.button--soft):hover,
body.app-authenticated .page-content > .section-header .inline-actions > .button:not(.button--ghost):not(.button--soft):hover {
    filter: none;
    box-shadow: 0 18px 32px rgba(61, 49, 6, 0.22);
}

.field,
.inline-form {
    display: grid;
    gap: 0.45rem;
}

.field input,
.field select,
.field textarea,
.inline-form input,
.inline-form select {
    min-height: 3.1rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
}

.field textarea {
    min-height: 8rem;
    resize: vertical;
}

.compact-note {
    margin: 0.45rem 0 0;
    max-width: 32ch;
    font-size: 0.84rem;
    line-height: 1.45;
}

.quantity-input {
    width: min(100%, 5rem);
    min-height: 2.85rem;
    text-align: center;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-row .button {
    width: 100%;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.inline-actions .button {
    min-width: 8.75rem;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 1rem;
    align-items: start;
}

.key-value {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.95rem;
}

.key-value div,
.note-block {
    padding: 1rem 1.05rem;
    border-radius: 22px;
}

.note-block p:last-child {
    margin-bottom: 0;
}

.certification-panel {
    display: grid;
    gap: 1rem;
}

.certification-entry-list {
    display: grid;
    gap: 1rem;
}

.certification-entry {
    display: grid;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--ui-line);
    border-radius: 22px;
    background: #ffffff;
}

.certification-entry__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button--compact {
    min-height: 2.5rem;
    padding: 0.7rem 1rem;
}

.course-assignment-field {
    gap: 0.6rem;
}

.course-assignment-picker {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--ui-line);
    border-radius: 22px;
    background: var(--ui-surface-soft);
}

.course-assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

.course-checkbox {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--ui-line-strong);
    border-radius: 18px;
    background: #ffffff;
    font-weight: 700;
    color: var(--ui-text);
}

.course-checkbox input {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--ui-green);
}

.field-note {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ui-muted);
}

.certification-help {
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-line);
}

.certification-help strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ui-green-deep);
}

.certification-help p {
    margin: 0;
    color: var(--ui-muted);
}

.request-builder {
    gap: 1rem;
}

.request-builder__catalog {
    display: grid;
    gap: 1rem;
}

.request-builder__catalog-head {
    margin-bottom: 0;
}

.request-builder__document-meta {
    display: grid;
    gap: 0.35rem;
}

.request-builder__document-meta strong {
    color: var(--ui-green-deep);
    font-size: 1rem;
    line-height: 1.25;
}

.request-builder__tag {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    background: rgba(15, 109, 49, 0.12);
    color: #0f6d31;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.request-builder__meta-value {
    font-weight: 700;
    color: var(--ui-green-deep);
}

.request-builder__fee {
    color: #0f6d31;
}

.quantity-stepper {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 4.5rem) 2.75rem;
    width: fit-content;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: linear-gradient(180deg, #f6fbf7 0%, #e5f2e8 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 8px 18px rgba(12, 55, 25, 0.06);
}

.quantity-stepper--wide {
    width: 100%;
    grid-template-columns: 2.9rem minmax(0, 1fr) 2.9rem;
}

.quantity-stepper__button {
    appearance: none;
    border: 0;
    margin: 0;
    min-height: 2.95rem;
    background: transparent;
    color: var(--ui-green-deep);
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.quantity-stepper__button:hover {
    background: rgba(15, 109, 49, 0.08);
}

.quantity-stepper__button:focus-visible {
    outline: 2px solid rgba(18, 66, 33, 0.2);
    outline-offset: -2px;
}

.quantity-stepper input {
    width: 100%;
    min-height: 2.95rem;
    margin: 0;
    padding: 0 0.7rem;
    border: 0;
    border-left: 1px solid rgba(18, 66, 33, 0.1);
    border-right: 1px solid rgba(18, 66, 33, 0.1);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ui-green-deep);
    text-align: center;
    font-weight: 800;
    box-shadow: none;
}

.quantity-stepper input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(15, 109, 49, 0.12);
}

.request-link-chip {
    min-width: 0;
}

.request-mobile-summary {
    display: none;
}

.request-mobile-summary__meta {
    display: grid;
    gap: 0.18rem;
}

.request-mobile-summary__meta span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ui-muted);
}

.request-mobile-summary__meta strong {
    color: var(--ui-green-deep);
    font-size: 1.15rem;
    line-height: 1.1;
}

.request-mobile-summary__actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
}

.request-mobile-summary__submit[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.receipt__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.table-wrap {
    overflow: auto;
    padding: 0.35rem;
    border-radius: 24px;
}

.table-wrap table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
}

.table-wrap th,
.table-wrap td {
    padding: 1rem 0.95rem;
    vertical-align: top;
}

.table-wrap th {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-wrap tbody tr {
    background: rgba(255, 255, 255, 0.96);
}

.table-wrap tbody td {
    border-top: 1px solid rgba(13, 63, 28, 0.08);
}

.clean-hero,
.clean-footer {
    border-radius: 34px;
}

.clean-hero {
    gap: 1.25rem;
    padding: 1.2rem;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.82fr);
}

.clean-hero__content,
.clean-hero__panel {
    min-width: 0;
}

.clean-hero__content h1 {
    font-size: clamp(2.7rem, 6vw, 5rem);
    line-height: 0.92;
}

.clean-hero__content p,
.clean-section__intro p,
.clean-mini-grid article span,
.clean-feature-card p {
    max-width: 62ch;
}

.clean-actions,
.clean-pill-row,
.clean-footer__links {
    flex-wrap: wrap;
}

.clean-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.clean-feature-card,
.clean-mini-card,
.clean-mini-grid article {
    border-radius: 24px;
}

.auth-modal__dialog {
    width: min(580px, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 30px;
}

.auth-modal__guide-grid {
    gap: 0.65rem;
}

.auth-modal__form .clean-button--submit,
.auth-modal__form .clean-field input {
    min-height: 3.25rem;
}

body.app-authenticated .topbar {
    background: linear-gradient(135deg, rgba(13, 108, 51, 0.86), rgba(31, 138, 74, 0.76));
    box-shadow: 0 22px 44px rgba(9, 47, 18, 0.18);
}

body.app-guest .topbar {
    background: linear-gradient(135deg, rgba(11, 95, 42, 0.9), rgba(33, 136, 72, 0.8));
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 22px 44px rgba(9, 47, 18, 0.18);
}

body.app-guest .topbar__toggle {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

body.app-guest .portal-brand,
body.app-guest .topbar__nav a,
body.app-guest .portal-brand__text strong,
body.app-guest .portal-brand__text small {
    color: #ffffff;
}

body.app-guest .topbar__nav a:hover,
body.app-guest .topbar__nav a.active {
    background: rgba(255, 255, 255, 0.14);
}

body.app-guest .button--portal-cta {
    background: rgba(255, 212, 0, 0.96);
    color: #0a4e21;
    box-shadow: none;
}

body.app-authenticated .page-content > .section-header {
    border: 1px solid rgba(9, 71, 29, 0.12);
}

body.app-authenticated .panel,
body.app-authenticated .table-card,
body.app-authenticated .receipt,
body.app-authenticated .card {
    border: 1px solid var(--ui-line);
}

body.app-authenticated .table-wrap {
    background: #f7fbf8;
    border: 1px solid rgba(13, 63, 28, 0.07);
}

body.app-authenticated .table-wrap th {
    background: #edf7ef;
    color: #446252;
}

body.app-authenticated .table-wrap tbody tr:hover {
    background: #fbfdfb;
}

body.role-admin {
    background:
        radial-gradient(circle at top left, rgba(255, 210, 77, 0.16), transparent 22%),
        radial-gradient(circle at 88% 4%, rgba(20, 115, 63, 0.18), transparent 26%),
        linear-gradient(180deg, #f4f8f4 0%, #e2ebe4 100%);
}

body.role-admin .topbar {
    background: linear-gradient(135deg, rgba(9, 58, 30, 0.94), rgba(21, 99, 54, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 50px rgba(9, 39, 18, 0.22);
    width: min(1560px, calc(100% - 1rem));
}

body.role-admin .page-content {
    width: min(1480px, calc(100% - 1rem));
}

body.role-admin .topbar__menu {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

body.role-admin .topbar__nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
}

body.role-admin .topbar__nav::-webkit-scrollbar {
    display: none;
}

body.role-admin .topbar__nav a {
    padding: 0.7rem 0.85rem;
    white-space: nowrap;
    font-size: 0.95rem;
}

body.role-admin .topbar__account {
    gap: 0.65rem;
}

body.role-admin .topbar__user {
    min-width: 0;
    padding: 0.75rem 0.95rem;
    text-align: right;
}

body.role-admin .topbar__user span,
body.role-admin .topbar__user small {
    white-space: nowrap;
}

.admin-hero {
    align-items: flex-start;
}

.admin-hero__aside {
    display: grid;
    gap: 0.65rem;
    min-width: min(100%, 260px);
    padding: 1rem 1.1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
}

.admin-hero__aside p {
    margin: 0;
    color: inherit;
    line-height: 1.5;
}

.admin-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.admin-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 10.5rem;
}

.admin-stat-card::after {
    content: "";
    position: absolute;
    inset: auto -2rem -2rem auto;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 115, 63, 0.12), transparent 68%);
}

.admin-stat-card small {
    color: var(--ui-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.admin-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1rem;
}

.admin-feature-card,
.admin-form-panel,
.admin-note-panel,
.admin-table-card,
.admin-detail-panel,
.admin-user-card,
.admin-record-card {
    border: 1px solid rgba(13, 63, 28, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 246, 0.98));
}

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.admin-action-tile {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    border: 1px solid rgba(13, 63, 28, 0.08);
    background: #ffffff;
    color: var(--ui-text);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-action-tile strong {
    color: var(--ui-green-deep);
}

.admin-action-tile span {
    color: var(--ui-muted);
    line-height: 1.45;
}

.admin-action-tile:hover {
    transform: translateY(-1px);
    box-shadow: var(--ui-shadow-soft);
    border-color: rgba(20, 115, 63, 0.18);
}

.admin-action-tile--static {
    cursor: default;
}

.admin-action-tile--static:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(13, 63, 28, 0.08);
}

.admin-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.9rem;
}

.admin-summary-strip--compact {
    margin-top: 0.9rem;
}

.admin-summary-pill {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(13, 63, 28, 0.08);
    box-shadow: var(--ui-shadow-soft);
}

.admin-summary-pill strong {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--ui-green-deep);
}

.admin-summary-pill span {
    color: var(--ui-muted);
    font-weight: 700;
}

.admin-empty {
    display: grid;
    gap: 0.4rem;
    padding: 1.25rem;
    border-radius: 22px;
    border: 1px dashed rgba(13, 63, 28, 0.16);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ui-muted);
}

.admin-empty strong {
    color: var(--ui-green-deep);
}

.admin-pill-row,
.admin-course-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.admin-pill,
.admin-course-chip,
.admin-log-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-weight: 700;
}

.admin-pill {
    background: rgba(13, 63, 28, 0.08);
    color: var(--ui-green-deep);
}

.admin-pill--strong {
    background: rgba(255, 210, 77, 0.94);
    color: #1d421f;
}

.admin-pill--success {
    background: rgba(20, 115, 63, 0.12);
    color: var(--ui-green-deep);
}

.admin-pill--muted {
    background: rgba(90, 114, 96, 0.14);
    color: #425347;
}

.admin-course-chip {
    background: rgba(20, 115, 63, 0.1);
    color: var(--ui-green-deep);
    border: 1px solid rgba(20, 115, 63, 0.14);
}

.admin-log-tag {
    background: rgba(11, 79, 42, 0.08);
    color: #0b4f2a;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.admin-form-layout {
    align-items: start;
}

.admin-role-stack,
.admin-record-list {
    display: grid;
    gap: 1rem;
}

.admin-role-card,
.admin-role-readout {
    padding: 1rem 1.05rem;
    border-radius: 22px;
    border: 1px solid rgba(13, 63, 28, 0.08);
    background: #ffffff;
}

.admin-role-card strong,
.admin-role-readout strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ui-green-deep);
}

.admin-role-card p,
.admin-role-readout p {
    margin: 0;
    color: var(--ui-muted);
    line-height: 1.5;
}

.admin-user-card,
.admin-record-card {
    display: grid;
    gap: 1rem;
}

.admin-user-card__header,
.admin-record-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-user-card__header h3,
.admin-record-card__header h3 {
    margin: 0.45rem 0 0;
    font-size: 1.2rem;
}

.admin-user-card__header p {
    margin: 0.35rem 0 0;
    color: var(--ui-muted);
}

.admin-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.admin-inline-grid--triple {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 0.8fr) minmax(0, 1fr);
}

.admin-inline-note {
    margin: 0;
}

.admin-money {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ui-green-deep);
}

.button--danger-soft {
    color: #9f362d;
    background: #fff0ed;
    border: 1px solid rgba(159, 54, 45, 0.14);
}

body.role-admin .table-card > .section-header p,
body.role-admin .panel > .section-header p {
    margin: 0;
    color: var(--ui-muted);
}

body.role-admin .table-wrap table {
    min-width: 780px;
}

body.role-admin .table-wrap th {
    background: #eef6ef;
}

body.role-admin .table-wrap tbody tr {
    background: rgba(255, 255, 255, 0.97);
}

body.role-admin .table-wrap tbody tr:hover {
    background: #ffffff;
}

@media (max-width: 1100px) {
    .page-content {
        width: min(1180px, calc(100% - 1.25rem));
    }

    .clean-hero,
    .split {
        grid-template-columns: 1fr;
    }

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

    .admin-metric-grid,
    .admin-panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1380px) {
    body.role-admin .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 0.95rem;
    }

    body.role-admin .topbar__toggle {
        display: inline-flex;
    }

    body.role-admin .topbar__menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.7rem);
        right: 0;
        left: 0;
        z-index: 45;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.9rem;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 24px;
        background: linear-gradient(135deg, rgba(9, 58, 30, 0.98), rgba(21, 99, 54, 0.95));
        box-shadow: 0 22px 44px rgba(9, 39, 18, 0.26);
        backdrop-filter: blur(18px);
    }

    body.role-admin .topbar.is-open .topbar__menu {
        display: grid;
    }

    body.role-admin .topbar__nav,
    body.role-admin .topbar__account {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        overflow: visible;
    }

    body.role-admin .topbar__nav {
        gap: 0.3rem;
    }

    body.role-admin .topbar__nav a,
    body.role-admin .topbar__account .button {
        width: 100%;
        justify-content: flex-start;
    }

    body.role-admin .topbar__user {
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 1100px) {
    body.app-authenticated:not(.role-admin) .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 0.95rem;
        border-radius: 26px;
    }

    body.app-authenticated:not(.role-admin) .topbar__toggle {
        display: inline-flex;
    }

    body.app-authenticated:not(.role-admin) .topbar__menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.7rem);
        right: 0;
        left: 0;
        z-index: 45;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.9rem;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 24px;
        background: linear-gradient(135deg, rgba(8, 84, 38, 0.98), rgba(25, 123, 62, 0.95));
        box-shadow: 0 22px 44px rgba(9, 47, 18, 0.22);
        backdrop-filter: blur(18px);
    }

    body.app-authenticated:not(.role-admin) .topbar.is-open .topbar__menu {
        display: grid;
    }

    body.app-authenticated:not(.role-admin) .topbar__nav,
    body.app-authenticated:not(.role-admin) .topbar__account {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.45rem;
    }

    body.app-authenticated:not(.role-admin) .topbar__nav {
        overflow: visible;
    }

    body.app-authenticated:not(.role-admin) .topbar__nav a,
    body.app-authenticated:not(.role-admin) .topbar__account .button {
        width: 100%;
        justify-content: flex-start;
    }

    body.app-authenticated:not(.role-admin) .topbar__account form {
        width: 100%;
    }

    body.app-authenticated:not(.role-admin) .topbar__user {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 980px) {
    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 0.95rem;
        border-radius: 26px;
    }

    .topbar__toggle {
        display: inline-flex;
    }

    .topbar__menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.7rem);
        right: 0;
        left: 0;
        z-index: 45;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.9rem;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 24px;
        background: linear-gradient(135deg, rgba(11, 95, 42, 0.98), rgba(33, 136, 72, 0.95));
        box-shadow: 0 22px 44px rgba(9, 47, 18, 0.2);
        backdrop-filter: blur(18px);
    }

    .topbar.is-open .topbar__menu {
        display: grid;
    }

    .topbar__nav,
    .topbar__account {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.45rem;
    }

    .topbar__nav {
        gap: 0.35rem;
    }

    .topbar__nav a,
    .topbar__account .button {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar__account form {
        width: 100%;
    }

    .topbar__user {
        width: 100%;
        align-items: flex-start;
        min-width: 0;
        text-align: left;
    }

    .topbar.is-open {
        z-index: 50;
    }

    body:has(.landing-clean) .topbar,
    body:has(.auth-clean) .topbar {
        border-radius: 24px;
    }

    body:has(.landing-clean) .topbar.is-open,
    body:has(.auth-clean) .topbar.is-open {
        border-bottom-left-radius: 24px;
        border-bottom-right-radius: 24px;
    }

    .page-content > .section-header,
    .panel,
    .table-card,
    .receipt {
        padding: 1rem;
    }

    .page-content > .section-header .button,
    .section-header .button {
        width: 100%;
    }

    .clean-hero,
    .clean-footer {
        border-radius: 28px;
    }

    .admin-action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-content {
        width: calc(100% - 1rem);
        padding-top: 1rem;
    }

    .request-builder {
        padding-bottom: 7.5rem;
    }

    .request-builder__catalog-head {
        padding-bottom: 0.2rem;
    }

    .request-builder__catalog-head h2 {
        margin-bottom: 0.2rem;
        font-size: 1.35rem;
    }

    .request-builder__table tbody {
        gap: 0.85rem;
    }

    .request-builder__table tr {
        padding: 1rem;
        border-radius: 24px;
        background:
            radial-gradient(circle at top right, rgba(255, 212, 0, 0.12), transparent 26%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 248, 0.96));
    }

    .request-builder__table td {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0.3rem 0;
    }

    .request-builder__table td::before {
        margin-bottom: 0.08rem;
    }

    .request-builder__document-meta strong {
        font-size: 1.02rem;
    }

    .request-builder__table .compact-note {
        max-width: none;
        margin-top: 0.35rem;
    }

    .quantity-stepper,
    .quantity-stepper--wide {
        width: 100%;
        grid-template-columns: 3rem minmax(0, 1fr) 3rem;
    }

    .quantity-stepper__button,
    .quantity-stepper input {
        min-height: 3rem;
    }

    .request-link-chip {
        width: 100%;
        min-height: 3rem;
        border-radius: 18px;
    }

    .certification-panel > .section-header {
        gap: 0.75rem;
    }

    .certification-panel > .section-header .button {
        width: 100%;
    }

    .certification-entry {
        gap: 0.85rem;
        padding: 0.95rem;
    }

    .request-builder__final-actions > .button:first-child {
        display: none;
    }

    .request-mobile-summary {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        z-index: 55;
        display: grid;
        gap: 0.8rem;
        padding: 0.9rem;
        border-radius: 24px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 249, 243, 0.92));
        border: 1px solid rgba(18, 66, 33, 0.14);
        box-shadow:
            0 18px 34px rgba(9, 47, 18, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.76);
        backdrop-filter: blur(14px) saturate(135%);
        -webkit-backdrop-filter: blur(14px) saturate(135%);
    }

    .request-mobile-summary .button {
        min-height: 3.1rem;
        border-radius: 18px;
    }

    body.app-authenticated .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    body.app-authenticated .dashboard-metrics .stat {
        min-height: 7.15rem;
        padding: 1rem 0.95rem 0.9rem;
        border-radius: 22px;
        gap: 0.7rem;
    }

    body.app-authenticated .dashboard-metrics .stat--total {
        grid-column: 1 / -1;
        min-height: 7.75rem;
    }

    body.app-authenticated .dashboard-metrics .stat span {
        max-width: none;
        font-size: 0.7rem;
    }

    body.app-authenticated .dashboard-metrics .stat strong {
        font-size: clamp(1.95rem, 8vw, 2.65rem);
    }

    body.app-authenticated .page-content > .section-header {
        padding: 0.95rem 1rem 1.05rem;
        border-radius: 24px;
        gap: 0.85rem;
    }

    body.app-authenticated .page-content > .section-header h1 {
        font-size: clamp(1.7rem, 8vw, 2.3rem);
        line-height: 0.95;
        margin-bottom: 0.25rem;
    }

    body.app-authenticated .page-content > .section-header p {
        font-size: 1rem;
        line-height: 1.45;
    }

    body.app-authenticated .page-content > .section-header > .button {
        min-height: 3.15rem;
        border-radius: 18px;
    }

    .grid--cards,
    .key-value,
    .filter-row,
    .clean-feature-grid {
        grid-template-columns: 1fr;
    }

    .course-assignment-grid {
        grid-template-columns: 1fr;
    }

    .admin-inline-grid,
    .admin-inline-grid--triple,
    .admin-metric-grid {
        grid-template-columns: 1fr;
    }

    .inline-actions .button,
    .receipt__header .button {
        width: 100%;
    }

    .table-wrap {
        padding: 0;
        background: transparent;
        border: 0;
        overflow: visible;
    }

    .table-wrap table.responsive-table,
    .responsive-table {
        min-width: 0;
        width: 100%;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .responsive-table tr {
        padding: 0.9rem 0.95rem;
        border: 1px solid var(--ui-line);
        border-radius: 20px;
        background: var(--ui-surface);
        box-shadow: var(--ui-shadow-soft);
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: minmax(84px, 35%) minmax(0, 1fr);
        gap: 0.6rem;
        align-items: start;
        padding: 0.5rem 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .responsive-table td > * {
        min-width: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ui-muted);
    }

    .responsive-table td[colspan] {
        display: block;
        padding: 0;
    }

    .responsive-table td[colspan]::before {
        content: none;
    }

    .responsive-table td.inline-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding-top: 0.9rem;
    }

    .responsive-table td.inline-actions::before {
        content: none;
    }

    .responsive-table td.inline-actions .button {
        width: 100%;
        min-width: 0;
        flex: none;
        min-height: 3rem;
        justify-content: center;
    }

    body.app-authenticated .table-card {
        padding: 0.85rem;
        border-radius: 24px;
    }

    body.app-authenticated .badge {
        width: fit-content;
        max-width: 100%;
        white-space: normal;
    }

    .clean-hero__content h1,
    .page-content > .section-header h1 {
        font-size: clamp(1.9rem, 10vw, 2.75rem);
    }

    .auth-modal {
        padding: 0.5rem;
    }

    .auth-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 1rem);
        padding: 1rem;
        border-radius: 24px;
    }

    .auth-modal__header {
        padding-right: 2.5rem;
    }

    .auth-modal__logo-shell {
        width: 82px;
        height: 82px;
        margin-bottom: 0.85rem;
    }

    .auth-modal__logo {
        width: 56px;
        height: 56px;
    }

    .auth-modal__guide-grid {
        grid-template-columns: 1fr;
    }

    .auth-modal__guide {
        padding: 0.75rem 0.85rem;
    }

    .auth-modal__form .clean-field input,
    .auth-modal__form .clean-button--submit {
        min-height: 3.35rem;
    }

    .admin-hero__aside,
    .admin-user-card__header,
    .admin-record-card__header {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .portal-brand__logo {
        width: 2.65rem;
        height: 2.65rem;
    }

    .portal-brand__text strong {
        font-size: 0.98rem;
    }

    .portal-brand__text small {
        font-size: 0.75rem;
    }

    .button,
    .topbar__nav a {
        min-height: 2.85rem;
    }

    .clean-actions,
    .clean-pill-row {
        display: grid;
    }

    .clean-actions .button,
    .clean-pill-row span {
        width: 100%;
    }
}
