/* =========================================================
   ANGUTSA CHAMPIONSHIP — SHARED DESIGN SYSTEM (base.css)
   ---------------------------------------------------------
   Loaded by every page created from Phase 1 onwards
   (public, dashboard, admin, finance and officials).

   The homepage keeps its original css/index.css untouched, so
   nothing in this file can affect index.html. All tokens and
   primitives below intentionally reuse the exact homepage
   values so the whole site shares one visual identity.
   ========================================================= */

:root {
    /* Brand */
    --navy: #10152E;
    --navy-light: #191F40;
    --purple: #5B4BBD;
    --purple-dark: #443591;
    --gold: #D7B56D;
    --gold-light: #E8D19C;
    --white: #FFFFFF;

    /* Surfaces */
    --background: #F6F7FB;
    --surface: #FFFFFF;
    --surface-muted: #F8F8FC;

    /* Text */
    --text: #20243A;
    --muted: #777D91;
    --muted-strong: #52586C;

    /* Lines */
    --border: #E7E9F0;
    --border-strong: #D9DCE7;

    /* Status palette */
    --green: #16865B;
    --green-soft: #E4F6EC;
    --green-text: #13764E;
    --amber: #A9741C;
    --amber-soft: #F9F0D9;
    --amber-text: #775A1C;
    --red: #B3261E;
    --red-soft: #FCEBEA;
    --red-text: #9A241D;
    --purple-soft: #F1EFFB;
    --gold-soft: #FBF5E8;
    --neutral-soft: #EEF0F6;
    --neutral-text: #5C6379;

    /* Radius, shadow, motion */
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 22px;
    --shadow: 0 18px 55px rgba(16, 21, 46, 0.08);
    --shadow-soft: 0 5px 25px rgba(16, 21, 46, 0.03);
    --shadow-pop: 0 24px 60px rgba(16, 21, 46, 0.16);
    --ring: 0 0 0 3px rgba(91, 75, 189, 0.3);

    /* Layout */
    --container: 1200px;
    --header-h: 88px;
    --sidebar-w: 264px;
    --sidebar-w-collapsed: 78px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: "DM Sans", sans-serif;
    color: var(--text);
    background: var(--background);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body.menu-open,
body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
}

img {
    display: block;
    max-width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 26px 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Manrope", sans-serif;
    line-height: 1.2;
    letter-spacing: -0.045em;
    color: var(--navy);
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 800; }
h4 { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
h5 { font-size: 0.9rem; font-weight: 800; letter-spacing: 0; }

h2 span,
h1 span.accent {
    color: var(--purple);
}

p {
    font-size: 13px;
    line-height: 1.85;
    color: var(--muted-strong);
}

strong { color: var(--navy); }
small { font-size: 11px; }

.container {
    width: min(var(--container), calc(100% - 48px));
    margin-inline: auto;
}

.container-narrow {
    width: min(880px, calc(100% - 48px));
    margin-inline: auto;
}

/* ----------------------------
   Shared type / layout helpers
   ---------------------------- */

.section {
    padding: 84px 0;
}

.section-tight {
    padding: 52px 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 34px;
}

.section-heading h2 {
    margin-top: 14px;
}

.section-heading p {
    margin-top: 11px;
    font-size: 13px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--purple);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.eyebrow-line {
    display: inline-block;
    width: 28px;
    height: 2px;
    background: var(--gold);
    flex-shrink: 0;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gold);
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
}

.text-link span {
    color: var(--purple);
    font-size: 17px;
    transition: transform 0.2s ease;
}

.text-link:hover span {
    transform: translateX(4px);
}

.demo-note,
.form-note {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.75;
}

.notice-bar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--muted-strong);
    font-size: 11px;
    line-height: 1.7;
}

/* The shared inline icons carry no intrinsic size, so any flex container
   must size them. Without this the notice icon stretches into a large
   circle that dominates the bar. */
.notice-bar .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--purple);
}

