:root{
  --bg0:#050913;
  --bg1:#060B16;
  --card:#0B1220;
  --card2:#0A1020;
  --stroke: rgba(255,255,255,.06);
  --stroke2: rgba(255,255,255,.09);
  --text:#EAF0FF;
  --muted: rgba(234,240,255,.60);

  --green:#20E3B2;
  --blue:#3B82F6;
  --purple:#A855F7;
  --amber:#F59E0B;
  --red:#EF4444;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 700px at 20% -10%, rgba(32,227,178,.12), transparent 60%),
              radial-gradient(900px 600px at 70% 10%, rgba(59,130,246,.10), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
}

.app-bg{
  position:fixed; inset:0; pointer-events:none;
  background:
    radial-gradient(700px 500px at 15% 25%, rgba(32,227,178,.08), transparent 60%),
    radial-gradient(700px 500px at 85% 20%, rgba(168,85,247,.08), transparent 60%);
  filter: blur(0px);
}

.shell{
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 22px 60px;
}

/* Toast */
.toast{
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 24px));
  border-radius: 14px;
  padding: 14px;
  display:flex;
  align-items:flex-start;
  gap: 12px;
  border: 1px solid rgba(59,130,246,.28);
  background: rgba(11,18,32,0.95);
  backdrop-filter: blur(8px);
  color: #fff;
  box-shadow: 0 22px 70px rgba(0,0,0,.55);
  z-index: 1000;
  transition: all 0.3s ease;
}
.toast.hidden{ display:none; }

.toast--critical { border-color: rgba(239,68,68,.6); background: rgba(239,68,68,.95); }
.toast--warning { border-color: rgba(245,158,11,.6); background: rgba(245,158,11,.95); }
.toast--info { border-color: rgba(59,130,246,.6); background: rgba(59,130,246,.95); }

.toast__icon{
  width: 34px; height: 34px;
  border-radius: 12px;
  display:grid; place-items:center;
  background: rgba(0,0,0,.18);
}
.toast__icon svg{ width:18px; height:18px; }
.toast__title{
  font-weight: 900;
  display:flex;
  align-items:center;
  gap: 10px;
}
.toast__title svg{ width:18px; height:18px; }
.toast__text{ margin-top: 2px; font-weight: 600; opacity:.92; }
.toast__close{
  margin-left:auto;
  border:0;
  background: transparent;
  color:#fff;
  cursor:pointer;
  padding: 6px;
  border-radius: 10px;
}
.toast__close:hover{ background: rgba(0,0,0,.14); }
.toast__close svg{ width:18px; height:18px; }

.title{
  margin:0;
  font-size: 34px;
  letter-spacing:-.02em;
  font-weight: 800;
}
.title__accent{ color: var(--green); }

.subtitle{
  margin-top:6px;
  color: rgba(234,240,255,.45);
  font-size: 13px;
}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom: 18px;
}

.topbar__right{
  display:flex;
  gap:10px;
  padding-top: 6px;
}

.iconbtn{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(11,18,32,.55);
  color: rgba(234,240,255,.9);
  display:grid;
  place-items:center;
  position:relative;
  cursor:pointer;
  box-shadow: 0 8px 25px rgba(0,0,0,.35);
}
.iconbtn:hover{ border-color: var(--stroke2); background: rgba(11,18,32,.72); }
.iconbtn svg{ width:18px; height:18px; opacity:.9; }

.badge{
  position:absolute;
  top:-6px; right:-6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(239,68,68,.95);
  color:#fff;
  font-size: 11px;
  font-weight: 700;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,255,255,.12);
}

