:root{
  --bg0:#060a13;
  --bg1:#0b1220;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.10);
  --stroke: rgba(255,255,255,0.12);
  --stroke2: rgba(255,255,255,0.18);
  --text:#eaf0ff;
  --muted: rgba(234,240,255,0.72);
  --muted2: rgba(234,240,255,0.55);
  --danger:#ff4d4d;
  --ok:#3df28e;
  --warn:#ffcc66;
  --brand:#7aa7ff;
  --brand2:#9bffea;
  --shadow: 0 16px 40px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 26px;
  --gap: 14px;
  --safeTop: env(safe-area-inset-top);
  --safeBottom: env(safe-area-inset-bottom);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(122,167,255,0.16), transparent 55%),
              radial-gradient(900px 600px at 90% 20%, rgba(155,255,234,0.10), transparent 50%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
}

a{color:inherit; text-decoration:none}
button, input, select, textarea {font: inherit}
.hidden{display:none !important;}
.muted{color: var(--muted2); font-size: 13px}

/* Splash */
.splash{
  position: fixed; inset: 0;
  display:flex; align-items:center; justify-content:center;
  padding: 24px;
}
.splash__card{
  width: min(520px, 92vw);
  border-radius: var(--radius2);
  background: var(--panel);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align:center;
}
.splash__logo{
  width: 76px; height: 76px;
  border-radius: 22px;
  margin: 0 auto 14px;
  display:flex; align-items:center; justify-content:center;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, rgba(122,167,255,0.85), rgba(155,255,234,0.55));
  color: #07101c;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.splash__title{font-size: 24px; font-weight: 800; margin-top: 6px}
.splash__subtitle{color: var(--muted); margin-top: 6px; font-size: 14px; line-height: 1.8}
.splash__hint{color: var(--muted2); margin-top: 12px; font-size: 13px}

/* Top bar */
.topbar{
  position: sticky; top: 0;
  z-index: 20;
  display:flex; align-items:center; justify-content:space-between;
  padding: calc(10px + var(--safeTop)) 12px 10px;
  gap: 10px;
  background: rgba(6,10,19,0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar__title{flex:1; text-align:center}
.topbar__titleMain{font-weight: 800; font-size: 15px}
.topbar__titleSub{color: var(--muted2); font-size: 12px; margin-top: 2px; min-height: 16px}

.icon-btn{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 14px;
  width: 44px; height: 40px;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.icon-btn:active{transform: translateY(1px) scale(.99)}
.icon{font-size: 18px}

/* Main */
.main{
  padding: 14px 14px calc(86px + var(--safeBottom));
  max-width: 1040px;
  margin: 0 auto;
}

/* Bottom bar */
.bottombar{
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(10px + var(--safeBottom));
  height: 64px;
  border-radius: 22px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.45);
  display:flex;
  padding: 8px;
  gap: 8px;
  z-index: 30;
}
.tab{
  flex:1;
  border-radius: 16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 4px;
  color: var(--muted);
  transition: 180ms ease;
}
.tab__icon{font-size: 18px}
.tab__label{font-size: 11px}
.tab.active{
  background: rgba(122,167,255,0.18);
  border: 1px solid rgba(122,167,255,0.25);
  color: var(--text);
}

/* Cards */
.card{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card + .card{margin-top: var(--gap)}

.h1{font-size: 18px; font-weight: 900; margin: 0 0 8px}
.h2{font-size: 15px; font-weight: 800; margin: 0 0 6px}
.p{margin: 0; color: var(--muted); line-height: 1.9}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 900px){
  .grid.cols2{grid-template-columns: 1fr 1fr}
  .grid.cols3{grid-template-columns: 1fr 1fr 1fr}
}

.btnRow{display:flex; gap: 10px; flex-wrap: wrap; margin-top: 10px}
.btn{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  transition: 160ms ease;
}
.btn.primary{
  background: linear-gradient(135deg, rgba(122,167,255,0.32), rgba(155,255,234,0.14));
  border: 1px solid rgba(122,167,255,0.30);
}
.btn.danger{
  background: rgba(255,77,77,0.12);
  border: 1px solid rgba(255,77,77,0.25);
  color: #ffe7e7;
}
.btn:active{transform: translateY(1px) scale(.995)}
.btn[disabled]{opacity: .45; cursor: not-allowed}

/* Form */
.form{
  display:grid; gap: 12px;
}
.field{
  display:grid; gap: 6px;
}
.label{
  font-size: 12px; color: var(--muted);
}
.input, .select, .textarea{
  width: 100%;
  background: rgba(0,0,0,0.24);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}
.textarea{min-height: 92px; resize: vertical}
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(122,167,255,0.45);
  box-shadow: 0 0 0 4px rgba(122,167,255,0.12);
}
.row2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px){ .row2{grid-template-columns: 1fr} }