.notice-bar strong {
    color: var(--navy);
    font-weight: 800;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 18px;
    z-index: 2000;
    padding: 12px 18px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--navy);
    color: var(--white);
    font-size: 12px;
    font-weight: 800;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

/* ----------------------------
   Page hero (public sub-pages)
   ---------------------------- */

.page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--white);
    background-color: var(--navy);
    background-image: url("../images/hero.png");
    background-position: center 42%;
    background-size: cover;
}

.page-hero::before {
    position: absolute;
    content: "";
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg,
            rgba(10, 14, 35, 0.96) 0%,
            rgba(16, 21, 46, 0.9) 46%,
            rgba(16, 21, 46, 0.62) 100%),
        linear-gradient(0deg, rgba(10, 14, 35, 0.7), transparent 62%);
}

.page-hero::after {
    position: absolute;
    content: "";
    inset: 0;
    z-index: -1;
    opacity: 0.12;
    background-image: radial-gradient(var(--gold) 0.7px, transparent 0.7px);
    background-size: 24px 24px;
    mask-image: linear-gradient(90deg, black, transparent 78%);
}

.page-hero-inner {
    padding: 66px 0 60px;
    max-width: 760px;
}

.page-hero h1 {
    margin-top: 18px;
    color: var(--white);
    font-size: clamp(2rem, 4.4vw, 3.2rem);
}

.page-hero h1 span {
    color: var(--gold);
}

.page-hero p {
    max-width: 620px;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13.5px;
    line-height: 1.9;
}

.page-hero .eyebrow {
    color: var(--gold-light);
}

.page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

/* Compact variant used by dashboards and list pages */
.page-hero.is-compact .page-hero-inner {
    padding: 44px 0 40px;
}

