:root {
  color-scheme: dark;
  --bg: #17171b;
  --panel: #202024;
  --field: #29292e;
  --line: #494750;
  --text: #f9f8fc;
  --muted: #cbc8d3;
  --purple: #7c3aed;
  --accent-text: #ccb4ff;
  --focus: #c3a9ff;
  --error: #ffb9be;
  font: 16px/1.55 system-ui, "Segoe UI", sans-serif;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f0f5; --panel: #fff; --field: #f8f8fa; --line: #c8c5d1;
  --text: #161616; --muted: #575361; --accent-text: #6429d5; --focus: #6023ce; --error: #a11430;
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    color-scheme: light;
    --bg: #f1f0f5; --panel: #fff; --field: #f8f8fa; --line: #c8c5d1;
    --text: #161616; --muted: #575361; --accent-text: #6429d5; --focus: #6023ce; --error: #a11430;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent-text); }
h1, h2, p { margin: 0 0 .65rem; }
h1, h2 { line-height: 1.18; }
h2 { font-size: 1.25rem; }
img { object-fit: contain; flex: none; }
button, input, select { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: .5rem; }
button { padding: .46rem .86rem; background: var(--panel); cursor: pointer; }
button:hover { border-color: var(--focus); }
input:not([type="hidden"]), select { background: var(--field); padding: .58rem .7rem; width: 100%; min-width: 0; }
label { display: grid; gap: .3rem; min-width: 0; font-weight: 580; font-size: .9rem; }
:is(button, input, select, a, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.muted { color: var(--muted); }
.error { color: var(--error); border: 1px solid currentColor; border-radius: .5rem; padding: .6rem .85rem; }
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 1120px; display: grid; grid-template-columns: 47% 53%; overflow: hidden;
  border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 18px 60px #110b1b3b;
}
.brand-panel {
  color: #fff; background: radial-gradient(ellipse at 15% 105%, #392064 0, #211732 36%, #17151f 69%);
  display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 450px;
  padding: clamp(28px, 5vw, 65px);
}
.brand-product { display: flex; align-items: center; gap: 17px; margin-bottom: 36px; }
.brand-product h1 { font-size: clamp(32px, 4vw, 45px); font-weight: 750; letter-spacing: -.045em; margin: 0; }
.brand-product h1 span { color: #c3a4ff; }
.brand-product small { display: block; font-size: 11px; color: #d2c8dd; }
.brand-panel h2 { font-size: clamp(22px, 2.8vw, 30px); }
.brand-panel p { max-width: 35ch; color: #dcd4e5; }
.login-functional { background: var(--panel); display: grid; place-items: center; padding: clamp(28px, 5vw, 54px); }
.login-form { display: grid; width: 100%; max-width: 520px; gap: 16px; }
.login-form h2 { font-size: 1.7rem; margin: 0; }
.login-form > p:not(.error) { color: var(--muted); }
.primary { min-height: 46px; background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 700; }
.primary:hover { background: #6930d1; }
.brand-strip {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 82px;
  padding: 16px clamp(22px, 4vw, 48px); background: #16171c; color: #c4c4cc;
}
.umbrella { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.slogan { border-left: 1px solid #565660; padding-left: 16px; }
.developer { margin-left: auto; letter-spacing: .12em; font-size: .75rem; }
.skip { position: absolute; left: -999px; padding: .5rem 1rem; background: var(--panel); }
.skip:focus { left: 8px; top: 8px; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--panel); padding: 14px 26px; border-bottom: 1px solid var(--line); }
.brand-link { display: flex; align-items: center; color: var(--text); font-weight: 750; text-decoration: none; font-size: 1.25rem; }
.brand-link img { margin-right: 9px; }
.brand-link span { color: var(--accent-text); }
.session { display: flex; align-items: center; gap: 12px; }
.session small { overflow-wrap: anywhere; }
.workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100dvh - 67px); }
nav { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 10px; }
nav a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; color: var(--text); text-decoration: none; border-radius: 8px; }
nav a small, nav .planned { color: var(--muted); }
nav [aria-current="page"] { background: var(--field); color: var(--accent-text); font-weight: 650; }
.workspace main { padding: clamp(16px, 3vw, 40px); max-width: 1420px; width: 100%; }
.workspace h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
.panel, .metric { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); gap: 12px; }
.metric span { display: block; color: var(--muted); font-size: .87rem; }
.metric strong { font-size: 1.25rem; }
.table-wrap { overflow: auto; margin-bottom: 12px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .85rem; }
th, td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { color: var(--muted); }
details { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
summary { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); align-items: end; gap: 12px; margin: 12px 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; }
  .brand-panel { min-height: 0; }
  .brand-product { margin-bottom: 20px; }
  .brand-product img { width: 58px; height: 58px; }
  .workspace { grid-template-columns: 1fr; }
  nav { display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .login-shell { padding: 12px; }
  .brand-strip { gap: 10px; }
  .developer { width: 100%; margin: 0; }
  .topbar { padding: 10px 14px; }
  .session { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
}
