/*
  Panel OknoFlow.

  Zasady: duży, czytelny tekst, dużo powietrza, jeden kolor akcentu i wyraźne stany puste.
  Panel obsługują osoby, które nie pracują z komputerem na co dzień - liczy się to, żeby
  od razu było widać, gdzie się kliknie i co się właśnie stało.
*/

:root {
  --navy: #10233f;
  --navy-soft: #1c3355;
  --ink: #17233a;
  --muted: #667a93;
  --line: #e3eaf3;
  --paper: #ffffff;
  --bg: #f2f6fb;
  --accent: #e2742a;
  --accent-soft: #fbe6d5;
  --green: #12805c;
  --green-soft: #e2f5ee;
  --amber-soft: #fdf1dc;
  --amber-ink: #8a5a00;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 35, 63, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ---------------------------------------------------------------- nawigacja */

aside {
  background: linear-gradient(170deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 0 6px; }

.brand i {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: 900 22px/1 inherit;
  font-style: normal;
}

.brand h1 { font-size: 19px; margin: 0; letter-spacing: -.3px; }
.brand small { font-size: 9px; letter-spacing: 1.3px; color: #94aac6; }

nav { display: grid; gap: 4px; }

nav a {
  display: flex; align-items: center; gap: 12px;
  color: #c2d0e2;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
}

nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
nav a.current { background: #fff; color: var(--navy); }
nav a.current .ico { color: var(--accent); }
.ico { width: 18px; text-align: center; font-size: 15px; }

.logout { margin-top: auto; }
.logout button { width: 100%; }

/* ---------------------------------------------------------------- treść */

main {
  padding: 30px 38px 70px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

header h2 { font-size: 30px; margin: 0 0 4px; letter-spacing: -.6px; }
header p { margin: 0; color: var(--muted); }
.head-side { display: flex; align-items: center; gap: 14px; }

.languages { display: flex; gap: 4px; }

.languages a {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
}

.languages a:hover { background: #e7eef8; }
.languages a.active { background: var(--navy); color: #fff; }

/* ---------------------------------------------------------------- karty i siatki */

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

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card.narrow { max-width: 560px; }
.card h3 { margin: 0 0 16px; font-size: 17px; letter-spacing: -.2px; }

.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}

.card-head h3 { margin: 0; }

.count {
  background: #eef3fa;
  color: var(--muted);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

/* ---------------------------------------------------------------- statystyki */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stat strong { display: block; font-size: 32px; letter-spacing: -1px; margin: 6px 0 2px; }
.stat small { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- tabele */

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }
td.right, th.right { text-align: right; }
.nowrap { white-space: nowrap; }

a { color: #1b5e8f; text-decoration: none; }
a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
}

.tag {
  display: inline-block;
  background: var(--amber-soft);
  color: var(--amber-ink);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
}

.pin { margin-left: 6px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- notatki */

.note {
  background: #fffdf6;
  border: 1px solid #f0e4c8;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
}

.note-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--amber-ink);
  margin-bottom: 4px;
}

.note p { margin: 0; white-space: pre-wrap; }
.note-card { background: #fffdf6; border-color: #f0e4c8; }
.note-preview { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------------------------------------------------------------- listy faktów */

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0 0 18px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 600; }

.gross {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-top: 2px solid var(--line);
}

.gross strong { font-size: 26px; color: var(--navy); letter-spacing: -.5px; }

/* ---------------------------------------------------------------- formularze */

form { display: grid; gap: 14px; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #3d556f; }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 600; }
label.check input { width: auto; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cdd9e7;
  border-radius: 10px;
  background: #fcfdff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: #7ba7d8;
  box-shadow: 0 0 0 3px rgba(123, 167, 216, .22);
  background: #fff;
}

fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }

legend {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 0 6px;
}

button, .button {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  justify-self: start;
}

button:hover, .button:hover { background: #cf6620; text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }

.ghost {
  display: inline-block;
  background: #eef3fa;
  color: #2b4a6b;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.ghost:hover { background: #e2ebf7; text-decoration: none; }
aside .ghost { background: rgba(255, 255, 255, .1); color: #c2d0e2; }
aside .ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline-form { margin-top: 14px; }
.upload { margin-top: 18px; }
.back { font-weight: 700; }

/* ---------------------------------------------------------------- wyszukiwanie i strony */

.searchbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.searchbar input[name=q] { flex: 1; }
.searchbar input[type=hidden] { display: none; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

.tab {
  padding: 8px 15px;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.tab:hover { text-decoration: none; border-color: #c9d7e8; }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.pagination {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}

.page-indicator { font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------------------------------------------------------------- stany i komunikaty */

.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-mark { font-size: 30px; color: #c6d4e4; margin-bottom: 8px; }
.empty p { margin: 0; font-size: 15px; }

.alert, .ok {
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}

.alert { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid #f0dcb4; }
.alert.soft { font-weight: 500; }
.ok { background: var(--green-soft); color: var(--green); border: 1px solid #bfe6d6; }

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

body.centered { display: grid; grid-template-columns: 1fr; place-items: center; padding: 24px; }

.login {
  background: var(--paper);
  border-radius: 18px;
  padding: 34px;
  width: min(420px, 100%);
  box-shadow: 0 20px 50px rgba(16, 35, 63, .14);
}

.login .brand { margin-bottom: 26px; padding: 0; }
.login .brand h1 { color: var(--ink); }
.login .brand small { color: var(--muted); }
.login h2 { font-size: 21px; margin: 0 0 6px; }
.login p { margin: 0 0 20px; }
.login .languages { justify-content: center; margin-top: 20px; }

/* ---------------------------------------------------------------- mapa i zdjęcia */

.map-canvas { height: 620px; border-radius: 12px; overflow: hidden; }
.photo { max-width: 100%; border-radius: 12px; margin-top: 12px; }

/* ---------------------------------------------------------------- telefon i tablet */

@media (max-width: 980px) {
  body { display: block; }
  aside { flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px; }
  aside nav { display: flex; gap: 4px; overflow-x: auto; }
  aside nav a span:not(.ico) { display: none; }
  .brand small { display: none; }
  .logout { margin: 0; }
  .logout button { padding: 9px 12px; }
  main { padding: 18px 16px 50px; }
  .grid, .stats { grid-template-columns: 1fr; }
  header { flex-direction: column; }
  header h2 { font-size: 24px; }
  .card { padding: 18px; overflow-x: auto; }
  .searchbar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