.page-hero.is-compact h1 {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

/* Breadcrumbs */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.breadcrumbs a:hover {
    color: var(--gold);
}

.breadcrumbs-sep {
    color: rgba(255, 255, 255, 0.35);
}

.breadcrumbs [aria-current="page"] {
    color: var(--gold-light);
}

/* Light breadcrumbs for white surfaces */
.breadcrumbs.is-light {
    color: var(--muted);
}

.breadcrumbs.is-light [aria-current="page"] {
    color: var(--navy);
}

.breadcrumbs.is-light .breadcrumbs-sep {
    color: var(--border-strong);
}

/* Content band on white, used between light sections */
.band {
    padding: 56px 0;
}

.band-white {
    background: var(--surface);
    border-block: 1px solid var(--border);
}

/* ----------------------------
   Public footer
   ---------------------------- */

.site-footer {
    margin-top: 0;
    color: rgba(255, 255, 255, 0.75);
    background: #0B1025;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1fr;
    gap: 45px;
    padding-top: 62px;
    padding-bottom: 52px;
}

.site-footer .brand-logo {
    height: 72px;
}

.site-footer .brand-logo,
.site-footer img {
    border-radius: 10px;
}

.footer-brand > p {
    max-width: 280px;
    margin-top: 18px;
    color: #A6AABE;
    font-size: 11px;
    line-height: 1.9;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.footer-column h4 {
    margin-bottom: 6px;
    color: var(--white);
    font-size: 12px;
    letter-spacing: 0;
}

.footer-column a {
    color: #A6AABE;
    font-size: 10.5px;
    transition: color 0.2s ease;
}

.footer-column a:hover,
.powered-by a:hover {
    color: var(--gold);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-bottom-inner p {
    color: #8E94AA;
    font-size: 10px;
}

.powered-by a {
    color: var(--gold);
    font-weight: 800;
}

/* Legal links in the footer bottom bar */

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-legal a {
    color: #8E94AA;
    font-size: 10px;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: var(--gold);
}

/* Dashboard footer (compact, used inside app shells) */

.app-footer {
    padding: 18px 0 26px;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

.app-footer p {
    color: var(--muted);
    font-size: 10.5px;
}

/* ----------------------------
   Public header + navigation
   ---------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(231, 233, 240, 0.85);
    backdrop-filter: blur(18px);
}

.nav-container {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.brand-logo {
    display: block;
    height: 58px;
    width: auto;
    border-radius: 10px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 19px;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-block: 10px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--purple);
}

.nav-link.active::after {
    position: absolute;
    content: "";
    height: 2px;
    background: var(--gold);
    bottom: 0;
    left: 0;
    right: 0;
}

.nav-login {
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.nav-login:hover {
    color: var(--purple);
}

.nav-cta {
    padding: 13px 15px;
    white-space: nowrap;
}

.nav-caret {
    font-size: 9px;
    line-height: 1;
    transition: transform 0.2s ease;
}

/* Dropdown groups */

.nav-group {
    position: relative;
}

.nav-dropdown {
    position: absolute;
    z-index: 1001;
    top: calc(100% + 8px);
    left: -14px;
    min-width: 190px;
    display: grid;
    gap: 2px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 20px 45px rgba(16, 21, 46, 0.13);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.nav-group.is-open .nav-dropdown,
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-group.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown-link {
    display: block;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--muted-strong);
    font-size: 11.5px;
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-dropdown-link:hover,
.nav-dropdown-link.active {
    color: var(--purple);
    background: var(--purple-soft);
}

.menu-toggle {
    display: none;
}

/* ----------------------------
   Buttons
   ---------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 13px 19px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease,
                border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled,
.btn[disabled],
.btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button.is-loading {
    position: relative;
    cursor: wait !important;
    opacity: 0.82;
}

button.is-loading:disabled {
    opacity: 0.82;
}

button.is-loading::after {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    content: "";
    vertical-align: middle;
    animation: action-button-spin 0.7s linear infinite;
}

input.is-loading {
    cursor: wait;
}

@keyframes action-button-spin {
    to { transform: rotate(360deg); }
}

.btn-gold {
    color: var(--navy);
    background: var(--gold);
    box-shadow: 0 8px 24px rgba(215, 181, 109, 0.16);
}

.btn-gold:hover {
    background: var(--gold-light);
    box-shadow: 0 12px 28px rgba(215, 181, 109, 0.25);
}

.btn-primary {
    color: var(--white);
    background: var(--purple);
    box-shadow: 0 8px 24px rgba(91, 75, 189, 0.18);
}

.btn-primary:hover {
    background: var(--purple-dark);
    box-shadow: 0 12px 28px rgba(91, 75, 189, 0.26);
}

.btn-dark {
    color: var(--white);
    background: var(--navy);
}

.btn-dark:hover {
    background: var(--navy-light);
}

.btn-dark-outline {
    color: var(--navy);
    border-color: var(--border-strong);
    background: transparent;
}

.btn-dark-outline:hover {
    border-color: var(--purple);
    background: var(--white);
}

.btn-outline {
    color: var(--purple);
    border-color: #D9D2F5;
    background: var(--white);
}

.btn-outline:hover {
    border-color: var(--purple);
    background: var(--purple-soft);
}

.btn-outline-light {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.04);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    color: var(--white);
    background: var(--red);
}

.btn-danger:hover {
    background: var(--red-text);
}

.btn-danger-outline {
    color: var(--red-text);
    border-color: #F0C9C5;
    background: var(--white);
}

.btn-danger-outline:hover {
    border-color: var(--red);
    background: var(--red-soft);
}

.btn-success {
    color: var(--white);
    background: var(--green);
}

.btn-success:hover {
    background: var(--green-text);
}

.btn-ghost {
    color: var(--muted-strong);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--purple);
    background: var(--purple-soft);
}

.btn-large {
    min-height: 52px;
    padding: 15px 23px;
}

.btn-sm {
    gap: 8px;
    padding: 9px 13px;
    font-size: 10.5px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-arrow {
    font-size: 15px;
    font-weight: 400;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-row-end {
    justify-content: flex-end;
}

.btn-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--muted-strong);
    background: var(--white);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-icon:hover {
    color: var(--purple);
    border-color: #D9D2F5;
    background: var(--purple-soft);
}

.btn-icon.is-danger:hover {
    color: var(--red-text);
    border-color: #F0C9C5;
    background: var(--red-soft);
}

.link-btn {
    color: var(--purple);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--purple-dark);
    text-decoration: underline;
}

/* ----------------------------
   Badges, statuses and chips
   ---------------------------- */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-open,
.status-approved,
.status-successful,
.status-completed,
.status-published {
    color: var(--green-text);
    background: var(--green-soft);
}

.status-open::before,
.status-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-open::before {
    background: #1A9A64;
}

.status-upcoming,
.status-pending,
.status-draft,
.status-postponed {
    color: var(--amber-text);
    background: var(--amber-soft);
}

.status-ongoing,
.status-live {
    color: var(--purple-dark);
    background: var(--purple-soft);
}

.status-live::before {
    background: var(--purple);
    animation: badge-pulse 1.6s ease-in-out infinite;
}

.status-closed,
.status-rejected,
.status-cancelled,
.status-failed,
.status-abandoned {
    color: var(--red-text);
    background: var(--red-soft);
}

.status-neutral,
.status-archived {
    color: var(--neutral-text);
    background: var(--neutral-soft);
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.8); }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted-strong);
    background: var(--surface-muted);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-gold {
    color: var(--amber-text);
    border-color: #EFE0BD;
    background: var(--gold-soft);
}

.badge-purple {
    color: var(--purple-dark);
    border-color: #DFDAF7;
    background: var(--purple-soft);
}

.badge-green {
    color: var(--green-text);
    border-color: #C7E8D8;
    background: var(--green-soft);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted-strong);
    background: var(--white);
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.chip:hover {
    border-color: #D9D2F5;
    color: var(--purple);
}

.chip[aria-pressed="true"],
.chip.is-active {
    color: var(--purple-dark);
    border-color: #D9D2F5;
    background: var(--purple-soft);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ----------------------------
   Forms
   ---------------------------- */

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--navy);
    font-size: 11px;
    font-weight: 800;
}

.form-label .required {
    color: var(--red);
}

.form-control,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control::placeholder,
.form-textarea::placeholder {
    color: #A2A7B8;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: var(--ring);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.8;
}

.form-select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777D91' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

.form-hint {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.7;
}

.form-error {
    display: none;
    align-items: center;
    gap: 7px;
    color: var(--red-text);
    font-size: 10.5px;
    font-weight: 700;
}

.form-field.has-error .form-control,
.form-field.has-error .form-select,
.form-field.has-error .form-textarea,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #E6A6A1;
    background: #FFFBFB;
}

.form-field.has-error .form-error {
    display: flex;
}

.form-field.has-error .form-label {
    color: var(--red-text);
}

.form-control:disabled,
.form-select:disabled,
.form-field.is-disabled .form-control {
    background: var(--surface-muted);
    color: var(--muted);
    cursor: not-allowed;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field-full {
    grid-column: 1 / -1;
}

.fieldset {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    margin-bottom: 20px;
}

.fieldset > legend,
.fieldset-title {
    padding-inline: 8px;
    color: var(--navy);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 800;
}

.fieldset-description {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 11px;
}

/* Input with leading icon or trailing action */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .input-icon {
    position: absolute;
    left: 13px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.input-group .input-icon svg {
    width: 100%;
    height: 100%;
}

.input-group .form-control,
.input-group .form-select {
    padding-left: 42px;
}

.input-group.has-action .form-control {
    padding-right: 76px;
}

.input-group .input-action {
    position: absolute;
    right: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--purple);
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
}

.input-group .input-action:hover {
    background: var(--purple-soft);
}

/* Checkboxes, radios, switches */

.check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: var(--muted-strong);
    font-size: 11.5px;
    line-height: 1.7;
    cursor: pointer;
}

.check + .check {
    margin-top: 12px;
}

.check input {
    appearance: none;
    flex-shrink: 0;
    width: 19px;
    height: 19px;
    margin-top: 1px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.check input[type="radio"] {
    border-radius: 50%;
}

.check input:checked {
    border-color: var(--purple);
    background: var(--purple)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E")
        center / 13px no-repeat;
}

.check input[type="radio"]:checked {
    background: var(--purple);
    box-shadow: inset 0 0 0 4px var(--white);
}

.check input:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.check > span strong {
    display: block;
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
}

.check-card {
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.check-card:hover {
    border-color: #D9D2F5;
    background: var(--surface-muted);
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--muted-strong);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.switch input {
    appearance: none;
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #D7DAE5;
    cursor: pointer;
    transition: background 0.2s ease;
}

.switch input::after {
    position: absolute;
    content: "";
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 6px rgba(16, 21, 46, 0.2);
    transition: transform 0.2s ease;
}

.switch input:checked {
    background: var(--green);
}

.switch input:checked::after {
    transform: translateX(18px);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 11px;
    padding-top: 6px;
}

/* ----------------------------
   Tables
   ---------------------------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table caption {
    padding: 16px 18px 0;
    color: var(--muted);
    font-size: 10.5px;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    vertical-align: middle;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #FBFBFD;
}

.data-table td strong {
    font-size: 12px;
}

.table-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.table-sort:hover {
    color: var(--purple);
}

.table-sort::after {
    content: "↕";
    color: var(--border-strong);
    font-size: 10px;
}

.table-sort[aria-sort="ascending"]::after {
    content: "↑";
    color: var(--purple);
}

.table-sort[aria-sort="descending"]::after {
    content: "↓";
    color: var(--purple);
}

.table-num,
.data-table th.is-numeric,
.data-table td.is-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table-actions {
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.table-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-top: 1px solid var(--border);
}

.table-footer p {
    color: var(--muted);
    font-size: 10.5px;
}

/* Responsive: stacked table for narrow screens.
   Add data-label="Column" to each td. */
@media (max-width: 720px) {
    .table-wrap.is-stackable {
        border: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    .is-stackable .data-table {
        min-width: 0;
        border-collapse: separate;
    }

    .is-stackable .data-table thead {
        display: none;
    }

    .is-stackable .data-table tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface);
        box-shadow: var(--shadow-soft);
        overflow: hidden;
    }

    .is-stackable .data-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 11px 14px;
        text-align: right;
    }

    .is-stackable .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 9.5px;
        font-weight: 800;
        letter-spacing: 0.09em;
        text-transform: uppercase;
        text-align: left;
    }

    .is-stackable .data-table td:first-child {
        background: var(--surface-muted);
    }

    .is-stackable .data-table td:last-child {
        border-bottom: none;
    }

    .is-stackable .table-actions {
        justify-content: flex-end;
    }
}