.chips{
  display:flex; gap: 8px; flex-wrap: wrap;
}
.chip{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.chip.active{
  background: rgba(122,167,255,0.18);
  border-color: rgba(122,167,255,0.30);
  color: var(--text);
}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 16px;
}
.table th, .table td{
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: right;
  font-size: 13px;
}
.table th{color: var(--muted); font-weight: 700}
.table tr:last-child td{border-bottom:none}

/* Drawer */
.overlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 40;
}
.drawer{
  position: fixed;
  top: 0; bottom: 0;
  right: 0;
  width: min(340px, 88vw);
  background: rgba(8,12,22,0.85);
  border-left: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: -18px 0 46px rgba(0,0,0,0.55);
  z-index: 50;
  display:flex;
  flex-direction:column;
  transform: translateX(102%);
  transition: 220ms ease;
}
.drawer.show{
  transform: translateX(0);
}
.drawer__header{padding: calc(16px + var(--safeTop)) 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.08)}
.drawer__title{font-weight: 900; font-size: 16px}
.drawer__user{margin-top: 6px; color: var(--muted); font-size: 13px; line-height:1.7}
.drawer__content{padding: 10px 10px; display:flex; flex-direction:column; gap: 6px; overflow:auto}
.drawer__item{
  text-align:right;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  cursor:pointer;
}
.drawer__item:hover{background: rgba(255,255,255,0.06)}
.drawer__item.danger{border-color: rgba(255,77,77,0.22); background: rgba(255,77,77,0.08)}
.drawer__sep{height: 1px; background: rgba(255,255,255,0.08); margin: 6px 4px}
.drawer__footer{padding: 12px 16px calc(12px + var(--safeBottom)); border-top: 1px solid rgba(255,255,255,0.08)}

/* Modal */
.modalOverlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 60;
}
.modal{
  position: fixed;
  left: 12px; right: 12px;
  top: 12px;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(10,14,24,0.88);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0,0,0,0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 70;
  padding: 14px;
  transform: translateY(-14px);
  opacity: 0;
  transition: 200ms ease;
}
.modal.show{
  transform: translateY(0);
  opacity: 1;
}

/* Toast */
.toast{
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(84px + var(--safeBottom));
  max-width: 620px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 80;
  box-shadow: 0 18px 46px rgba(0,0,0,0.55);
  color: var(--text);
}

.badge{
  display:inline-flex; align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.badge.ok{border-color: rgba(61,242,142,0.30); background: rgba(61,242,142,0.12); color: #dcffee}
.badge.warn{border-color: rgba(255,204,102,0.30); background: rgba(255,204,102,0.10); color: #fff3d6}
.badge.danger{border-color: rgba(255,77,77,0.30); background: rgba(255,77,77,0.12); color: #ffe7e7}

/* List */
.list{
  display:grid;
  gap: 10px;
}
.item{
  display:flex;
  flex-direction:column;
  gap: 8px;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}
.item__top{display:flex; align-items:center; justify-content:space-between; gap: 10px}
.item__title{font-weight: 900}
.item__sub{color: var(--muted2); font-size: 12px; line-height:1.8}
.item__meta{display:flex; gap: 8px; flex-wrap:wrap}
hr.sep{border:0; height: 1px; background: rgba(255,255,255,0.08); margin: 10px 0}
