:root {
    --primary: #5b43ed;
    --primary-dark: #4732d0;
    --ink: #26364e;
    --muted: #738299;
    --line: #e5ecf5;
    --card-shadow: 0 4px 18px #26364e0a, 0 1px 4px #26364e04;
}
body { background: #fff; color: var(--ink); font-family: Nunito, sans-serif; font-size: 14px; }
.ui-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.topbar { height: 72px; display: flex; align-items: center; gap: 42px; padding: 0 26px; background: #fff; border-bottom: 1px solid #e8ebf3; position: fixed; inset: 0 0 auto; z-index: 10; }
.brand { display: flex; align-items: center; gap: 8px; align-self: stretch; width: 232px; margin-left: -26px; padding-left: 26px; background: #101f3a; color: #fff; text-decoration: none; font-size: 21px; font-weight: 800; flex-shrink: 0; }
.brand > span:last-child { margin-left: -6px; font-weight: 500; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; background: linear-gradient(145deg, #6f56f4, #4936d3); border-radius: 10px; }
.brand-icon .ui-icon { width: 23px; height: 23px; }
.top-label { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.top-label strong { font-weight: 700; color: var(--ink); }
.top-label .ui-icon { width: 15px; height: 15px; }
.avatar { display: grid; place-items: center; margin-left: auto; width: 35px; height: 35px; color: var(--primary); background: #edf3ff; border: 1px solid #dde8ff; border-radius: 50%; font-size: 11px; font-weight: 800; }
.side-nav { position: fixed; top: 72px; bottom: 0; width: 232px; padding: 35px 16px; border-right: 0; background: #101f3a; }
.nav-caption, .eyebrow { font-size: 10px; color: var(--muted); letter-spacing: 1.4px; font-weight: 800; }
.nav-caption { padding-left: 13px; margin-bottom: 18px; }
.nav-list { display: grid; gap: 8px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 14px 13px; border-radius: 9px; color: #aebbd0; text-decoration: none; font-weight: 800; font-size: 13px; transition: color .15s, background-color .15s; }
.nav-link:hover { color: #fff; background: #ffffff0d; }
.nav-link.nav-active { background: linear-gradient(110deg, #5c43ee, #715cf4); color: white; box-shadow: 0 8px 20px #080f2240; }
.nav-link.nav-active:hover { color: white; background: linear-gradient(110deg, #674ff1, #7b68f5); }
.nav-link .nav-chevron { margin-left: auto; width: 14px; }
.sidebar-note { position: absolute; bottom: 24px; left: 22px; right: 22px; color: #aab5c8; font-size: 12px; line-height: 1.7; }
.sidebar-note strong { display: block; color: #fff; font-size: 12px; }
.sidebar-symbol { display: inline-flex; margin-bottom: 12px; color: #8e9db6; }
main { margin: 72px 0 0 232px; padding: 36px clamp(24px, 3vw, 64px) 28px; }
.page-heading, .workspace, footer { max-width: none; margin-left: 0; margin-right: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 8px; }
h1 { font-size: 30px; letter-spacing: -.6px; font-weight: 800; margin-bottom: 7px; }
h2 { font-size: 20px; font-weight: 800; margin: 0 0 5px; }
.muted { color: var(--muted); font-size: 14px; }
.page-heading p:last-child, .section-heading p { margin: 0; }
.workspace { padding: 0; border: 0; background: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; font-weight: 800; line-height: 1.5; padding: 11px 16px; border-radius: 7px; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn .ui-icon { width: 16px; height: 16px; }
.btn-primary { --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 3px 7px #527fe71a; }
.btn-primary:hover, .btn-primary:active { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary, .page-heading #new-app { --bs-btn-disabled-color: #75869c; --bs-btn-disabled-border-color: #dce5f2; background: white; border-color: #dce5f2; color: #516783; box-shadow: none; }
.btn-outline-primary:hover, .page-heading #new-app:hover { color: var(--primary-dark); border-color: #abc2f4; background: #f7faff; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--card-shadow); }
.app-card { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 20px; }
.application-symbol { align-self: flex-start; display: grid; place-items: center; margin-top: 22px; width: 34px; height: 34px; border-radius: 9px; background: #edf3ff; color: var(--primary); flex-shrink: 0; }
.application-symbol .ui-icon { width: 19px; height: 19px; }
.application-picker { min-width: 0; flex: 1; }
.application-picker label { display: block; color: #697c96; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 5px; }
.form-select, .form-control, body select.form-select { border: 1px solid #dfe7f2; border-radius: 7px; font-size: 14px; padding: 12px 14px; color: var(--ink); height: auto; outline: none; background-color: #fff; }
body select.form-select { padding-right: 35px; }
body #application.form-select { max-width: 640px; padding: 8px 35px 8px 12px; font-size: 17px; font-weight: 800; border-color: #cad9f1; background-color: #fcfdff; }
#app-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.app-card > .btn { padding: 8px 12px; font-size: 13px; }
#app-detail .badge-state { padding: 3px 7px; }
.app-code { color: #62758e; font-family: monospace; font-size: 13px; }
.app-warning { flex-basis: 100%; margin: 0; color: #bd435a; }
#apps-pagination { justify-content: flex-start; margin-top: 10px; }
#apps-pagination[hidden] { display: none; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.summary {
    --accent: #5988ee;
    --tint: #edf3ff;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-content: center;
    column-gap: 16px;
    row-gap: 4px;
    padding: 20px 22px;
    min-height: 132px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}
.summary.blue { --accent: #5b43ed; --tint: linear-gradient(145deg, #684cf1, #4e37da); }
.summary.green { --accent: #ffad13; --tint: linear-gradient(145deg, #ffb71c, #ff9800); }
.summary.amber { --accent: #45ae55; --tint: linear-gradient(145deg, #58bd67, #359849); }
.summary.coral { --accent: #1778e8; --tint: linear-gradient(145deg, #2588ef, #126bd9); }
.metric-content { display: contents; }
.metric-content > span { grid-column: 2; grid-row: 1; align-self: end; font-size: 14px; font-weight: 700; color: #3d4a61; }
.summary strong {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
    font-size: 32px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}
.summary small { grid-column: 2; grid-row: 3; align-self: start; font-size: 12px; color: var(--muted); line-height: 1.35; }
.metric-icon { grid-column: 1; grid-row: 1 / 4; align-self: center; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--tint); color: white; box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 22%, transparent); }
.metric-icon .ui-icon { width: 32px; height: 32px; stroke-width: 2; }
.tokens-card { padding: 0; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title .muted { font-size: 14px; }
.section-symbol { display: grid; place-items: center; background: #f1f5fa; color: #7186a2; width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.filters { display: flex; align-items: center; gap: 12px; padding: 18px 22px; }
.filters > label { margin: 0; }
.search { position: relative; max-width: 460px; flex: 1; }
.search > .ui-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8c9bb0; width: 17px; height: 17px; pointer-events: none; }
.search .form-control { padding-left: 39px; }
.filters > button { margin-left: auto; }
body .form-control::placeholder { color: #8291a5; }
.table-responsive { padding: 0 22px; }
.table { margin-bottom: 0; }
.table th { font-size: 13px; color: #75869c; background: #f6f8fc; letter-spacing: .2px; font-weight: 800; border-top: 1px solid #edf1f7; padding: 14px 16px; }
.table th:first-child { border-radius: 6px 0 0 6px; }
.table th:last-child { border-radius: 0 6px 6px 0; }
.table td { color: #52647c; font-size: 14px; padding: 22px 16px; border-color: #edf1f7; vertical-align: middle; }
.table tbody tr:hover { background: #fbfcff; }
.table td:first-child { color: var(--ink); font-weight: 800; max-width: 250px; white-space: normal; overflow-wrap: anywhere; }
.token-name { display: flex; gap: 11px; align-items: center; }
.token-symbol { display: grid; place-items: center; background: #f1f5fb; color: #8296b2; width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.token-symbol .ui-icon { width: 17px; height: 17px; }
.token-id { display: block; font-weight: 400; font-size: 12px; color: #8796a9; margin-top: 5px; }
.badge-state { display: inline-flex; align-items: center; gap: 6px; background: #e9f8f1; color: #21865f; padding: 5px 9px; border-radius: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-state::before { content: ''; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.badge-state.expired { color: #a66b11; background: #fff5e4; }
.badge-state.revoked { color: #bd435a; background: #ffedf0; }
.actions { text-align: right; white-space: nowrap; }
.row-action { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #e1e8f3; border-radius: 6px; color: #55739f; font-size: 13px; font-weight: 700; padding: 7px 9px; margin-left: 5px; }
.row-action .ui-icon { width: 13px; height: 13px; }
.row-action.danger { border-color: #f4dee3; color: #c45267; }
.row-action:hover { background: #f4f8ff; border-color: #b8ccee; }
.row-action.danger:hover { background: #fff3f5; border-color: #edbdc8; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.table .empty { text-align: center; padding: 48px 16px; color: var(--muted); font-weight: 400; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; }
.table-footer .muted { font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 11px; }
.pager .btn { font-size: 12px; padding: 7px 11px; }
.text-button { border: 0; background: none; color: var(--primary); padding: 4px 10px; }
.security-note { display: flex; align-items: center; gap: 8px; margin: 20px 3px 0; font-size: 12px; color: #7f8fa5; }
.security-note .ui-icon { width: 14px; height: 14px; }
footer { display: flex; justify-content: space-between; padding-top: 24px; color: #8a99ac; font-size: 10px; }
dialog { border: 1px solid var(--line); border-radius: 13px; padding: 28px; width: 480px; max-width: calc(100% - 32px); color: var(--ink); box-shadow: 0 24px 90px #23364e33; }
dialog::backdrop { background: #1d2b4666; }
dialog label { display: block; font-size: 12px; font-weight: 800; margin: 18px 0 8px; }
dialog input, dialog select, dialog textarea { width: 100%; border: 1px solid #dfe7f2; border-radius: 7px; padding: 11px; font-size: 14px; background: #fcfdff; }
dialog textarea { font-family: monospace; resize: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.form-error, #notice { padding: 14px; margin: 0 0 18px; background: #ffedf0; color: #ad3d54; border: 1px solid #f7d8df; border-radius: 7px; white-space: pre-line; }
.form-error { margin-top: 16px; }
#notice.success { color: #21865f; background: #e9f8f1; border-color: #cdebdc; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
:focus-visible, body select.form-select:focus-visible { outline: 3px solid #9fbcf2; outline-offset: 2px; }
body dialog input:focus { border: 1px solid #91b2ed; outline: 2px solid #c5d8f8; outline-offset: 2px; }
@media (max-width: 1200px) {
    .brand { width: 205px; }
    .side-nav { width: 205px; padding-left: 12px; padding-right: 12px; }
    main { margin-left: 205px; padding: 28px 24px; }
    .summary-grid { gap: 12px; }
    .summary { grid-template-columns: 54px minmax(0, 1fr); padding: 17px 14px; column-gap: 12px; }
    .metric-icon { width: 54px; height: 54px; border-radius: 13px; }
    .metric-icon .ui-icon { width: 27px; height: 27px; }
}
@media (max-width: 1000px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-card { flex-wrap: wrap; }
    .app-card > .btn { margin-left: 46px; }
    .top-label { gap: 8px; }
    .topbar { gap: 25px; }
}
@media (max-width: 760px) {
    .topbar { height: 62px; padding: 0 18px; }
    .brand { width: auto; margin-left: -18px; padding-left: 18px; padding-right: 18px; font-size: 20px; }
    .top-label { display: none; }
    .side-nav { position: static; margin-top: 62px; width: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
    .nav-caption, .sidebar-note { display: none; }
    .nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-link { justify-content: center; padding: 10px 12px; }
    .nav-link .nav-chevron { display: none; }
    main { margin: 0; padding: 24px 16px; }
    .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
    h1 { font-size: 24px; }
    .app-card { padding: 12px 14px; gap: 10px; }
    .application-symbol { display: none; }
    .application-picker { flex-basis: 100%; }
    body #application.form-select { font-size: 17px; }
    .app-card > .btn { margin-left: 0; }
    .summary-grid { gap: 10px; margin-bottom: 16px; }
    .summary { padding: 16px 14px; grid-template-columns: 48px minmax(0, 1fr); column-gap: 11px; row-gap: 3px; min-height: 112px; border-radius: 12px; }
    .summary strong { font-size: 29px; }
    .metric-content > span { font-size: 13px; }
    .summary small { font-size: 11px; }
    .metric-icon { width: 48px; height: 48px; border-radius: 12px; }
    .metric-icon .ui-icon { width: 24px; height: 24px; }
    .section-heading { padding: 18px 14px; flex-wrap: wrap; gap: 14px; }
    .section-title { align-items: flex-start; gap: 9px; }
    h2 { font-size: 16px; }
    .section-title .muted { font-size: 11px; }
    .filters { flex-wrap: wrap; padding: 14px; gap: 10px; }
    .search { max-width: none; flex-basis: 100%; }
    .filters .btn { padding: 10px; }
    .table-responsive { padding: 0 14px; }
    .table-footer { padding: 14px; flex-direction: column; align-items: flex-start; }
    .security-note { align-items: flex-start; line-height: 1.7; font-size: 10px; }
    footer span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

.side-nav .nav-caption { color: #73839f; }
.side-nav .nav-link.nav-active .ui-icon { color: white; }