/* ----------------------------
   Tabs
   ---------------------------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.tab {
    padding: 10px 15px;
    border-radius: 9px;
    color: var(--muted-strong);
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}

.tab:hover {
    color: var(--purple);
    background: var(--purple-soft);
}

.tab[aria-selected="true"] {
    color: var(--white);
    background: var(--navy);
}

.tab-count {
    padding-left: 6px;
    color: inherit;
    font-size: 10px;
    opacity: 0.7;
}

.tab-panel[hidden] {
    display: none;
}

/* ----------------------------
   Toolbar, search and filters
   ---------------------------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.toolbar .form-field {
    flex: 1 1 190px;
    min-width: 150px;
    margin-bottom: 0;
}

.toolbar-search {
    flex: 1 1 260px;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-left: auto;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-field svg {
    position: absolute;
    left: 13px;
    width: 17px;
    height: 17px;
    color: var(--muted);
    pointer-events: none;
}

.search-field input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-field input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: var(--ring);
}

.toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 10.5px;
}

.toolbar-meta strong {
    color: var(--navy);
}

/* ----------------------------
   Pagination
   ---------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.pagination-btn {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding-inline: 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--muted-strong);
    background: var(--white);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pagination-btn:hover:not(:disabled) {
    color: var(--purple);
    border-color: #D9D2F5;
    background: var(--purple-soft);
}

.pagination-btn[aria-current="page"] {
    color: var(--white);
    border-color: var(--navy);
    background: var(--navy);
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--muted);
    font-size: 10.5px;
}

.pagination-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
}

/* ----------------------------
   States: empty, loading, alerts
   ---------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 54px 26px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.empty-state-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: var(--purple);
    background: var(--purple-soft);
}

.empty-state-icon svg {
    width: 26px;
    height: 26px;
}

.empty-state h3 {
    font-size: 1.05rem;
}

.empty-state p {
    max-width: 460px;
    font-size: 12px;
}

.empty-state .btn-row {
    margin-top: 8px;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 44px 20px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    border-radius: var(--radius);
    background: linear-gradient(90deg, #EFF1F7 25%, #F7F8FC 50%, #EFF1F7 75%);
    background-size: 240% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-card {
    height: 190px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

@keyframes shimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -20% 0; }
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    font-size: 11.5px;
    line-height: 1.75;
}

.alert svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert strong {
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
}

.alert-info {
    color: var(--purple-dark);
    border-color: #DFDAF7;
    border-left-color: var(--purple);
    background: var(--purple-soft);
}

.alert-success {
    color: var(--green-text);
    border-color: #C7E8D8;
    border-left-color: var(--green);
    background: var(--green-soft);
}

.alert-warning {
    color: var(--amber-text);
    border-color: #EFE0BD;
    border-left-color: var(--amber);
    background: var(--gold-soft);
}

.alert-danger {
    color: var(--red-text);
    border-color: #F0C9C5;
    border-left-color: var(--red);
    background: var(--red-soft);
}

.alert + .alert {
    margin-top: 12px;
}

/* ----------------------------
   Modal dialogs
   ---------------------------- */

