/* Panel admina — nadbudowa na styles.css */

.admin { padding-bottom: 60px; }

.abar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.abar__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.brand__name em { font-style: normal; font-weight: 500; color: var(--text-3); }

.atabs { display: flex; gap: 4px; flex-wrap: wrap; }
.atab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--text-2);
  font-size: 13.5px; font-weight: 540; cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.atab:hover { color: var(--text); background: var(--surface-3); }
.atab.is-on {
  background: var(--surface); color: var(--text);
  border-color: var(--line); box-shadow: var(--sh-1);
}

.apage { max-width: 1180px; margin: 26px auto; padding: 0 clamp(14px, 3vw, 28px); display: grid; gap: 18px; }
.apanel { display: grid; gap: 18px; }

.acard {
  padding: 18px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--sh-1);
}
.acard__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.acard__head h2 { font-size: 16px; }
.acard__head > :last-child:not(h2) { margin-left: auto; }
.acols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; max-width: 78ch; }

/* --- KPI ------------------------------------------------------------------ */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.kpi {
  padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--sh-1);
  display: grid; gap: 3px;
}
.kpi b { font-size: 25px; font-weight: 660; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--text-3); }
.kpi--live b { color: var(--ok); }

/* --- wykres --------------------------------------------------------------- */
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; width: 100%; height: 190px; min-width: 520px; }
.chart .bar { fill: var(--acc); opacity: .85; transition: opacity .15s var(--ease); }
.chart .bar:hover { opacity: 1; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .lbl { fill: var(--text-3); font-size: 9px; font-family: var(--sans); }

.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.chip.is-on { background: var(--acc); border-color: var(--acc); color: #fff; }

/* --- magazyny ------------------------------------------------------------- */
.be {
  display: grid; gap: 10px;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
  margin-bottom: 10px;
}
.be__title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.be__title b { font-size: 14.5px; }
.be__kind {
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-family: var(--mono);
}
.be__meta { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.be__bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.be__bar i { display: block; height: 100%; background: var(--acc); }
.be__acts { display: flex; gap: 6px; }

.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 540; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.state--up { color: var(--ok); }
.state--up::before { background: var(--ok); }
.state--down { color: var(--danger); }
.state--down::before { background: var(--danger); }

/* --- tabele --------------------------------------------------------------- */
.tablewrap { overflow-x: auto; }
.atable { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.atable th {
  text-align: left; font-weight: 560; color: var(--text-3); font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.atable td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.atable tr:last-child td { border-bottom: 0; }
.atable td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.atable .row-gap { flex-wrap: nowrap; }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 550;
}
.tag--pro { background: var(--acc); color: #fff; }
.tag--admin { background: var(--warn-soft); color: var(--warn); }
.tag--off { background: var(--danger-soft); color: var(--danger); }

/* --- formularze ----------------------------------------------------------- */
.sform { display: grid; gap: 14px; }
.sform h3 {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin-top: 6px;
}
.frow { display: grid; gap: 5px; }
.frow > label { font-size: 12.5px; color: var(--text-2); font-weight: 540; }
.frow small { font-size: 11.5px; color: var(--text-3); }
.input, .sform input:not([type="checkbox"]), .sform select, .sform textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); font-size: 14px;
}
.input:focus, .sform input:focus, .sform select:focus, .sform textarea:focus {
  outline: 2px solid var(--acc); outline-offset: -1px;
}
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fcheck { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.fcheck input { width: 18px; height: 18px; }

.gate { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 90; }
.gate__card {
  display: grid; gap: 12px; justify-items: start;
  max-width: 420px; padding: 26px;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--sh-2);
}
.gate__card p { font-size: 13.5px; color: var(--text-2); }

@media (max-width: 720px) {
  .atab span { display: none; }
  .atab { padding: 9px 11px; }
}
