/* Panel administracyjny — narzędzie robocze, nie strona marketingowa.
   Gęstość informacji ważniejsza niż efekt wizualny. */

.admin { background: var(--ink-050); }

.admin-main {
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px;
}

.admin-range {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--ink-300);
  text-transform: uppercase; letter-spacing: .06em;
}
.admin-range select {
  width: auto; padding: 3px 26px 3px 9px;
  font-size: 12px; font-weight: 600;
  background-color: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.15);
  color: var(--ink-100);
}
.admin-range select option { color: var(--ink-800); }

a.pill { text-decoration: none; }
a.pill:hover { background: rgba(255,255,255,.16); }

button.pill--action {
  font-family: inherit; cursor: pointer;
  background: rgba(255,255,255,.14); color: var(--ink-100);
}
button.pill--action:hover { background: rgba(255,255,255,.24); }
button.pill--action:focus-visible { outline: 2px solid var(--copper-500); outline-offset: 2px; }

#adminUser {
  background: rgba(201,118,47,.24); color: #f0c393;
  border-color: rgba(201,118,47,.4);
}

/* --------------------------------------------------------------- logowanie -- */

.login-page { background: var(--ink-900); }

.login {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; gap: 18px;
}

.login__card {
  width: 100%; max-width: 400px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px 24px;
}

.login__brand {
  display: flex; align-items: center; gap: 11px;
  padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--ink-100);
}
.login__brand strong { display: block; font-size: 14px; color: var(--ink-900); }
.login__brand em {
  font-style: normal; font-size: 11.5px; color: var(--ink-400);
  letter-spacing: .02em;
}

.login__title { font-size: 21px; color: var(--ink-900); margin-bottom: 18px; }
.login__lead { font-size: 13px; color: var(--ink-500); margin-bottom: 20px; }

.login__card .btn--primary { margin-top: 6px; }

.login__back {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--ink-100);
  text-align: center; font-size: 12.5px;
}
.login__back a { color: var(--ink-500); text-decoration: none; }
.login__back a:hover { color: var(--teal-600); }

.login__footer { font-size: 12px; color: var(--ink-500); }
.login__footer a { color: var(--copper-500); text-decoration: none; }
.login__footer a:hover { text-decoration: underline; }

/* --- kafelki --- */
.tiles {
  display: grid; gap: 14px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tile {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.tile__label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-400); margin-bottom: 5px;
}
.tile__value {
  font-size: 25px; font-weight: 700; color: var(--ink-900);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.tile__value small { font-size: 13px; font-weight: 500; color: var(--ink-400); }
.tile__hint { font-size: 11.5px; color: var(--ink-400); margin-top: 3px; }
.tile--alert .tile__value { color: var(--red-600); }
.tile--ok .tile__value { color: var(--green-600); }

/* --- siatka kart --- */
.admin-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.admin-grid .card--wide { grid-column: 1 / -1; }
.card__body { padding: 14px 16px; }

/* --- tabele --- */
.atable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.atable th {
  text-align: left; padding: 6px 8px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-400);
  border-bottom: 1px solid var(--ink-200);
  position: sticky; top: 0; background: var(--paper);
}
.atable td {
  padding: 6px 8px; border-bottom: 1px solid var(--ink-050);
  color: var(--ink-700); vertical-align: top;
}
.atable td.num, .atable th.num { text-align: right; font-variant-numeric: tabular-nums; }
.atable tr:hover td { background: var(--ink-050); }
.atable__scroll { max-height: 360px; overflow-y: auto; }

.empty {
  padding: 22px 8px; text-align: center;
  color: var(--ink-400); font-size: 13px;
}

.chip {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 650;
}
.chip--valuation { background: var(--red-100); color: var(--red-600); }
.chip--integration { background: #fff2df; color: var(--copper-700); }
.chip--llm { background: var(--teal-100); color: var(--teal-600); }
.chip--etl { background: var(--ink-100); color: var(--ink-600); }
.chip--ok { background: rgba(28,122,79,.12); color: var(--green-600); }

.mono {
  font-family: var(--mono); font-size: 11px; color: var(--ink-500);
  word-break: break-word;
}

/* --- wykres słupkowy --- */
/* space-between + max-width na słupku: przy 7 dniach słupki nie robią się
   absurdalnie szerokie, a przy 90 dniach nadal wypełniają całą szerokość. */
.chart {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2px; height: 150px; padding-top: 8px;
}
/* height:100% jest konieczne — bez niego procentowa wysokość słupka
   nie ma się do czego odnieść i wykres pozostaje pusty. */
.chart__bar {
  flex: 1; min-width: 3px; max-width: 48px; height: 100%;
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
}
.chart__bar i {
  display: block; background: var(--copper-500); border-radius: 2px 2px 0 0;
  transition: background .12s;
}
.chart__bar:hover i { background: var(--copper-700); }
.chart__bar::after {
  content: attr(data-tip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--ink-900); color: #fff; font-size: 11px;
  padding: 4px 8px; border-radius: 4px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 10;
}
.chart__bar:hover::after { opacity: 1; }
.chart__axis {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--ink-400); margin-top: 6px;
}
.chart__axis--single { justify-content: center; }
.chart--single { justify-content: center; }

/* --- konfiguracja (formularze ustawień) --- */
.admin-grid + .admin-grid { margin-top: 16px; }

.card--settings .card__body { padding-bottom: 16px; }

.settings-lead {
  font-size: 12.5px; color: var(--ink-500);
  margin-bottom: 14px; line-height: 1.5;
}
.settings-lead code {
  font-family: var(--mono); font-size: 11px;
  background: var(--ink-050); padding: 1px 5px; border-radius: 4px;
}

.settings-form {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.sfield label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 650; color: var(--ink-600);
  margin-bottom: 4px;
}
.sfield input[type="text"],
.sfield input[type="number"],
.sfield input[type="password"],
.sfield select {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--ink-200); border-radius: var(--radius-sm, 7px);
  font-size: 13px; font-family: inherit; color: var(--ink-800);
  background: var(--paper);
}
.sfield input:focus, .sfield select:focus {
  outline: 2px solid var(--copper-500); outline-offset: 0;
}
.sfield .hint { display: block; font-size: 11px; color: var(--ink-400); margin-top: 4px; }
.sfield--check { display: flex; flex-direction: column; justify-content: center; }
.sfield--check .check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-700); cursor: pointer;
}
.sfield .chip { margin-left: 2px; }

/* edytor wag cech dodatkowych */
.weights { display: grid; gap: 6px; grid-column: 1 / -1; }
.sfield:has(.weights) { grid-column: 1 / -1; }
.wrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--ink-700);
}
.wrow__input { display: flex; align-items: center; gap: 5px; }
.wrow__input input {
  width: 88px; padding: 4px 8px; text-align: right;
  border: 1px solid var(--ink-200); border-radius: 6px;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.wrow__input em { font-style: normal; font-size: 12px; color: var(--ink-400); }

.settings-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--ink-100);
}
.settings-status { font-size: 12px; }
.settings-status.is-ok { color: var(--green-600); }
.settings-status.is-err { color: var(--red-600); }

@media (max-width: 620px) {
  .admin-main { padding: 14px; }
  .admin-grid { grid-template-columns: 1fr; }
}