.modal {
    position: fixed;
    z-index: 1500;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 14, 35, 0.55);
    backdrop-filter: blur(3px);
}

.modal.is-open {
    display: flex;
}

.modal-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
}

.modal-dialog.is-wide {
    width: min(820px, 100%);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 0;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-header p {
    margin-top: 6px;
    font-size: 11.5px;
}

.modal-close {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface-muted);
    font-size: 16px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--red-text);
    background: var(--red-soft);
}

.modal-body {
    padding: 20px 24px;
    font-size: 12.5px;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--border);
}

.modal-body .list-check {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

/* ----------------------------
   Toasts
   ---------------------------- */

.toast-region {
    position: fixed;
    z-index: 2200;
    right: 20px;
    top: max(12px, env(safe-area-inset-top));
    bottom: auto;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-height: 52px;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 18px 40px rgba(16, 21, 46, 0.16);
    font-size: 14px;
    line-height: 1.5;
    pointer-events: auto;
    animation: toast-in 0.22s ease;
}

.toast svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-success {
    color: var(--green-text);
    border-color: #C7E8D8;
    border-left-color: var(--green);
    background: #F3FBF7;
}

.toast-info {
    color: var(--purple-dark);
    border-color: #DFDAF7;
    border-left-color: var(--purple);
    background: #F8F7FF;
}

.toast-warning {
    color: var(--amber-text);
    border-color: #EFE0BD;
    border-left-color: var(--amber);
    background: #FFFBF2;
}

.toast-error {
    color: var(--red-text);
    border-color: #F0C9C5;
    border-left-color: var(--red);
    background: #FFF5F4;
}

.toast-close {
    margin-left: auto;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    cursor: pointer;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------
   Menus, tooltips, back-to-top
   ---------------------------- */

.menu {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    display: none;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 20px 45px rgba(16, 21, 46, 0.14);
}

.menu.is-open {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--muted-strong);
    font-size: 11.5px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--muted);
}

