:root {
  --bg: #f5f7fb;
  --panel: rgba(255,255,255,.92);
  --panel-strong: #ffffff;
  --text: #172033;
  --muted: #6d778a;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #11a7a2;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --violet: #7c3aed;
  --shadow: 0 18px 50px rgba(23,32,51,.10);
  --radius: 24px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% 0%, #dff7ff 0, transparent 32%), radial-gradient(circle at 85% 10%, #e9e2ff 0, transparent 28%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; padding: 32px; align-items: center; }
.hero { min-height: calc(100vh - 64px); border-radius: 38px; padding: 42px; background: linear-gradient(140deg, #103d7a, #0a766f 58%, #0e9f6e); color: white; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.hero:before { content: ""; position: absolute; inset: auto -120px -160px auto; width: 420px; height: 420px; background: rgba(255,255,255,.13); border-radius: 50%; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--brand-2)); color: white; font-weight: 900; box-shadow: 0 10px 28px rgba(37,99,235,.30); }
.hero .brand-mark { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: rgba(255,255,255,.75); }
.hero h1 { font-size: clamp(36px, 5vw, 70px); line-height: .95; margin: 80px 0 20px; max-width: 760px; letter-spacing: -.06em; }
.hero p { font-size: 19px; line-height: 1.65; max-width: 680px; color: rgba(255,255,255,.84); }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; max-width: 640px; }
.hero-grid span { padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.card { background: var(--panel); border: 1px solid rgba(226,232,240,.9); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.card h2, .card h3 { margin: 0; letter-spacing: -.02em; }
.card p.sub { margin: 6px 0 0; color: var(--muted); }
.auth-card { max-width: 560px; width: 100%; justify-self: center; }
.tabs { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; margin-bottom: 18px; }
.tab { flex: 1; border: 0; border-radius: 14px; padding: 12px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.tab.active { color: white; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 28px rgba(37,99,235,.20); }
.form-grid { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; position: relative; }
.field label { font-size: 13px; color: #475569; font-weight: 800; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: white; color: var(--text); border-radius: 16px; padding: 13px 15px; outline: none; transition: .15s ease; }
.textarea { min-height: 98px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(37,99,235,.45); box-shadow: 0 0 0 4px rgba(37,99,235,.10); }
.btn { border: 0; border-radius: 16px; padding: 13px 17px; cursor: pointer; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; box-shadow: 0 12px 28px rgba(37,99,235,.18); }
.btn.secondary { background: #eef4ff; color: #1e40af; box-shadow: none; }
.btn.ghost { background: white; border: 1px solid var(--line); color: var(--text); box-shadow: none; }
.btn.danger { background: #fee2e2; color: var(--danger); box-shadow: none; }
.btn.success { background: #dcfce7; color: var(--success); box-shadow: none; }
.btn.small { padding: 8px 11px; border-radius: 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: wait; }
.alert { padding: 12px 14px; border-radius: 14px; font-weight: 700; display: none; white-space: pre-line; }
.alert.show { display: block; }
.alert.error { background: #fef2f2; color: #991b1b; }
.alert.success { background: #ecfdf5; color: #065f46; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 292px 1fr; }
.sidebar { padding: 24px; background: rgba(255,255,255,.78); border-right: 1px solid rgba(226,232,240,.8); backdrop-filter: blur(18px); position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar .brand small { color: var(--muted); }
.nav { display: grid; gap: 8px; margin: 28px 0; }
.nav button { width: 100%; text-align: left; justify-content: flex-start; box-shadow: none; background: transparent; color: var(--muted); }
.nav button.active { background: #edf5ff; color: #1d4ed8; }
.userbox { padding: 14px; border-radius: 18px; background: #f8fafc; border: 1px solid var(--line); color: var(--muted); }
.userbox strong { color: var(--text); display: block; margin-bottom: 4px; }
.main { padding: 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 22px; }
.topbar h1 { margin: 0; letter-spacing: -.04em; font-size: clamp(26px, 4vw, 42px); }
.topbar p { margin: 5px 0 0; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack { display: grid; gap: 18px; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; align-items: start; }
.content-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric { padding: 18px; border-radius: 22px; background: white; border: 1px solid var(--line); }
.metric span { color: var(--muted); font-size: 13px; font-weight: 800; }
.metric strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -.04em; }
.metric small { color: var(--muted); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 900; background: #eef2ff; color: #3730a3; }
.badge.green { background: #dcfce7; color: #166534; }
.badge.orange { background: #ffedd5; color: #9a3412; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.blue { background: #dbeafe; color: #1e40af; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; }
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 32px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv span { color: var(--muted); }
.chart { width: 100%; min-height: 250px; }
.suggest-box { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; display: none; }
.suggest-box.show { display: block; }
.suggest-item { padding: 11px 13px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.suggest-item:hover { background: #f8fafc; }
.suggest-item strong { display: block; }
.suggest-item small { color: var(--muted); }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 520px; z-index: 100; display: grid; gap: 10px; }
.toast-item { padding: 14px 16px; border-radius: 16px; box-shadow: var(--shadow); background: #111827; color: white; animation: pop .2s ease; }
.toast-item.error { background: #991b1b; }
.toast-item.success { background: #065f46; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.loader { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.loader:before { content: ""; width: 42px; height: 42px; border-radius: 50%; border: 4px solid #dbeafe; border-top-color: var(--brand); animation: spin 1s linear infinite; margin-right: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { color: var(--muted); line-height: 1.55; }
.inline-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sep { height: 1px; background: var(--line); margin: 8px 0; }
.mobile-footer { display: none; }
@media (max-width: 1050px) {
  .auth-layout { grid-template-columns: 1fr; padding: 18px; }
  .hero { min-height: auto; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metrics, .content-grid, .content-grid.three, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main { padding: 16px; }
  .hero { padding: 24px; border-radius: 26px; }
  .hero h1 { margin-top: 36px; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { display: block; }
  .metrics { grid-template-columns: 1fr; }
  .nav { grid-template-columns: 1fr; }
}