.card{
  background: linear-gradient(180deg, rgba(11,18,32,.78), rgba(9,14,26,.70));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: 0 14px 45px rgba(0,0,0,.42);
  position:relative;
  overflow:hidden;
}
.card::before{
  content:"";
  position:absolute; inset:-1px;
  background: radial-gradient(450px 220px at 15% 0%, rgba(255,255,255,.06), transparent 60%);
  pointer-events:none;
}

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.kpi{ padding: 18px 18px 16px; }
.kpi__head{ display:flex; justify-content:space-between; align-items:center; }
.kpi__label{ color: rgba(234,240,255,.55); font-size: 13px; }
.kpi__value{ margin-top: 12px; font-size: 30px; font-weight: 800; letter-spacing:-.02em; }
.kpi__unit{ font-size: 18px; font-weight: 800; opacity:.95; }
.kpi__delta{
  margin-top: 10px;
  font-size: 13px;
  display:flex; gap:8px; align-items:center;
}
.kpi__delta--up{ color: rgba(32,227,178,.95); }
.kpi__delta--down{ color: rgba(239,68,68,.95); }

.kpi__icon{
  width: 42px; height: 42px;
  border-radius: 14px;
  display:grid; place-items:center;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.03);
}
.kpi__icon svg{ width:18px; height:18px; }
.kpi__icon--green{ color: var(--green); }
.kpi__icon--blue{ color: var(--blue); }
.kpi__icon--purple{ color: var(--purple); }
.kpi__icon--amber{ color: var(--amber); }

.main-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}
.card__title{ font-weight: 800; font-size: 18px; }
.card__subtitle{ margin-top:4px; color: rgba(234,240,255,.50); font-size: 13px; }

.legend-dot{
  color: rgba(234,240,255,.55);
  font-size: 13px;
  display:flex; gap:10px; align-items:center;
  padding-top: 4px;
}
.dot{ width:10px; height:10px; border-radius:999px; display:inline-block; }
.dot--green{ background: var(--green); }
.dot--red{ background: var(--red); }
.dot--amber{ background: var(--amber); }

.chart{ padding: 0 10px 12px; height: 290px; }

.api-card .api-list{ padding: 4px 18px 8px; display:flex; flex-direction:column; gap: 14px; }
.api-item__row{ display:flex; justify-content:space-between; align-items:center; gap: 10px; }
.api-item__name{ display:flex; align-items:center; gap: 10px; font-weight: 600; }
.api-item__meta{ color: rgba(234,240,255,.45); font-size: 12px; }

.spark{ width:10px; height:10px; border-radius:999px; background: rgba(234,240,255,.25); display:inline-block; }
.spark--green{ background: var(--green); }
.spark--red{ background: var(--red); }
.spark--amber{ background: var(--amber); }

.progress{
  width:100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  overflow:hidden;
}
.progress__bar{
  height:100%;
  border-radius: 999px;
  background: rgba(234,240,255,.25);
}
.progress__bar--green{ background: rgba(32,227,178,.95); }
.progress__bar--amber{ background: rgba(245,158,11,.95); }
.progress__bar--red{ background: rgba(239,68,68,.95); }

.api-total{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 18px 18px;
  color: rgba(234,240,255,.55);
  border-top: 1px solid rgba(255,255,255,.06);
}
.api-total strong{ color: rgba(234,240,255,.95); font-size: 14px; }

.bottom-grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.span-2{ grid-column: span 2; }

.list-card .rows{ padding: 6px 18px 18px; display:flex; flex-direction:column; gap: 12px; }
.row{ display:flex; justify-content:space-between; align-items:center; gap: 12px; padding: 10px 0; }
.row + .row{ border-top: 1px solid rgba(255,255,255,.04); }
.row__left{ display:flex; gap: 12px; align-items:center; }
.rank{ color: rgba(32,227,178,.95); font-weight: 800; width: 34px; }
.row__title{ font-weight: 700; }
.row__sub{ margin-top:2px; color: rgba(234,240,255,.45); font-size: 12px; }
.row__right{ text-align:right; }
.money{ font-weight: 800; }
.delta{ margin-top:3px; font-size: 12px; font-weight: 700; }
.delta--up{ color: rgba(32,227,178,.95); }
.delta--down{ color: rgba(239,68,68,.95); }

.section-label{
  padding: 8px 18px 6px;
  display:flex; align-items:center; gap:10px;
  color: rgba(234,240,255,.55);
  font-size: 13px;
}
.section-label--danger{ margin-top: 2px; }
.section-label--warn{ margin-top: 12px; }

