:root{
  --bg:#0b1220;
  --card:#0f1a2e;
  --card2:#0c1629;
  --text:#e8eefc;
  --muted:#9fb0d0;
  --border:rgba(255,255,255,.10);
  --primary:#5b8cff;
  --danger:#ff5b6a;
  --ok:#44d19d;
  --warn:#ffd35b;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --radius: 16px;
  --radius2: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 800px at 20% -10%, rgba(91,140,255,.22), transparent 60%),
              radial-gradient(1200px 800px at 90% 10%, rgba(68,209,157,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
code{background:rgba(255,255,255,.08); padding:.15rem .35rem; border-radius:8px}

.app-shell{min-height:100%;}

.topbar{
  position:sticky; top:0; z-index:5;
  display:flex; justify-content:space-between; gap:16px;
  padding:16px 18px;
  background: rgba(11,18,32,.65);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-left{display:flex; gap:12px; align-items:center}
.logo{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(91,140,255,.9), rgba(68,209,157,.75));
  color:#071022; font-weight:800;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
}
.logo.small{width:38px;height:38px;border-radius:12px}

.title{font-size:16px;font-weight:800}
.subtitle{font-size:12px;color:var(--muted)}

.topbar-right{display:flex; gap:10px; align-items:center}

.lang-switch{display:flex; gap:8px}
.chip{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.chip.active{border-color:rgba(91,140,255,.55); box-shadow: 0 0 0 4px rgba(91,140,255,.14) inset}

.container{
  width:min(1180px, 100%);
  margin:0 auto;
  padding:18px;
}

.kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
  margin-top:6px;
}
.kpi{
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:14px 14px;
  box-shadow: var(--shadow);
}
.kpi-label{color:var(--muted); font-size:12px; font-weight:700}
.kpi-value{font-size:22px; font-weight:900; margin-top:6px}

.toolbar{
  margin-top:14px;
  display:flex; gap:12px; align-items:center; justify-content:space-between;
}
.search{flex:1}
.search input{
  width:100%;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  border-radius: 14px;
  padding:12px 12px;
  color:var(--text);
  outline:none;
}
.search input:focus{border-color: rgba(91,140,255,.6); box-shadow: 0 0 0 4px rgba(91,140,255,.14)}

.filters{display:flex; gap:10px; align-items:center}
select{
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color:var(--text);
  border-radius: 14px;
  padding:10px 10px;
  outline:none;
}

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:800;
}
.btn-primary{
  background: linear-gradient(135deg, rgba(91,140,255,.95), rgba(91,140,255,.65));
  border-color: rgba(91,140,255,.55);
  color:#061024;
}
.btn-ghost{
  background: rgba(255,255,255,.05);
}
.btn:hover{filter:brightness(1.05)}
.btn:active{transform: translateY(1px)}

.table-card{
  margin-top:14px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.table-head{
  display:flex; justify-content:space-between; align-items:flex-end;
  padding:14px 14px;
  border-bottom:1px solid var(--border);
}
.table-title{font-size:14px;font-weight:900}
.table-note{font-size:12px;color:var(--muted)}
.table-wrap{overflow:auto}
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 920px;
}
th, td{
  padding:12px 12px;
  border-bottom:1px solid rgba(255,255,255,.07);
  vertical-align: top;
}
th{
  position:sticky; top:0;
  background: rgba(15,26,46,.85);
  backdrop-filter: blur(10px);
  font-size:12px;
  text-transform: uppercase;
  letter-spacing:.04em;
  color: var(--muted);
}
tr:hover td{background: rgba(255,255,255,.03)}
.muted{color:var(--muted)}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius: 999px;
  font-weight:900;
  font-size:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  white-space: nowrap;
}
.badge.ok{border-color: rgba(68,209,157,.5); background: rgba(68,209,157,.12)}
.badge.warn{border-color: rgba(255,211,91,.45); background: rgba(255,211,91,.10)}
.badge.danger{border-color: rgba(255,91,106,.5); background: rgba(255,91,106,.10)}
.badge.neutral{border-color: rgba(159,176,208,.35); background: rgba(159,176,208,.08)}

.actions{display:flex; gap:8px; flex-wrap:wrap}
.smallbtn{
  padding:8px 10px;
  border-radius: 12px;
  font-weight:900;
  font-size:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  cursor:pointer;
}
.smallbtn.primary{border-color: rgba(91,140,255,.6); background: rgba(91,140,255,.16)}
.smallbtn.good{border-color: rgba(68,209,157,.55); background: rgba(68,209,157,.14)}
.smallbtn.bad{border-color: rgba(255,91,106,.55); background: rgba(255,91,106,.14)}

.checkbox{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  color: var(--muted);
  font-size:12px;
}
.checkbox input{transform: scale(1.15)}

textarea{
  width:100%;
  min-height:88px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding:10px;
  color: var(--text);
  outline:none;
}

.modal{
  position:fixed; inset:0;
  display:none;
  z-index:20;
}
.modal.show{display:block}
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.58);
}
.modal-card{
  position:relative;
  width:min(920px, calc(100% - 22px));
  margin: 5vh auto;
  background: linear-gradient(180deg, rgba(15,26,46,.98), rgba(12,22,41,.98));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 14px;
  border-bottom:1px solid var(--border);
}
.modal-title{font-weight:900}
.icon-btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  width:38px; height:38px;
  border-radius: 14px;
  cursor:pointer;
}
.modal-body{padding:14px 14px}
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}
.card{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  border-radius: var(--radius2);
  padding:12px;
}
.card .label{font-size:12px;color:var(--muted);font-weight:800}
.card .value{margin-top:6px;font-weight:900}

.auth-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:18px;
}
.auth-card{
  width:min(460px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}
.brand{display:flex;gap:12px;align-items:center;margin-bottom:12px}
.brand-title{font-size:16px;font-weight:900}
.brand-sub{font-size:12px;color:var(--muted)}
.auth-form{display:flex;flex-direction:column;gap:10px}
label .label{display:block;color:var(--muted);font-size:12px;font-weight:800;margin-bottom:6px}
.auth-form input{
  width:100%;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  border-radius: 14px;
  padding:12px 12px;
  color:var(--text);
  outline:none;
}
.hint{margin-top:10px;color:var(--muted);font-size:12px}

.alert{
  border-radius: 14px;
  padding:10px 12px;
  border:1px solid var(--border);
  margin:10px 0;
  font-weight:800;
}
.alert-danger{
  border-color: rgba(255,91,106,.55);
  background: rgba(255,91,106,.10);
}

@media (max-width: 940px){
  .kpis{grid-template-columns: repeat(2, minmax(0,1fr));}
  .toolbar{flex-direction:column; align-items:stretch}
  .filters{justify-content:space-between}
}
