:root {
  --bg: #07100e;
  --surface: #0d1916;
  --surface-2: #13221e;
  --text: #eef8f4;
  --muted: #91a9a1;
  --line: rgba(255,255,255,.09);
  --brand: #5b7cff;
  --accent: #31d7a9;
  --danger: #ff6b7b;
  --ok: #31d7a9;
  --shadow: 0 24px 80px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(49,215,169,.12), transparent 32rem),
    radial-gradient(circle at 100% 30%, rgba(91,124,255,.1), transparent 28rem),
    var(--bg);
  font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }
.shell { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 100vh; }
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  background: rgba(7,16,14,.8);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
}
.brand { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; }
.brand strong { font-size: 28px; letter-spacing: -.055em; }
.brand span { margin-top: 8px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
nav { display: grid; gap: 7px; margin-top: 44px; }
nav a {
  padding: 12px 14px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: .18s ease;
}
nav a:hover, nav a.active { color: var(--text); background: rgba(255,255,255,.055); border-color: var(--line); }
.aside-footer { margin-top: auto; color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 14px var(--ok); }
main { min-width: 0; padding: 30px clamp(20px,4vw,52px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(27px,3vw,38px); line-height: 1.12; letter-spacing: -.04em; }
h2 { margin: 0 0 10px; font-size: 21px; letter-spacing: -.025em; }
.account { display: flex; align-items: center; gap: 18px; }
.account > div { display: grid; text-align: right; }
.account span { color: var(--muted); font-size: 12px; }
.account > a { color: var(--muted); text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.card {
  padding: 22px;
  margin-bottom: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0,0,0,.12);
}
.stat { margin-top: 8px; font-size: 36px; font-weight: 800; letter-spacing: -.04em; }
.muted { color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.025); border-radius: 14px; overflow: hidden; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
label { display: grid; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 13px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(5,13,11,.72);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49,215,169,.1); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  color: var(--text);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
  border-radius: 11px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary, button.btn { color: #03100c; background: var(--accent); border-color: transparent; }
.notice { padding: 11px 13px; margin: 14px 0; border-radius: 10px; }
.notice.error { color: #ffdbe0; background: rgba(255,107,123,.12); border: 1px solid rgba(255,107,123,.25); }
.ok { color: var(--ok); }
.bad { color: var(--danger); }

.auth-page { overflow-x: hidden; }
.auth-shell { display: grid; grid-template-columns: minmax(360px,1.08fr) minmax(420px,.92fr); min-height: 100vh; padding: 0; }
.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(32px,6vw,84px);
  background:
    linear-gradient(145deg, rgba(49,215,169,.14), transparent 55%),
    radial-gradient(circle at 30% 70%, rgba(91,124,255,.18), transparent 32rem);
  border-right: 1px solid var(--line);
}
.auth-story h1 { max-width: 720px; font-size: clamp(48px,6vw,88px); line-height: .96; }
.auth-story > div > p:last-child { max-width: 530px; margin-top: 25px; color: var(--muted); font-size: 18px; }
.auth-story small { color: var(--muted); }
.auth-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(430px,100%); padding: 34px; background: rgba(13,25,22,.82); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-card h2 { font-size: 31px; }
.login-card .btn { width: 100%; margin-top: 5px; padding: 13px; }
.security-note { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 42vh; padding: 38px 28px; }
  .auth-story h1 { font-size: clamp(42px,11vw,70px); }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: relative; height: auto; padding: 18px; }
  nav { display: flex; gap: 6px; margin-top: 20px; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .aside-footer { display: none; }
  main { padding: 22px 16px 46px; }
  .topbar { align-items: flex-start; }
  .account > div { display: none; }
  .grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  .auth-story { min-height: 34vh; }
  .auth-story small, .auth-story > div > p:last-child { display: none; }
  .auth-panel { padding: 22px 16px 40px; }
  .login-card { padding: 26px 20px; }
}