.stack{ padding: 0 18px; display:flex; flex-direction:column; gap: 10px; }

.pill{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.02);
  padding: 12px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
}
.pill__title{ font-weight: 700; }
.pill__sub{ margin-top:3px; font-size: 12px; color: rgba(234,240,255,.45); }
.pill__meta{ display:flex; align-items:center; gap: 8px; color: rgba(234,240,255,.55); }
.pill__age{ font-weight: 700; font-size: 12px; }
.pill__qty{ color: rgba(245,158,11,.95); font-weight: 800; }

.pill--danger{
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.18);
}
.pill--warn{
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.18);
}
.warn svg{ width:16px; height:16px; color: rgba(239,68,68,.95); }

.mini-icon{
  width: 40px; height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  display:grid; place-items:center;
  color: rgba(234,240,255,.85);
}
.mini-icon--green{ color: var(--green); }
.mini-icon--amber{ color: var(--amber); }
.mini-icon svg{ width:18px; height:18px; }

.mini-badge{
  display:flex; align-items:center; gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: rgba(234,240,255,.85);
  font-weight: 800;
}
.mini-badge svg{ width:16px; height:16px; }
.mini-badge.danger{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.22);
  color: rgba(239,68,68,.95);
}

.divider{
  margin: 14px 18px;
  height: 1px;
  background: rgba(255,255,255,.06);
}

.success-block{ padding: 0 18px 18px; }
.success-title{ color: rgba(234,240,255,.55); font-size: 13px; margin-bottom: 10px; }
.success-item{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
  padding: 8px 0;
  color: rgba(234,240,255,.85);
}
.ok svg{ width:18px; height:18px; color: rgba(32,227,178,.95); }
.muted{ color: rgba(234,240,255,.45); font-size: 12px; }

.orders{ padding: 6px 18px 18px; display:flex; flex-direction:column; gap: 12px; }
.order{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  padding: 14px;
  display:grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 14px;
  align-items:center;
}
.order__id{ font-weight: 800; }
.order__name{ margin-top:4px; color: rgba(234,240,255,.65); }
.order__sub{ margin-top:6px; color: rgba(234,240,255,.40); font-size: 12px; }

.chip{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: rgba(234,240,255,.80);
  font-weight: 600;
  width: fit-content;
}
.chip svg{ width:16px; height:16px; opacity:.9; }

.chip--ship svg{ color: rgba(245,158,11,.95); }
.chip--transport svg{ color: rgba(32,227,178,.95); }
.chip--time svg{ color: rgba(59,130,246,.95); }

.chip--late{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.22);
  color: rgba(239,68,68,.95);
  font-weight: 800;
  margin-bottom: 8px;
}

.order__right{ justify-self:end; text-align:right; }
.order__reason{ color: rgba(245,158,11,.95); font-weight: 700; }

.link{
  margin-top: 4px;
  color: rgba(32,227,178,.95);
  text-decoration:none;
  font-weight: 700;
  padding: 6px 2px 0;
}
.link:hover{ text-decoration: underline; }

/* Responsive */
@media (max-width: 1100px){
  .kpi-grid{ grid-template-columns: repeat(2, 1fr); }
  .bottom-grid{ grid-template-columns: 1fr; }
  .span-2{ grid-column: auto; }
  .order{ grid-template-columns: 1fr; }
  .order__right{ justify-self:start; text-align:left; }
}
@media (max-width: 820px){
  .main-grid{ grid-template-columns: 1fr; }
}
.toplinks{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-right: 10px; /* jeśli chcesz odstęp od ikon */
}

.toplink{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: rgba(234,240,255,.82);
  text-decoration: none;
  font-weight: 900;
}

.toplink:hover{
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
}

.toplink svg{
  width: 16px;
  height: 16px;
  opacity: .9;
}
.toplink.is-active{
  background: rgba(59,130,246,.95);
  border-color: rgba(59,130,246,.55);
  color: #031427;
}
