:root {
    color-scheme: light;
    font-family: "Inter", "Geist", system-ui, sans-serif;
    font-size: 15px;
    --ink: #191837;
    --muted: #545773;
    --line: #dee1f0;
    --field-border: #c7cce3;
    --surface: #ffffff;
    --canvas: #f4f6fd;
    --subtle: #f7f7fd;
    --accent: #3444bd;
    --accent-dark: #282d9e;
    --accent-soft: #edf0ff;
    --focus: #6253d5;
    --sidebar: #0c0d25;
    --sidebar-text: #f5f3fc;
    --sidebar-muted: #bbbddd;
    --sidebar-hover: #25234b;
    --radius: 15px;
    color: var(--ink);
    background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.55rem); font-weight: 760; letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; font-weight: 740; letter-spacing: -.022em; }
h3 { font-size: .98rem; }
small { font-size: .83rem; }
.strong { font-weight: 720; }
.muted { color: var(--muted); }
.text-red { color: #982f2f; }
.multiline { white-space: pre-wrap; }
.skip { position: fixed; top: .8rem; left: .8rem; z-index: 10; background: white; padding: .7rem; transform: translateY(-200%); }
.skip:focus { transform: none; }
.application { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100dvh; background: radial-gradient(ellipse at 96% 0%, #edeafd, transparent 37rem), var(--canvas); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 1.6rem 1rem 1.1rem; background: linear-gradient(160deg, #191137, var(--sidebar) 54%); color: var(--sidebar-text); }
.sidebar :focus-visible { outline-color: #8f9dff; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: inherit; font-size: 1.34rem; font-weight: 750; letter-spacing: -.035em; }
.brand:hover { text-decoration: none; }
.sidebar .brand { padding: 0 .5rem; }
.brand-mark {
    --brand-size: 76px;
    display: block;
    flex: 0 0 var(--brand-size);
    width: var(--brand-size);
    height: var(--brand-size);
    object-fit: contain;
    border-radius: 50%;
    background: var(--sidebar);
    box-shadow: 0 0 20px #7057ec30;
}
.brand small, .session small { display: block; margin-top: .08rem; font-weight: 500; letter-spacing: 0; color: var(--sidebar-muted); }
.sidebar nav { display: grid; gap: .4rem; margin-top: 2.6rem; }
.sidebar nav a { display: flex; align-items: center; gap: .75rem; padding: .78rem .8rem; border-radius: 10px; color: var(--sidebar-muted); font-weight: 630; }
.sidebar nav a:hover { color: var(--sidebar-text); background: var(--sidebar-hover); text-decoration: none; }
.sidebar nav a.selected { color: #fff; background: linear-gradient(100deg, #252e64, #392257); box-shadow: inset 3px 0 #62b6ff; }
.session { margin-top: auto; padding: .9rem .15rem 0; border-top: 1px solid #383657; display: flex; align-items: center; gap: .55rem; }
.session-name { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: .87rem; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; background: var(--sidebar-hover); color: #d8d9ff; border-radius: 50%; }
.icon-button { display: grid; place-items: center; width: 35px; height: 38px; background: transparent; border: 0; color: inherit; border-radius: 8px; }
.icon-button:hover { background: var(--sidebar-hover); }
.workspace { width: 100%; max-width: 1500px; margin: 0 auto; padding: 2.55rem clamp(1.4rem, 4vw, 4rem) 3.5rem; min-width: 0; }
.page-heading { display: flex; align-items: center; gap: 1rem; justify-content: space-between; margin-bottom: 1.6rem; }
.date-stamp { display: flex; align-items: center; gap: .45rem; white-space: nowrap; padding: .55rem .72rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: .87rem; color: var(--muted); }
.actions, .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.toolbar { justify-content: space-between; margin-bottom: 1rem; }
.quick { margin-bottom: 1.65rem; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .57rem .88rem; border: 1px solid transparent; border-radius: 9px; line-height: 1.2; font-weight: 680; text-align: center; }
.button:hover { text-decoration: none; }
.primary { color: #fff; background: linear-gradient(105deg, var(--accent), #662db7); }
.primary:hover { background: linear-gradient(105deg, var(--accent-dark), #50218f); }
.secondary { color: var(--ink); background: var(--surface); border-color: var(--field-border); }
.secondary:hover { background: var(--accent-soft); border-color: #a4a9d7; }
.danger-button { background: #a52e2e; color: #fff; }
.danger-button:hover { background: #822121; }
.text-link { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 680; }
.back { font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.35rem; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px #24184008; }
.metric { display: flex; flex-direction: column; min-width: 0; padding: 1.05rem; }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; margin-bottom: .85rem; }
.metric h2 { font-size: .9rem; color: var(--muted); margin-bottom: .32rem; line-height: 1.3; }
.metric strong { font-size: clamp(1.18rem, 2.2vw, 1.85rem); letter-spacing: -.055em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { color: var(--muted); margin-top: .45rem; }
.green { background: #e3f4e9; color: #126040; }
.blue { background: #e7f0ff; color: #244ca1; }
.red { background: #fbeaea; color: #a13131; }
.violet { background: #f1e8fd; color: #6535a4; }
.amber { background: #f9f0d7; color: #734e09; }
.gray { background: #eeeff5; color: #52566d; }
.panel { margin-bottom: 1.1rem; min-width: 0; }
.panel-heading { padding: 1.12rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.panel-heading p { margin-top: .25rem; color: var(--muted); font-size: .88rem; }
.padded { padding: 1.2rem; }
.padded > h2 { margin-bottom: 1rem; }
.padded > p { margin-bottom: .8rem; }
.subheading { padding: 1.05rem 1.2rem .75rem; }
.empty { color: var(--muted); padding: 1.4rem 1.2rem; border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th, td { text-align: left; padding: .75rem .9rem; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 1.2rem; }
th:last-child, td:last-child { padding-right: 1.2rem; }
th { background: var(--subtle); color: var(--muted); font-size: .8rem; font-weight: 700; }
td small { display: block; color: var(--muted); margin-top: .23rem; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; border-radius: 99px; padding: .25rem .55rem; font-size: .77rem; font-weight: 700; white-space: nowrap; }
.result-count { display: inline-block; margin-left: .3rem; font-size: .82rem; color: var(--accent); background: var(--accent-soft); padding: .16rem .5rem; border-radius: 99px; }
.field { display: grid; gap: .36rem; align-content: start; color: var(--ink); font-weight: 650; font-size: .9rem; min-width: 0; }
.field input, .field select, .field textarea { background: var(--surface); color: var(--ink); border: 1px solid var(--field-border); min-height: 43px; border-radius: 8px; padding: .55rem .65rem; width: 100%; min-width: 0; font-weight: 470; }
.field textarea { resize: vertical; }
.field input::placeholder { color: var(--muted); }
.searchable-select { position: relative; }
.field .searchable-select input { padding-right: 2.55rem; }
.searchable-select-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 2.35rem; display: grid; place-items: center; border: 0; border-radius: 0 7px 7px 0; color: var(--ink); background: transparent; }
.searchable-select-toggle::after { content: ""; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.searchable-select-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.searchable-select-menu { position: absolute; z-index: 8; top: calc(100% + 4px); left: 0; right: 0; max-height: 17rem; overflow-y: auto; padding: .25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #20194426; font-weight: 470; }
.searchable-select-menu [role="option"], .searchable-select-menu p { margin: 0; padding: .6rem; overflow-wrap: anywhere; }
.searchable-select-menu [role="option"] { cursor: pointer; border-radius: 5px; }
.searchable-select-menu [role="option"]:hover, .searchable-select-menu [data-highlighted] { background: var(--accent-soft); }
.searchable-select-menu [aria-selected="true"] { font-weight: 700; }
.searchable-select-menu p { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem; align-items: start; }
.form-panel, .flow { max-width: 970px; }
.form-grid .wide, .facts .wide { grid-column: 1 / -1; }
.filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-bar { display: flex; align-items: end; gap: .7rem; padding: 1.1rem 1.2rem; }
.filter-bar label { flex: 1; max-width: 430px; }
.stack { display: grid; gap: .85rem; }
.flow { display: grid; gap: 1rem; }
.flow .panel { margin: 0; }
.flow.compact { gap: .65rem; }
.check { display: inline-flex; gap: .5rem; align-items: center; margin-bottom: .75rem; font-weight: 650; }
.check input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
[data-design] > p { margin: .85rem 0; }
.installment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: .7rem; align-items: end; padding: .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle); }
.installment-payment { grid-column: 1 / -1; }
.installment-payment > p { margin: 0 0 .4rem; }
.installment-actions { margin-top: .65rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; }
dt { font-size: .82rem; color: var(--muted); margin-bottom: .27rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.minor-action, .form-details { margin-top: 1rem; }
.form-details.inset { margin: 0; padding: .9rem 1.2rem; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--accent); font-weight: 670; }
details form { margin-top: .7rem; }
.inline-details { margin-top: .35rem; }
.inline-details form { min-width: 174px; }
.tabs { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--accent-soft); border-radius: 10px; }
.tabs a { padding: .44rem .68rem; border-radius: 7px; color: var(--muted); font-size: .88rem; }
.tabs a.selected { background: #fff; color: var(--accent); font-weight: 700; }
.alert { border: 1px solid; border-radius: 10px; padding: .75rem .9rem; margin-bottom: 1rem; }
.alert.danger { background: #feeeee; color: #8a2424; border-color: #ecc6c6; }
.alert.success { background: #e5f5ed; color: #1a5a41; border-color: #bcdfcb; }
.alert.info { background: #ebf4fc; color: #274b6c; border-color: #c7ddec; }
.signed-out { min-height: 100dvh; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(ellipse at 13% 78%, #132967 0, transparent 54%), radial-gradient(ellipse at 93% 12%, #42196e 0, transparent 58%), #0b0b23; }
.login-shell { width: min(100%, 440px); padding: clamp(1.35rem, 5vw, 2.4rem); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 60px #05041965; }
.login-brand { margin-bottom: 1.65rem; }
.login-brand .brand-mark { --brand-size: 84px; }
.login-brand small { color: var(--muted); }
.login-shell h1 { font-size: 1.85rem; }
.login-shell .button { margin-top: .45rem; }
@media (max-width: 1100px) {
    .metrics, .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .application { display: block; }
    .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; gap: .8rem; padding: .85rem 1rem .7rem; }
    .sidebar .brand { padding: 0; }
    .sidebar .brand-mark { --brand-size: 62px; }
    .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .2rem; margin: 0; }
    .sidebar nav a { padding: .58rem .55rem; gap: .35rem; font-size: .84rem; }
    .sidebar nav svg { width: 17px; height: 17px; }
    .session { margin: 0; padding: 0; border: 0; grid-column: 2; grid-row: 1; }
    .session .avatar, .session .session-name { display: none; }
    .workspace { padding: 1.35rem .85rem 2rem; }
    .page-heading { margin-bottom: 1.15rem; flex-wrap: wrap; }
    .quick { margin-bottom: 1.1rem; }
    .metrics { gap: .55rem; }
    .metric { padding: .75rem; }
    .metric h2 { font-size: .84rem; }
    .metric small { font-size: .75rem; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-heading, .padded { padding: .9rem; }
    .table-wrap { overflow: visible; }
    table, tbody, tr, td { display: block; }
    thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    tr { border-top: 1px solid var(--line); padding: .6rem .9rem; }
    td, td:first-child, td:last-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: .55rem; align-items: start; border: 0; padding: .28rem 0; text-align: left; white-space: normal; }
    td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 650; }
    td small, td details { grid-column: 2; }
}
@media (max-width: 485px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .facts { gap: .8rem .55rem; }
    .installment { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .installment button { grid-column: 1 / -1; justify-self: end; }
    .filter-bar { align-items: stretch; flex-direction: column; padding: .8rem; }
    .filter-bar button { align-self: start; }
}
