:root {
  color-scheme: light;
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #172838;
  background: #f2f5f7;
  --nav: #102737;
  --muted: #536779;
  --accent: #086b62;
  --line: #dce5eb;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin-top: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #e8a530; outline-offset: 3px; }
[hidden] { display: none !important; }

#login { width: min(440px, calc(100% - 32px)); margin: clamp(32px, 12vh, 120px) auto; padding: 36px; }
.login-brand { margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: #a8efe1; color: #10362f; font-size: 13px; letter-spacing: .05em; }
.brand-name { display: block; line-height: 1.25; }
.brand small { display: block; opacity: .75; font-weight: 500; }
#login label { display: block; margin: 14px 0 5px; font-weight: 600; }
#login input { width: 100%; }
#login .primary { width: 100%; margin-top: 20px; }
#loginError { font-size: .9rem; margin: 12px 0 0; }

#app { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--nav); color: #edf4f8; padding: 26px 16px; min-width: 0; }
.sidebar .brand { margin: 0 6px 34px; }
.nav-group { margin: 0 0 22px; }
.nav-group p { margin: 0 10px 7px; color: #abbecc; font-size: .73rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: #e1ebf2; text-align: left; padding: 10px 11px; border-radius: 8px; margin-bottom: 3px; }
.nav-link span { flex: 0 0 20px; font-size: 17px; text-align: center; }
.nav-link:hover { background: #214052; }
.nav-link[aria-current="page"] { background: #254957; color: #d7fff2; font-weight: 700; box-shadow: inset 3px 0 #69e0c4; }
.workspace { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; background: #fff; border-bottom: 1px solid var(--line); padding: 20px clamp(16px, 3vw, 44px); }
.topbar h1 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.75rem); letter-spacing: -.025em; }
.topbar-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#identity { color: var(--muted); overflow-wrap: anywhere; font-size: .82rem; }
.shift-control { display: flex; align-items: center; gap: 8px; font-weight: 650; }
#view { width: min(100%, 1450px); padding: clamp(16px, 3vw, 44px); margin: 0 auto; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 2.3vw, 30px); margin-bottom: 18px; box-shadow: 0 4px 15px #15394c09; }
.card h2 { font-size: clamp(1.18rem, 2vw, 1.45rem); letter-spacing: -.025em; margin-bottom: 8px; }
.muted { color: var(--muted); }
.err { color: #a32635; }
.notice { background: #eff8f6; border-left: 3px solid #0d8679; color: #294d4a; padding: 12px 14px; border-radius: 6px; }
input, select { min-height: 42px; padding: 8px 12px; color: #172838; background: #fff; border: 1px solid #aebfcc; border-radius: 8px; }
.primary, .alt, #export { min-height: 42px; border: 1px solid transparent; padding: 8px 13px; border-radius: 8px; font-weight: 650; }
.primary, #export { background: var(--accent); color: #fff; }
.primary:hover, #export:hover { background: #07574f; }
.alt { color: #243e52; background: #fff; border-color: #cbd8e1; }
.alt:hover { background: #eef4f7; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 12px; margin: 18px 0; }
.stat { padding: 16px; background: #edf8f5; border: 1px solid #d7ede6; border-radius: 11px; color: #315650; }
.stat strong { display: block; color: #08635b; font-size: 2rem; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 15px; }
table { width: 100%; min-width: 540px; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; }
th { font-size: .8rem; font-weight: 700; color: #334f64; background: #eaf0f4; white-space: nowrap; }
td { border-top: 1px solid var(--line); font-size: .92rem; }
tbody tr:nth-child(even) { background: #f7f9fa; }
tbody tr:hover { background: #edf7f4; }
.empty { padding: 16px; color: var(--muted); background: #f4f7f9; border-radius: 8px; }

@media (max-width: 850px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 14px 16px 8px; }
  .sidebar .brand { margin: 0 0 12px; }
  #nav { display: flex; overflow-x: auto; gap: 12px; }
  .nav-group { display: flex; flex: 0 0 auto; gap: 4px; margin: 0 0 8px; }
  .nav-group p { display: none; }
  .nav-link { width: auto; white-space: nowrap; }
}
@media (max-width: 460px) {
  #login { padding: 24px; }
  .topbar-controls { width: 100%; }
  .shift-control { flex-basis: 100%; }
}