.menu-item:hover {
    color: var(--purple);
    background: var(--purple-soft);
}

.menu-item:hover svg {
    color: var(--purple);
}

.menu-item.is-danger:hover {
    color: var(--red-text);
    background: var(--red-soft);
}

.menu-item.is-danger:hover svg {
    color: var(--red-text);
}

.menu-separator {
    height: 1px;
    margin: 7px 4px;
    background: var(--border);
}

.menu-anchor {
    position: relative;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    position: absolute;
    z-index: 1300;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    content: attr(data-tooltip);
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--navy);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    pointer-events: none;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.back-to-top {
    position: fixed;
    z-index: 900;
    right: 23px;
    bottom: 23px;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--white);
    background: var(--purple);
    box-shadow: 0 10px 28px rgba(16, 21, 46, 0.2);
    font-size: 19px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--purple-dark);
}

/* ----------------------------
   Dashboard / admin app shell
   ---------------------------- */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
    background: var(--background);
}

.app-shell.is-collapsed {
    grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100vh;
    padding: 20px 16px 22px;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.72);
    background: var(--navy);
}

.app-sidebar::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.16);
}

.app-sidebar-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    margin-bottom: 14px;
}

.app-sidebar-head .brand-logo {
    height: 44px;
    background: var(--white);
    border-radius: 9px;
    padding: 4px 6px;
}

