
:root{
  --bg:#0b1020;
  --bg-elev:#121931;
  --bg-soft:#171f3d;
  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.12);
  --text:#eef3ff;
  --muted:#9ca7c7;
  --accent:#6d7cff;
  --accent-2:#35c6ff;
  --danger:#ff6b7d;
  --success:#44d39b;
  --warning:#ffb84d;
  --shadow:0 20px 60px rgba(0,0,0,.35);
  --radius-xl:28px;
  --radius-lg:20px;
  --radius-md:16px;
  --radius-sm:12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:500 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(109,124,255,.22), transparent 60%),
    radial-gradient(1000px 500px at 100% 10%, rgba(53,198,255,.18), transparent 55%),
    linear-gradient(180deg, #0a0f1d 0%, #0b1020 100%);
}
body.telegram{
  background:var(--tg-theme-bg-color, #0b1020);
  color:var(--tg-theme-text-color, var(--text));
}
a{color:inherit;text-decoration:none}
button,input,textarea,select{font:inherit}
button{
  border:none;
  outline:none;
  background:none;
  color:inherit;
}
.shell{
  min-height:100%;
  padding:calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 90px);
  max-width:860px;
  margin:0 auto;
}
.loading-card{
  min-height:60vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
}
.spinner{
  width:44px;height:44px;border-radius:50%;
  border:4px solid rgba(255,255,255,.1);
  border-top-color:var(--accent);
  animation:spin .85s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.topbar{
  display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px;
}
.brand{display:flex;flex-direction:column;gap:6px}
.eyebrow{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.14em}
.title{font-size:28px;line-height:1.05;font-weight:800;letter-spacing:-.03em}
.subtitle{color:var(--muted);font-size:14px}
.owner-switch{
  min-width:110px;
  padding:12px 14px;
  border-radius:18px;
  background:rgba(255,255,255,.05);
  border:1px solid var(--line);
  color:var(--text);
}
.hero{
  display:grid;grid-template-columns:1.35fr .95fr;gap:14px;margin-bottom:14px;
}
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow);
  backdrop-filter: blur(12px);
}
.card-inner{padding:18px}
.hero-main{
  position:relative;overflow:hidden;
}
.hero-main::after{
  content:"";position:absolute;inset:auto -60px -60px auto;width:220px;height:220px;
  background:radial-gradient(circle, rgba(109,124,255,.34) 0%, rgba(109,124,255,0) 70%);
}
.stat-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
.stat{
  background:rgba(255,255,255,.045);
  border:1px solid var(--line);
  border-radius:18px;padding:14px;
}
.stat-label{font-size:12px;color:var(--muted);margin-bottom:8px}
.stat-value{font-size:28px;font-weight:800;letter-spacing:-.03em}
.badges{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.badge{
  padding:8px 12px;border-radius:999px;
  background:rgba(109,124,255,.14);color:#dce1ff;
  border:1px solid rgba(109,124,255,.28);
  font-size:13px;
}
.tabs{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px;
  margin:14px 0 18px;
}
.tab{
  padding:14px 10px;
  border-radius:18px;
  background:rgba(255,255,255,.04);
  border:1px solid var(--line);
  color:var(--muted);
  text-align:center;
  font-weight:700;
}
.tab.active{
  color:var(--text);
  background:linear-gradient(180deg, rgba(109,124,255,.18), rgba(53,198,255,.12));
  border-color:rgba(109,124,255,.35);
}
.panel{
  display:flex;flex-direction:column;gap:14px;
}
.section-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;
}
.section-title{font-size:20px;font-weight:800;letter-spacing:-.02em}
.section-desc{color:var(--muted);font-size:13px}
.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}
.stack{display:flex;flex-direction:column;gap:12px}
.list{display:flex;flex-direction:column;gap:10px}
.item{
  padding:14px;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid var(--line);
}
.item-row{
  display:flex;align-items:flex-start;justify-content:space-between;gap:10px;
}
.item-title{font-size:15px;font-weight:700}
.item-sub{font-size:13px;color:var(--muted);margin-top:4px;white-space:pre-wrap}
.item-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:0 16px;border-radius:14px;
  background:rgba(255,255,255,.06);border:1px solid var(--line);
  color:var(--text);font-weight:700;cursor:pointer;
}
.btn.primary{
  background:linear-gradient(180deg, var(--accent), #5667ff);
  border-color:transparent;
}
.btn.secondary{
  background:linear-gradient(180deg, rgba(53,198,255,.22), rgba(53,198,255,.12));
  border-color:rgba(53,198,255,.25);
}
.btn.ghost{
  background:rgba(255,255,255,.03);
}
.btn.danger{
  background:rgba(255,107,125,.12);
  border-color:rgba(255,107,125,.22);
  color:#ffd9df;
}
.btn.small{min-height:38px;padding:0 12px;font-size:13px}
.input, .textarea, .select{
  width:100%;
  border-radius:16px;
  border:1px solid var(--line-strong);
  background:rgba(10,14,28,.55);
  color:var(--text);
  padding:14px 15px;
  outline:none;
}
.textarea{min-height:120px;resize:vertical}
.label{font-size:13px;color:var(--muted);margin-bottom:8px}
.field{display:flex;flex-direction:column;gap:8px}
.kpi{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.04);
}
.kpi-value{font-size:26px;font-weight:800}
.modal-backdrop{
  position:fixed;inset:0;background:rgba(0,0,0,.58);display:none;align-items:flex-end;z-index:50;
}
.modal-backdrop.open{display:flex}
.modal{
  width:100%;
  max-width:860px;
  margin:0 auto;
  border-radius:28px 28px 0 0;
  border:1px solid var(--line);
  background:linear-gradient(180deg, #11182f, #0c1120);
  box-shadow:var(--shadow);
  max-height:88vh;overflow:auto;
  padding:18px 16px calc(var(--safe-bottom) + 20px);
}
.modal-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;
}
.toast-wrap{
  position:fixed;left:16px;right:16px;bottom:calc(var(--safe-bottom) + 18px);display:flex;justify-content:center;z-index:70;pointer-events:none;
}
.toast{
  pointer-events:auto;
  padding:12px 16px;border-radius:16px;background:#11172d;border:1px solid var(--line);box-shadow:var(--shadow);
}
.empty{
  padding:30px 18px;text-align:center;color:var(--muted);
  border:1px dashed var(--line);border-radius:18px;background:rgba(255,255,255,.02);
}
.calendar{
  display:grid;gap:10px;
}
.calendar-day{
  padding:14px;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid var(--line)
}
.calendar-date{font-size:13px;color:var(--muted);margin-bottom:8px}
.calendar-title{font-weight:700}
.bottom-nav{
  position:fixed;left:12px;right:12px;bottom:calc(var(--safe-bottom) + 10px);max-width:836px;margin:0 auto;
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;
  padding:8px;border-radius:22px;background:rgba(8,12,24,.86);border:1px solid var(--line);backdrop-filter:blur(14px);box-shadow:var(--shadow);
}
.nav-btn{
  min-height:54px;border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:4px;color:var(--muted);font-size:11px;font-weight:700;
}
.nav-btn.active{
  color:var(--text);
  background:linear-gradient(180deg, rgba(109,124,255,.22), rgba(109,124,255,.1));
}
.switch{
  display:flex;align-items:center;gap:10px;
}
.switch input{accent-color:var(--accent)}
.note{
  font-size:12px;color:var(--muted);
}
hr.sep{
  border:none;height:1px;background:var(--line);margin:6px 0;
}
@media (max-width:760px){
  .hero, .grid-2, .grid-3, .tabs{grid-template-columns:1fr}
  .title{font-size:24px}
}
