* { box-sizing: border-box; }
:root { font: 100%/1.5 "Inter", "Segoe UI", system-ui, sans-serif; color: #17253a; background: #f5f7fb; --accent: #254fc7; --border: #dce3ee; --muted: #52627a; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #7899ff; outline-offset: 3px; }
aside { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 248px; padding: 24px 16px; background: #fff; border-right: 1px solid var(--border); overflow: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: #17253a; font-size: 1.3rem; font-weight: 750; line-height: 1.2; text-decoration: none; padding: 0 8px; }
.mark { display: grid; place-items: center; width: 42px; height: 42px; background: #244bc1; color: #fff; border-radius: 12px; }
small { display: block; color: var(--muted); font-size: .8125rem; font-weight: 500; margin-top: 4px; }
nav { display: grid; gap: 5px; margin: 36px 0 20px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #39485e; text-decoration: none; font-size: .9375rem; font-weight: 600; }
nav a:hover, nav a[aria-current] { color: #1b43b4; background: #eaf0ff; }
.icon { font-size: 1.25rem; width: 22px; text-align: center; line-height: 1; }
.account { margin-top: auto; border-top: 1px solid var(--border); padding: 16px 8px 0; overflow-wrap: anywhere; }
.account form { margin-top: 12px; }
main { margin-left: 248px; padding: 42px clamp(20px, 4vw, 60px); max-width: 1680px; min-width: 0; }
.heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
h1,h2,p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 4vw, 2.55rem); letter-spacing: -.045em; line-height: 1.15; }
h2 { font-size: 1.14rem; letter-spacing: -.016em; margin-bottom: 15px; }
.heading p { margin-top: 8px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 165px),1fr)); gap: 14px; margin-bottom: 20px; }
.metric, .panel { background: #fff; border: 1px solid var(--border); border-radius: 13px; min-width: 0; }
.metric { display: grid; gap: 4px; padding: 17px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.metric:hover { border-color: #8098d5; }
.metric strong { font-size: 2rem; color: #17253a; letter-spacing: -.04em; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #eaf0ff; color: var(--accent); font-size: 1.25rem; }
.panel { padding: clamp(14px,2.3vw,24px); margin-bottom: 16px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 12px; align-items: start; }
.action-grid .fields { grid-template-columns: 1fr; }
summary { cursor: pointer; color: var(--accent); font-weight: 650; font-size: .9375rem; }
details[open] > summary { margin-bottom: 12px; }
details form + form, .panel p + label { margin-top: 12px; }
.table-wrap + details, .empty + details, dl + details { margin-top: 16px; }
.fields, .filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); gap: 12px; align-items: end; margin: 0 0 14px; }
.filters { display: flex; flex-wrap: wrap; }
.filters label { flex: 1 1 140px; max-width: 345px; min-width: 0; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .875rem; min-width: 0; }
input, textarea, select { font: inherit; font-size: 1rem; font-weight: 400; width: 100%; color: inherit; padding: 9px 10px; border: 1px solid #bac7da; border-radius: 7px; background-color: #fff; }
select { appearance: none; padding-right: 28px; background: linear-gradient(45deg,transparent 49%,#52627a 51%) right 15px center / 5px 5px no-repeat, linear-gradient(135deg,#52627a 49%,transparent 51%) right 10px center / 5px 5px no-repeat, #fff; }
textarea { resize: vertical; }
button,.button { display: inline-flex; font: inherit; font-weight: 650; font-size: .9rem; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; cursor: pointer; }
button:hover,.button:hover { background: #16389a; }
.secondary { color: var(--accent); background: #fff; border-color: #bac7da; }
.secondary:hover { background: #edf2ff; }
.error { background: #fff0ed; color: #95271c; padding: 10px; border-radius: 8px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th,td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { color: #43536a; background: #f5f7fc; font-size: .875rem; }
td { font-size: .9375rem; }
td details[open] { min-width: min(260px,65vw); }
td .fields { grid-template-columns: 1fr; }
.empty { color: var(--muted); background: #f7f9fd; padding: 18px; border-radius: 8px; }
.status { display: inline-block; color: #824508; background: #fff0da; padding: 1px 8px; border-radius: 20px; font-weight: 700; }
.positive { color: #186345; }
.negative { color: #943c26; }
.positive,.negative { font-weight: 700; }
.text-link,.back { display: inline-block; font-size: .9375rem; font-weight: 600; }
.panel > .text-link, .pagination { margin-top: 12px; }
.filters .text-link { padding: 8px 4px; }
.back { margin-bottom: 10px; }
.pagination { display: flex; flex-wrap: wrap; gap: 14px; }
dl { display: grid; gap: 12px; }
dt { color: var(--muted); font-size: .875rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.auth { margin: 0; max-width: none; min-height: 100vh; display: grid; place-items: center; }
.auth-card { width: min(100%,440px); background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: clamp(20px,5vw,38px); }
.auth-card .brand { padding: 0; margin-bottom: 30px; }
.auth-card h1 { font-size: 1.9rem; }
.auth-card form { display: grid; gap: 14px; }
.auth-card button { justify-content: center; }
.hint { color: var(--muted); font-size: .875rem; margin-top: 12px; }
.auth-card form .hint { margin-top: 0; }
@media (max-width: 820px) {
  aside { position: static; width: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  nav { display: flex; flex-wrap: wrap; margin: 12px 0; }
  nav a { padding: 6px 9px; }
  .account { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding-top: 9px; }
  .account form,.account small { margin: 0; }
  main { margin: 0; padding: 24px 16px; }
}