.app-sidebar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.app-sidebar-title strong {
    color: var(--white);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 800;
}

.app-sidebar-title span {
    color: var(--gold);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-shell.is-collapsed .app-sidebar-title,
.app-shell.is-collapsed .side-label,
.app-shell.is-collapsed .nav-section-label {
    display: none;
}

.nav-section-label {
    padding: 16px 10px 7px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11.5px;
    font-weight: 700;
    transition: color 0.18s ease, background 0.18s ease;
}

.side-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.55);
}

.side-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.07);
}

.side-link:hover svg {
    color: var(--gold);
}

.side-link.active {
    color: var(--white);
    background: rgba(91, 75, 189, 0.42);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.side-link.active svg {
    color: var(--gold);
}

.side-link .side-count {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: var(--white);
    font-size: 9px;
    font-weight: 800;
}

.side-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-sidebar-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 70px;
    padding: 12px 26px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
}

.app-topbar h1 {
    font-size: 1.05rem;
}

.app-topbar .breadcrumbs {
    margin-top: 3px;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.app-content {
    flex: 1;
    padding: 26px 26px 48px;
}

.app-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    cursor: pointer;
}

.app-user-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--white);
    background: var(--purple);
    font-size: 10.5px;
    font-weight: 800;
}

.app-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    text-align: left;
}

.app-user-meta strong {
    font-size: 11px;
}

.app-user-meta span {
    color: var(--muted);
    font-size: 9.5px;
}

.sidebar-toggle {
    display: none;
}

.app-scrim {
    position: fixed;
    z-index: 1090;
    inset: 0;
    display: none;
    background: rgba(10, 14, 35, 0.5);
}

/* ----------------------------
   Responsive adjustments
   ---------------------------- */

@media (min-width: 1600px) {
    .brand-logo {
        height: 68px;
    }

    .site-footer .brand-logo {
        height: 84px;
    }

    .app-sidebar-head .brand-logo {
        height: 48px;
    }
}

@media (max-width: 1100px) {
    .main-nav {
        gap: 13px;
    }

    .nav-link,
    .nav-login {
        font-size: 11px;
    }

    .nav-cta {
        padding-inline: 13px;
        font-size: 11px;
    }

    .app-content {
        padding: 22px 20px 44px;
    }

    .app-topbar {
        padding-inline: 20px;
    }
}

