/* ===== Magazyn elementów — motyw Windows 95 ===== */
:root {
  --desktop: #008080;
  --face: #c0c0c0;
  --hilight: #ffffff;
  --light: #dfdfdf;
  --shadow: #808080;
  --dark: #404040;
  --title-a: #000080;
  --title-b: #1084d0;
  --text: #000000;
  --text-muted: #404040;   /* używane też w inline-stylach w PHP */
  --link: #0000ee;
  --danger: #a00000;
  --success: #006000;
  --font: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Verdana, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 16px 10px 40px;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: var(--desktop);
  cursor: default;
}

a { color: var(--link); }
a:visited { color: #551a8b; }

/* ---------- okno: pasek tytułu + menu + zawartość ---------- */
header.topbar,
main,
footer.statusbar {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilight) var(--dark) var(--dark) var(--hilight);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--light);
}

header.topbar {
  padding: 3px 3px 0;
  border-bottom: none;
  box-shadow: inset 1px 1px var(--light);
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  padding: 2px 3px 2px 6px;
  min-height: 20px;
}

header.topbar h1 {
  margin: 0;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: .02em;
}
header.topbar h1 a, header.topbar h1 a:visited { color: #fff; text-decoration: none; }
header.topbar h1 a::before { content: "▤ "; }

.okno-przyciski { display: flex; gap: 2px; }
.okno-przyciski span {
  width: 16px; height: 14px;
  background: var(--face);
  color: #000;
  font-size: 11px;
  font-weight: bold;
  line-height: 11px;
  text-align: center;
  border: 1px solid;
  border-color: var(--hilight) var(--dark) var(--dark) var(--hilight);
  box-shadow: inset -1px -1px var(--shadow);
}
.okno-przyciski span:last-child { margin-left: 2px; }

nav.mainnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 2px 0 3px;
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px var(--hilight);
}
nav.mainnav a, nav.mainnav a:visited {
  color: #000;
  text-decoration: none;
  padding: 2px 10px;
  border: 1px solid transparent;
}
nav.mainnav a:hover {
  border-color: var(--hilight) var(--shadow) var(--shadow) var(--hilight);
}
nav.mainnav a.aktywny {
  border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow);
  font-weight: bold;
}

main {
  margin-top: 0;
  margin-bottom: 0;
  padding: 12px 12px 16px;
  border-top: none;
  border-bottom: none;
}

footer.statusbar {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-top: none;
  font-size: 12px;
}
footer.statusbar span {
  padding: 1px 6px;
  border: 1px solid;
  border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow);
}
footer.statusbar span:first-child { flex: 1; }

/* ---------- "groupbox" zamiast kart ---------- */
.karta {
  background: var(--face);
  border: 2px groove var(--hilight);
  padding: 14px;
  margin-bottom: 12px;
}

h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: bold;
}

/* ---------- komunikaty ---------- */
.komunikat {
  padding: 6px 10px;
  margin-bottom: 12px;
  background: #ffffe1;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 var(--dark);
}
.komunikat.sukces { color: var(--success); }
.komunikat.sukces::before { content: "ⓘ "; font-weight: bold; }
.komunikat.blad { color: var(--danger); }
.komunikat.blad::before { content: "⊗ "; font-weight: bold; }

/* ---------- formularze ---------- */
form.filtry {
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  align-items: end;
}

.pole-formularza {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}
.pole-formularza label { font-size: 13px; }

input, select, textarea {
  font-family: var(--font);
  font-size: 13px;
  padding: 3px 4px;
  color: #000;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow);
  box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light);
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: none; }
textarea { resize: vertical; min-height: 70px; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 13px;
  padding: 4px 14px;
  min-width: 70px;
  text-align: center;
  text-decoration: none;
  color: #000;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilight) var(--dark) var(--dark) var(--hilight);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--light);
  border-radius: 0;
  cursor: default;
}
.btn:visited { color: #000; }
.btn:active {
  border-color: var(--dark) var(--hilight) var(--hilight) var(--dark);
  box-shadow: inset 1px 1px var(--shadow);
  padding: 5px 13px 3px 15px;
}
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn.btn-secondary { background: var(--face); }
.btn.btn-danger, .btn.btn-danger:visited { color: var(--danger); }
.btn.btn-small { padding: 2px 8px; min-width: 0; font-size: 12px; }
.btn.btn-small:active { padding: 3px 7px 1px 9px; }

/* ---------- tabela jako lista z białym tłem ---------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow);
  box-shadow: inset 1px 1px var(--dark);
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 3px 8px;
  vertical-align: middle;
}
th {
  font-weight: normal;
  background: var(--face);
  border: 1px solid;
  border-color: var(--hilight) var(--dark) var(--dark) var(--hilight);
  box-shadow: inset -1px -1px var(--shadow);
  padding: 3px 8px;
}
td { border-bottom: 1px dotted #c0c0c0; }
tr:hover td { background: var(--title-a); color: #fff; }
tr:hover td a, tr:hover td .uwagi-skrot { color: #fff; }

/* ---------- plakietki ---------- */
.badge {
  display: inline-block;
  padding: 0 6px;
  font-size: 12px;
  color: #fff;
  border: 1px solid #000;
}
.badge.kategoria { background: #000080; }
.badge.smd { background: #008000; }
.badge.tht { background: #800000; }
.badge.nd { background: #808080; }

.uwagi-skrot {
  color: var(--text-muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.akcje-kolumna { white-space: nowrap; }
.akcje-kolumna form { display: inline; }

.puste-info {
  text-align: center;
  padding: 30px 0;
}

.statystyki {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.statystyki .stat { color: var(--text-muted); }
.statystyki .stat b {
  display: block;
  color: #000;
  font-family: "Courier New", Courier, monospace;
  font-size: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.lista-atrybutow { list-style: none; padding: 0; margin: 0; }
.lista-atrybutow li {
  display: flex;
  justify-content: space-between;
  padding: 5px 2px;
  border-bottom: 1px dotted var(--shadow);
}
.lista-atrybutow li:last-child { border-bottom: none; }
.lista-atrybutow .nazwa-pola { color: var(--text-muted); }

.wiersz-atrybutu {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr auto auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.wiersz-atrybutu select, .wiersz-atrybutu input { width: 100%; }

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 5px;
}
.checkbox-inline input { width: auto; }

.link-powrot {
  display: inline-block;
  margin-bottom: 10px;
}

/* ---------- pasek przewijania (Chrome/Edge) ---------- */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track {
  background: repeating-conic-gradient(var(--face) 0% 25%, #fff 0% 50%) 0 0 / 2px 2px;
}
::-webkit-scrollbar-thumb {
  background: var(--face);
  border: 2px solid;
  border-color: var(--hilight) var(--dark) var(--dark) var(--hilight);
  box-shadow: inset -1px -1px var(--shadow);
}
