:root{
  --bg:#0b1220;
  --panel:#0f1b33;
  --panel2:#0e1730;
  --text:#e9eefc;
  --muted:#a8b3d6;
  --line:rgba(255,255,255,.08);
  --brand:#6c7cff;
  --brand2:#3dd6a3;
  --shadow:0 12px 30px rgba(0,0,0,.25);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(1200px 500px at 10% 0%, rgba(108,124,255,.22), transparent 60%),
    radial-gradient(800px 400px at 90% 10%, rgba(61,214,163,.18), transparent 60%),
    var(--bg);
  color:var(--text);
}

/* utilities */
a{color:inherit;text-decoration:none}
.muted{color:var(--muted)}
.mini-muted{color:var(--muted);font-size:12px}
.h1{font-size:28px;margin:0 0 6px}
.h2{font-size:18px;margin:0}
.spacer{flex:1}

.app{min-height:100%}

/* topbar */
.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; gap:14px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background:rgba(11,18,32,.78);
  backdrop-filter: blur(12px);
}

.icon-btn{
  width:42px;height:42px;
  display:inline-grid;place-items:center;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
}
.icon-btn:active{transform:translateY(1px)}

.brand{display:flex;align-items:center;gap:10px}
.logo{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  font-weight:800;
  background:linear-gradient(135deg, rgba(108,124,255,.9), rgba(61,214,163,.7));
  box-shadow: var(--shadow);
}
.brand-title{font-weight:800;line-height:1}
.brand-sub{font-size:12px;color:var(--muted);margin-top:2px}

/* pills */
.pill{
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 14px;
  border-radius:999px;
  cursor:pointer;
  font-weight:600;
}
.pill:hover{background:rgba(255,255,255,.06)}
.pill:active{transform:translateY(1px)}
.pill.primary{
  background:rgba(108,124,255,.18);
  border-color:rgba(108,124,255,.45);
}
.pill.ghost{
  background:rgba(255,255,255,.02);
}
.lang-switch{
  display:flex;gap:8px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.02);
}
.lang-switch .pill{
  padding:8px 12px;
  border-radius:999px;
  border-color:transparent;
}
.lang-switch .pill.active{
  background:rgba(108,124,255,.22);
  border:1px solid rgba(108,124,255,.55);
}

/* layout */
.container{
  max-width:1200px;
  margin:18px auto;
  padding:0 16px 28px;
}

.card{
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}

.hero{
  padding:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap}
.icon{opacity:.9}

/* stats grid */
.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}
.stat{padding:16px}
.stat-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.stat-value{margin-top:10px;font-size:26px;font-weight:800}
.unit{font-size:14px;color:var(--muted);font-weight:700;margin-inline-start:6px}
.stat-foot{margin-top:10px;font-weight:800}
.up{color:var(--brand2)}
.badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 12px;border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  font-weight:800;
}
.badge.ok{border-color:rgba(61,214,163,.35);background:rgba(61,214,163,.09)}

/* table */
.table-card{margin-top:14px; padding:14px}
.table-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:6px 4px 12px;
}
.table-actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.input{
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius:999px;
  min-width:260px;
  outline:none;
}
.input::placeholder{color:rgba(168,179,214,.65)}
.table-wrap{overflow:auto;border-radius:14px;border:1px solid var(--line)}
.table{
  width:100%;
  border-collapse:collapse;
  min-width:780px;
}
.table th,.table td{
  padding:14px 12px;
  border-bottom:1px solid var(--line);
  text-align:start;
}
.table thead th{color:var(--muted);font-size:13px}
.table tbody tr:hover{background:rgba(255,255,255,.03)}
.chip{
  display:inline-flex;align-items:center;justify-content:center;
  padding:6px 12px;border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  font-weight:800;
  font-size:12px;
}
.chip.ok{border-color:rgba(61,214,163,.35);background:rgba(61,214,163,.09)}
.chip.warn{border-color:rgba(255,200,0,.25);background:rgba(255,200,0,.08)}
.footer{padding:12px 6px 0;text-align:center;color:var(--muted);font-size:12px}

/* sidebar */
.overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  z-index:40;
}
.sidebar{
  position:fixed;
  top:0; bottom:0;
  width:320px;
  z-index:50;
  background:rgba(15,27,51,.92);
  backdrop-filter: blur(14px);
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  transform:translateX(110%);
  transition:transform .2s ease;
  display:flex;
  flex-direction:column;
}

html[dir="rtl"] .sidebar {
  right: 0;
  left: auto;
  transform: translateX(110%);
}
html[dir="ltr"] .sidebar {
  left: 0;
  right: auto;
  transform: translateX(-110%);
}
html[dir="rtl"] .sidebar.open,
html[dir="ltr"] .sidebar.open {
  transform: translateX(0);
}

.sidebar-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px;
  border-bottom:1px solid var(--line);
}
.sidebar-title{font-weight:900;font-size:20px}
.side-nav{padding:12px;display:flex;flex-direction:column;gap:10px}
.side-link{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid transparent;
  background:rgba(255,255,255,.02);
}
.side-link:hover{background:rgba(255,255,255,.04)}
.side-link.active{
  border-color:rgba(108,124,255,.45);
  background:rgba(108,124,255,.14);
}
.sidebar-foot{
  margin-top:auto;
  padding:14px;
  border-top:1px solid var(--line);
  display:flex;justify-content:space-between;gap:10px;
}

/* responsive */
@media (max-width: 1100px){
  .grid{grid-template-columns:repeat(2, minmax(0, 1fr))}
}
@media (max-width: 640px){
  .hero{flex-direction:column;align-items:flex-start}
  .grid{grid-template-columns:1fr}
  .input{min-width: 220px}
}