/* The shared header collapses earlier than the homepage header
   because it carries extra navigation entries. */
@media (max-width: 1024px) {
    .site-header {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .menu-toggle {
        position: relative;
        z-index: 1002;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        flex: 0 0 46px;
        width: 46px;
        height: 46px;
        margin-left: auto;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--white);
        cursor: pointer;
    }

    .menu-toggle span {
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: var(--navy);
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .menu-toggle[aria-expanded="true"] span:first-child {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] span:last-child {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-container {
        min-height: 78px;
    }

    .main-nav {
        position: absolute;
        z-index: 1001;
        top: 100%;
        right: 16px;
        left: 16px;
        max-height: 55vh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 12px 20px 18px;
        overflow-y: auto;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: 0 0 14px 14px;
        box-shadow: 0 18px 38px rgba(16, 21, 46, 0.16);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }

    .main-nav.open {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }

    .main-nav .nav-link,
    .main-nav .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 11px 0;
        border-bottom: 1px solid var(--border);
        font-size: 13.5px;
    }

    .nav-link.active::after {
        display: none;
    }

    /* Dropdown groups become expanded sections on small screens. */
    .nav-dropdown {
        position: static;
        min-width: 0;
        gap: 0;
        padding: 4px 0 8px 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .main-nav:not(.open) .nav-dropdown {
        visibility: hidden;
    }

    .nav-dropdown-link {
        padding: 11px 0;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        font-size: 12.5px;
    }

    .nav-caret {
        display: none;
    }

    .main-nav .nav-login {
        padding: 16px 0;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
    }

    .main-nav .nav-cta {
        align-self: flex-start;
        margin-top: 12px;
        padding: 12px 18px;
    }

    /* Dashboard shell becomes a drawer. */
    .app-shell,
    .app-shell.is-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(292px, 86vw);
        transform: translateX(-100%);
        transition: transform 0.24s ease;
    }

    .app-shell.is-drawer-open .app-sidebar {
        transform: translateX(0);
    }

    .app-shell.is-drawer-open .app-scrim {
        display: block;
    }

    .app-shell.is-collapsed .app-sidebar-title,
    .app-shell.is-collapsed .side-label,
    .app-shell.is-collapsed .nav-section-label {
        display: block;
    }

    .sidebar-toggle {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--white);
        cursor: pointer;
    }
}

@media (max-width: 900px) {
    .section {
        padding: 62px 0;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 26px;
    }

    .page-hero-inner {
        padding: 52px 0 46px;
    }

    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 22px;
        padding-top: 46px;
        padding-bottom: 38px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 7px;
        padding-block: 18px;
    }

    .toolbar {
        padding: 16px;
    }

    .toolbar-actions {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .container,
    .container-narrow {
        width: min(100% - 32px, var(--container));
    }

    .brand-logo {
        height: 56px;
        max-width: 66vw;
    }

    .site-footer .brand-logo {
        height: 66px;
        max-width: 66vw;
    }

    .app-topbar {
        padding: 12px 16px;
    }

    .app-content {
        padding: 18px 16px 40px;
    }

    .app-user-meta {
        display: none;
    }

    .modal {
        padding: 14px;
    }

    .modal-body,
    .modal-header,
    .modal-footer {
        padding-inline: 18px;
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .toast-region {
        right: 14px;
        top: max(12px, env(safe-area-inset-top));
        bottom: auto;
    }

    .btn-row .btn {
        flex: 1 1 auto;
    }

    .pagination-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .site-header,
    .site-footer,
    .app-sidebar,
    .app-topbar,
    .toolbar,
    .pagination-wrap,
    .back-to-top,
    .btn,
    .toast-region {
        display: none !important;
    }

    body {
        background: #FFFFFF;
    }

    .table-wrap,
    .card,
    .panel {
        box-shadow: none;
    }
}






