:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", sans-serif;
    color: #17251f;
    background: #f3f6f4;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f3f6f4; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.app-frame { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.menu-backdrop, .menu-toggle { display: none; }
.side-menu { position: sticky; top: 0; height: 100vh; padding: 1.4rem 1rem; background: #123c2c; color: white; overflow-y: auto; }
.brand { font-size: 1.3rem; font-weight: 800; letter-spacing: .05em; }
.side-menu nav { display: grid; gap: .3rem; margin-top: 1.5rem; }
.side-menu nav a { padding: .62rem .75rem; border-radius: .45rem; color: #d8e8e0; }
.side-menu nav a.active, .side-menu nav a:hover { background: #255c46; color: white; }
.menu-group { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid rgba(255,255,255,.13); }
.menu-group summary { cursor: pointer; padding: .5rem .75rem; color: #86b9a1; font-size: .72rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; list-style: none; }
.menu-group summary::after { content: "+"; float: right; font-size: 1rem; }
.menu-group[open] summary::after { content: "-"; }
.menu-items { display: grid; gap: .2rem; }
.nav-form { margin: 0; }
.nav-form button { border: 0; background: transparent; color: #d8e8e0; padding: .65rem .9rem; cursor: pointer; }
.nav-form button:hover { color: white; }
.app-shell { max-width: 1500px; margin: 0 auto; padding: 2rem 3vw 4rem; }
.top-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: -1rem 0 1.5rem; padding: .55rem .8rem; border: 1px solid #d9e5de; border-radius: .65rem; background: white; box-shadow: 0 7px 20px rgba(24, 50, 38, .05); }
.top-bar-title, .top-bar-user { display: flex; align-items: center; gap: .6rem; }
.top-bar-title img { width: 38px; height: 38px; object-fit: contain; }
.top-bar-title strong { color: #174d37; letter-spacing: .01em; }
.top-bar-user { font-size: .85rem; color: #718078; }
.top-bar-user strong { color: #244b39; }
.hero { max-width: 850px; padding: 5rem 0; }
.hero h1, .page-heading h1 { margin: .2rem 0 .6rem; font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1; }
.hero p { font-size: 1.15rem; color: #586860; max-width: 700px; }
.dashboard-filter { display: flex; align-items: end; gap: .7rem; }
.dashboard-filter label { display: grid; gap: .35rem; min-width: 180px; color: #43534a; font-size: .85rem; font-weight: 700; }
.dashboard-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.summary-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border: 1px solid #dce5df; border-radius: .8rem; background: white; box-shadow: 0 12px 30px rgba(24, 50, 38, .05); color: #637168; }
.summary-card strong { color: #176c49; font-size: 1.8rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.chart-card { min-width: 0; }
.chart-total { color: #176c49; }
.chart-content { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(220px, 1.2fr); gap: 1.5rem; align-items: center; }
.pie-chart { width: min(250px, 100%); aspect-ratio: 1; margin: auto; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(18, 60, 44, .08); }
.chart-legend { display: grid; gap: .65rem; }
.legend-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 48px; align-items: center; gap: .5rem; padding-bottom: .5rem; border-bottom: 1px solid #edf1ee; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-label { overflow-wrap: anywhere; }
.legend-item small { text-align: right; color: #718078; }
.chart-empty { display: grid; min-height: 260px; place-items: center; border-radius: .65rem; background: #f5f8f6; color: #718078; }
.eyebrow { margin: 0; color: #2f7658; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { font-size: 2.3rem; }
.page-heading p { margin-bottom: 0; color: #637168; }
.management-grid { display: grid; grid-template-columns: minmax(520px, 1.35fr) minmax(400px, 1fr); gap: 1.25rem; align-items: start; }
.scope-panel { margin-bottom: 1rem; }
.panel { background: white; border: 1px solid #dce5df; border-radius: .8rem; padding: 1.25rem; box-shadow: 0 12px 30px rgba(24, 50, 38, .06); }
.panel h2, .panel h3 { margin-top: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.search, input, select { width: 100%; border: 1px solid #cdd9d1; border-radius: .45rem; padding: .7rem .8rem; background: white; }
.search { max-width: 280px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid label { display: grid; gap: .35rem; color: #43534a; font-size: .9rem; font-weight: 700; }
.checks { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 1.2rem 0; }
.checks label { display: flex; align-items: center; gap: .4rem; }
.checks input { width: auto; }
.actions { display: flex; gap: .6rem; }
.button { border: 0; border-radius: .45rem; padding: .72rem 1rem; cursor: pointer; display: inline-block; font-weight: 750; }
.button.primary { background: #176c49; color: white; }
.button.secondary { background: #e6eee9; color: #244b39; }
.button.compact { padding: .45rem .65rem; white-space: nowrap; }
.button:disabled { opacity: .55; cursor: wait; }
.table-wrap { overflow: auto; max-height: 680px; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; text-align: left; background: #f3f7f4; color: #617168; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; }
th, td { padding: .78rem .65rem; border-bottom: 1px solid #e7ede9; }
tr.clickable { cursor: pointer; }
tr.clickable:hover, tr.selected { background: #edf7f1; }
.badge { display: inline-block; border-radius: 2rem; padding: .25rem .55rem; font-size: .75rem; font-weight: 800; }
.badge.active { background: #d9f4e5; color: #11633e; }
.badge.inactive { background: #f2e5e3; color: #8b332c; }
.permissions { border-top: 1px solid #e1e9e4; margin-top: 1.5rem; padding-top: 1.2rem; }
.permissions ul { list-style: none; padding: 0; max-height: 260px; overflow: auto; }
.permissions li { display: flex; justify-content: space-between; gap: .8rem; border-bottom: 1px solid #edf1ee; padding: .6rem 0; }
.permissions span, .muted { color: #718078; }
.approval-grid { grid-template-columns: minmax(700px, 2fr) minmax(320px, .8fr); }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: .7rem 1rem; margin: 1.2rem 0; }
.detail-list dt { color: #637168; font-weight: 750; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.token-filters { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.token-filters label { display: grid; gap: .35rem; color: #43534a; font-size: .85rem; font-weight: 700; }
.token-selection { margin-top: 1rem; }
.token-actions { margin-top: 1.2rem; }
.search-action { align-self: end; }
.notice { padding: .85rem 1rem; margin-bottom: 1rem; border-radius: .5rem; font-weight: 650; }
.notice.success { background: #dff4e8; color: #155f3e; }
.notice.error, .validation-message { color: #8b2e28; }
.loading-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(18, 60, 44, .2); backdrop-filter: blur(1px); }
.loading-window { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border: 1px solid #d4dfd8; border-radius: .65rem; background: white; box-shadow: 0 16px 45px rgba(18, 60, 44, .2); color: #244b39; }
.loading-spinner { width: 1.2rem; height: 1.2rem; border: 3px solid #d4e4db; border-top-color: #176c49; border-radius: 50%; animation: loading-spin .75s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.journey-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr) auto) minmax(0, 1fr); gap: .35rem; align-items: center; margin: 0 0 1.25rem; }
.journey-step { display: flex; align-items: center; gap: .55rem; border: 1px solid #d4dfd8; border-radius: .65rem; padding: .75rem; background: white; color: #66756d; text-align: left; }
.journey-arrow { color: #83a292; font-size: 1.35rem; font-weight: 900; line-height: 1; }
.journey-step span { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #e8efeb; font-weight: 850; }
.journey-step.current { border-color: #176c49; background: #eaf6ef; color: #14593d; }
.journey-step.current span, .journey-step.complete span { background: #176c49; color: white; }
.journey-step:disabled { opacity: .55; cursor: not-allowed; }
.account-card { max-width: 520px; margin: 4rem auto; padding: 2rem; background: white; border: 1px solid #dce5df; border-radius: .8rem; box-shadow: 0 12px 30px rgba(24, 50, 38, .08); }
.account-card.wide { max-width: 720px; }
.account-card h1 { margin: .25rem 0 .5rem; font-size: 2.2rem; }
.account-card p { color: #637168; }
.account-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.account-form label { display: grid; gap: .4rem; color: #43534a; font-weight: 700; }
.account-form .button { justify-self: start; }
#blazor-error-ui { display: none; }

@media (max-width: 1000px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .management-grid { grid-template-columns: 1fr; }
    .token-filters { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .app-frame { grid-template-columns: 1fr; }
    .side-menu { position: fixed; z-index: 1200; inset: 0 auto 0 0; width: min(82vw, 280px); height: 100vh; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 40px rgba(12, 36, 27, .25); }
    .menu-open .side-menu { transform: translateX(0); }
    .menu-backdrop { position: fixed; z-index: 1100; inset: 0; border: 0; background: rgba(9, 29, 21, .45); }
    .menu-open .menu-backdrop { display: block; }
    .menu-toggle { display: grid; gap: 3px; width: 32px; height: 32px; place-content: center; border: 1px solid #d6e2db; border-radius: .4rem; background: #edf5f0; cursor: pointer; }
    .menu-toggle span { display: block; width: 15px; height: 2px; border-radius: 2px; background: #176c49; }
    .page-heading { align-items: flex-start; flex-direction: column; padding-top: 1rem; padding-bottom: 1rem; }
    .top-bar { margin-top: 0; }
    .journey-steps { display: flex; flex-wrap: wrap; }
    .journey-step { flex: 1 1 180px; }
    .journey-arrow { display: none; }
}

@media (max-width: 620px) {
    .dashboard-filter { width: 100%; align-items: stretch; flex-direction: column; }
    .dashboard-filter label { min-width: 0; }
    .dashboard-summary { grid-template-columns: 1fr; }
    .chart-content { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .panel-heading { align-items: stretch; flex-direction: column; }
    .search { max-width: none; }
    .token-filters { grid-template-columns: 1fr; }
    .top-bar { align-items: flex-start; flex-direction: column; }
}
