:root {
  --bg0: #070b16;
  --bg1: #12162a;
  --card: rgba(10, 14, 28, .72);
  --text: #ffffff;
  --muted: #c9d2e8;
  --label: #e8ecf5;
  --field: rgba(255,255,255,.08);
  --field-border: rgba(255,255,255,.14);
  --accent1: #6c4df2;
  --accent2: #33e1ff;
  --danger: #ff6b6b;
  --tab: rgba(255,255,255,.08);
  --focus: #33e1ff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
body.login-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(7,11,22,.55), rgba(7,11,22,.82)),
    url('/assets/img/bg_splash.jpg') center/cover no-repeat fixed;
  display: grid;
  place-items: center;
}
.login-wrap { width: min(420px, 92vw); padding: 24px 0; }
.login-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  padding: 28px 26px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-logo {
  width: min(220px, 70%);
  height: auto;
  display: block;
  margin: 0 auto 8px;
}
.login-title {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 800;
}
.login-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.tab {
  height: 42px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--tab);
  color: #dbe4f7;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}
.tab.is-active,
.tab:focus {
  outline: 2px solid var(--focus);
  border-color: transparent;
  background: linear-gradient(90deg, rgba(108,77,242,.35), rgba(51,225,255,.25));
  color: #fff;
}
.fields { margin-top: 14px; text-align: left; }
.fields label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--label);
  font-size: .85rem;
}
.fields input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--field-border);
  background: var(--field);
  color: #fff;
  padding: 0 14px;
  font-size: 1rem;
  outline: none;
}
.fields input:focus { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(51,225,255,.2); }
.pass-row { position: relative; }
.pass-row input { padding-right: 48px; }
.eye {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.btn-login {
  margin-top: 18px;
  width: 100%;
  height: 48px;
  border: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent1), #4f7cff 45%, var(--accent2));
}
.btn-login:focus { outline: 3px solid #fff; outline-offset: 2px; }
.btn-login:disabled { opacity: .6; cursor: wait; }
.progress { margin-top: 12px; color: #b8c4d9; }
.error { margin-top: 12px; color: var(--danger); font-weight: 600; }

/* App shell */
body.app-page {
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 10% -10%, #1b1238, transparent 55%),
              linear-gradient(180deg, #0a0d18, #12162a);
}
.app-shell { display: grid; grid-template-columns: 88px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.28);
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.side .brand {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  color: #9ec5ff;
  margin-bottom: 10px;
}
.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #d7e0f5;
  padding: 12px 6px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.nav-btn.is-active, .nav-btn:focus {
  outline: none;
  border-color: rgba(51,225,255,.55);
  background: linear-gradient(90deg, rgba(108,77,242,.28), rgba(51,225,255,.12));
}
.content { padding: 24px 28px; }
.hero-title { margin: 0; font-size: 1.6rem; font-weight: 800; }
.hero-sub { color: var(--muted); margin-top: 8px; }
.grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.tile {
  min-height: 110px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  padding: 16px;
  display: flex;
  align-items: flex-end;
  font-weight: 800;
}
.tile:focus, .tile:hover {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(51,225,255,.2);
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.meta { color: #9aa8c3; font-size: .9rem; }
.btn-out {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
}
