/* ============================================================
   PALETA KOLORÓW — edytuj tutaj żeby zmienić całą stronę
   ============================================================

   AKTUALNA PALETA: "Stare Kino" (ciepła, retro)
   Możliwe zamienniki dla --accent:
     Retro czerwień:  #B5271E  (aktualny)
     Granat:          #1A3A5C
     Zieleń butelkowa: #1D5C3A
     Mahon:           #7B3A2A

   Paski osi czasu (--bar-1 do --bar-8):
     Aktualna paleta: saturowane barwy z lat 70/80 jak na Twoim PNG
     Zmień wartości hex żeby dostosować do własnych upodobań.
   ============================================================ */
:root {
  /* Tło i tekst */
  --bg:          #F2EFE9;   /* kremowe tło strony */
  --bg2:         #FFFFFF;
  --bg3:         #E8E4DC;
  --txt:         #1C1C1A;
  --txt2:        #6B6560;
  --border:      #D0C9BE;

  /* Kolor akcentu (przyciski, badge, nagłówek) */
  --accent:      #B5271E;
  --accent2:     #D93226;
  --accent-txt:  #FFFFFF;

  /* Paski bohaterów na osi czasu — 8 kolorów rotujących */
  --bar-1:       #2DC76D;   /* soczysta zieleń */
  --bar-2:       #C653C6;   /* fiolet/magenta */
  --bar-3:       #B8C020;   /* żółto-oliwkowy */
  --bar-4:       #1BB5C8;   /* cyan/turkus */
  --bar-5:       #E8821A;   /* pomarańczowy */
  --bar-6:       #4A90D9;   /* niebieski */
  --bar-7:       #E03A5C;   /* różowo-czerwony */
  --bar-8:       #7B5EA7;   /* fiolet */

  /* Tło produkcji (szary pasek za bohaterami jak na PNG) */
  --timeline-bg-bar: #C8D8C0; /* bladozielona szarość */

  /* Inne */
  --radius:      8px;
  --shadow:      0 2px 10px rgba(0,0,0,.10);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --timeline-w:  52px;
  --bar-width:   36px;    /* szerokość jednego paska bohatera */
  --timeline-min-h: 620px;
}

[data-theme="dark"] {
  --bg:          #141412;
  --bg2:         #1E1D1B;
  --bg3:         #2A2826;
  --txt:         #EAE6DF;
  --txt2:        #A09890;
  --border:      #3A3632;
  --accent:      #D93226;
  --accent2:     #FF5047;
  --timeline-bg-bar: #2A3828;
  --shadow:      0 2px 10px rgba(0,0,0,.5);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--txt); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container--narrow { max-width: 680px; }
.main-content { flex: 1; padding: 2rem 0; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--bg2);
  border-bottom: 2px solid var(--accent);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.site-header .container { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; flex-wrap: wrap; }
.logo { font-size: 1.2rem; font-weight: 700; color: var(--txt); white-space: nowrap; }
.main-nav { display: flex; gap: .5rem; flex-wrap: wrap; flex: 1; }
.main-nav a { padding: .4rem .7rem; border-radius: 4px; color: var(--txt); font-size: .9rem; }
.main-nav a:hover { background: var(--bg3); text-decoration: none; }
.theme-toggle, .nav-toggle {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--txt); padding: .35rem .6rem; font-size: 1rem;
}
.nav-toggle { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 1rem; text-align: center; font-size: .85rem; color: var(--txt2); }

/* ============================================================
   KARTY PRODUKCJI
   ============================================================ */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.cards-grid--sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s; color: var(--txt);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.card-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.card-img--placeholder {
  aspect-ratio: 2/3; background: var(--accent); color: var(--accent-txt);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 700;
}
.card-img--circle { border-radius: 50%; aspect-ratio: 1/1; width: 80px; margin: 1rem auto 0; }
.card-body { padding: .75rem; display: flex; flex-direction: column; gap: .3rem; }
.card-title { font-size: 1rem; font-weight: 600; }
.card-years { font-size: .8rem; color: var(--txt2); }
.card--sm .card-img { aspect-ratio: 1/1; }
.rola-tag { font-size: .78rem; background: var(--bg3); border-radius: 3px; padding: .15rem .4rem; display: inline-block; }
.actor-name { font-size: .78rem; color: var(--txt2); }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 3px; font-size: .75rem; font-weight: 600; background: var(--bg3); color: var(--txt2); }
.badge--serial { background: #2980b9; color: #fff; }
.badge--film   { background: #8e44ad; color: #fff; }
.badge--ok     { background: #27ae60; color: #fff; }
.badge--warn   { background: #f39c12; color: #fff; }

/* ============================================================
   WYSZUKIWARKA
   ============================================================ */
.search-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.search-bar input[type=text] { flex: 1; min-width: 200px; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); color: var(--txt); }
.search-bar select { padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); color: var(--txt); }
.search-bar button { padding: .5rem 1rem; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); }
.btn-reset { padding: .5rem .75rem; color: var(--txt2); border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; }

/* ============================================================
   OŚ CZASU PRODUKCJI (serial.php)
   ============================================================ */
.timeline-section { margin-top: 2rem; }
.timeline-section h2 { margin-bottom: 1rem; font-size: 1.2rem; }

.timeline-wrap {
  display: flex;
  height: var(--timeline-min-h);   /* konkretna wysokość — height%, nie min-height */
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  padding: .5rem;
}

/* Oś pionowa z latami */
.timeline-axis {
  position: relative;
  width: var(--timeline-w);
  min-width: var(--timeline-w);
  flex-shrink: 0;
  margin-right: .5rem;
}
.axis-line {
  position: absolute;
  left: 50%; top: 1.5rem; bottom: 1.5rem;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}
.axis-label {
  position: absolute;
  right: 0;
  font-size: .7rem;
  color: var(--txt2);
  transform: translateY(-50%);
  white-space: nowrap;
  padding-right: .25rem;
}
.axis-label--top { top: 1.5rem; }
.axis-label--bot { bottom: 1.5rem; transform: none; }

/* ============================================================
   OŚ CZASU PRODUKCJI — układ jak na PNG:
   lewa: lata | środek: szary pasek tła | prawo: kolorowe paski bohaterów
   ============================================================ */

/* Obszar z osiami bohaterów (prawa strona) */
.timeline-chars {
  position: relative;
  flex: 1;
  min-width: 0;
  /* szary pasek tła = cały zakres produkcji */
  background: var(--timeline-bg-bar);
  border-radius: 6px;
}

/* Jeden bohater = jedna kolumna */
.char-col {
  position: absolute;
  top: 0; bottom: 0;
  width: var(--bar-width);
}

/* Każdy następny pasek przesuwa się w prawo */
.char-col:nth-child(1)  { left: calc(0  * (var(--bar-width) + 4px)); }
.char-col:nth-child(2)  { left: calc(1  * (var(--bar-width) + 4px)); }
.char-col:nth-child(3)  { left: calc(2  * (var(--bar-width) + 4px)); }
.char-col:nth-child(4)  { left: calc(3  * (var(--bar-width) + 4px)); }
.char-col:nth-child(5)  { left: calc(4  * (var(--bar-width) + 4px)); }
.char-col:nth-child(6)  { left: calc(5  * (var(--bar-width) + 4px)); }
.char-col:nth-child(7)  { left: calc(6  * (var(--bar-width) + 4px)); }
.char-col:nth-child(8)  { left: calc(7  * (var(--bar-width) + 4px)); }
.char-col:nth-child(9)  { left: calc(8  * (var(--bar-width) + 4px)); }
.char-col:nth-child(10) { left: calc(9  * (var(--bar-width) + 4px)); }
.char-col:nth-child(11) { left: calc(10 * (var(--bar-width) + 4px)); }
.char-col:nth-child(12) { left: calc(11 * (var(--bar-width) + 4px)); }

/* Wrapper paska — absolutny w char-col, flex column */
.char-bar-wrap {
  position: absolute;
  left: 2px; right: 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  /* Minimum height = avatar square + some bar below */
  min-height: calc(var(--bar-width) + 28px);
  transition: width .18s ease, top .18s ease, height .18s ease, filter .15s, box-shadow .15s;
}
.char-bar-wrap:hover {
  right: auto;
  width: 160px;
  height: auto !important;
  min-height: 80px;
  z-index: 50;
  filter: brightness(1.12);
  box-shadow: 2px 4px 12px rgba(0,0,0,.35);
  border-radius: 4px;
  transition: width .18s ease, filter .15s;
}


/* Avatar — kwadrat u góry paska */
.char-bar-avatar-top {
  width: 100%;
  aspect-ratio: 1/1;
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; font-weight: 700;
  border-radius: 4px 4px 0 0;
  border: 2px solid rgba(255,255,255,.25);
  border-bottom: none;
}
.char-bar-avatar-top img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Kolorowy pasek pod avatarem — wypełnia resztę wysokości */
.char-bar {
  flex: 1;
  min-height: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border-radius: 0 0 4px 4px;
}

/* Tekst pionowy (domyślnie) */
.char-bar-label {
  writing-mode: vertical-rl;
  font-size: .62rem;
  color: rgba(255,255,255,.9);
  padding: .2rem .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  flex: 1;
  transition: writing-mode 0s;
}

/* Na hover — tekst poziomy */
.char-bar-wrap:hover .char-bar-label {
  writing-mode: horizontal-tb;
  font-size: .75rem;
  padding: .3rem .4rem;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}
.char-bar-wrap:hover .char-bar {
  overflow: visible;
}
.char-bar-wrap:hover .char-bar-avatar-top {
  width: 44px;
  height: 44px;
  aspect-ratio: unset;
  flex-shrink: 0;
}

/* Kolory — ustawiamy na .char-bar i .char-bar-avatar-top przez char-col */
.char-col:nth-child(8n+1) .char-bar,
.char-col:nth-child(8n+1) .char-bar-avatar-top { background-color: var(--bar-1); }
.char-col:nth-child(8n+2) .char-bar,
.char-col:nth-child(8n+2) .char-bar-avatar-top { background-color: var(--bar-2); }
.char-col:nth-child(8n+3) .char-bar,
.char-col:nth-child(8n+3) .char-bar-avatar-top { background-color: var(--bar-3); }
.char-col:nth-child(8n+4) .char-bar,
.char-col:nth-child(8n+4) .char-bar-avatar-top { background-color: var(--bar-4); }
.char-col:nth-child(8n+5) .char-bar,
.char-col:nth-child(8n+5) .char-bar-avatar-top { background-color: var(--bar-5); }
.char-col:nth-child(8n+6) .char-bar,
.char-col:nth-child(8n+6) .char-bar-avatar-top { background-color: var(--bar-6); }
.char-col:nth-child(8n+7) .char-bar,
.char-col:nth-child(8n+7) .char-bar-avatar-top { background-color: var(--bar-7); }
.char-col:nth-child(8n+0) .char-bar,
.char-col:nth-child(8n+0) .char-bar-avatar-top { background-color: var(--bar-8); }

/* ============================================================
   OŚ CZASU BOHATERA (bohater.php)
   ============================================================ */
.profil-header {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--bg2); padding: 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 1.5rem;
}
.profil-avatar {
  width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 3rem; font-weight: 700;
}
.profil-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profil-meta h1 { font-size: 1.6rem; margin-bottom: .5rem; }
.meta-row { font-size: .9rem; color: var(--txt2); margin-bottom: .25rem; }
.zrodlo { font-size: .78rem; color: var(--txt2); margin-top: .5rem; }

.sort-bar { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; font-size: .9rem; }
.sort-bar a { padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 4px; color: var(--txt); }
.sort-bar a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Oś bohatera */
.bohater-timeline {
  display: flex;
  gap: 1rem;
  min-height: var(--timeline-min-h);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  overflow-x: auto;
}
.timeline-axis--left {
  position: relative;
  width: var(--timeline-w);
  min-width: var(--timeline-w);
  flex-shrink: 0;
}
.bohater-bars {
  flex: 1;
  position: relative;
  min-height: inherit;
}
.bohater-bar {
  position: absolute;
  left: 0; right: 0;
  border-radius: 4px;
  padding: .25rem .4rem;
  display: flex; flex-direction: column; justify-content: center;
  text-decoration: none;
  color: #fff;
  transition: opacity .15s, transform .1s;
  min-height: 24px;
  overflow: hidden;
}
.bohater-bar:hover { opacity: .85; transform: scaleX(1.01); }
.bar-tytul { font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-rola  { font-size: .7rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-lata  { font-size: .68rem; opacity: .8; }

/* Kolory pasków produkcji */
.bohater-bar:nth-child(1) { background: var(--bar-1); }
.bohater-bar:nth-child(2) { background: var(--bar-2); }
.bohater-bar:nth-child(3) { background: var(--bar-3); }
.bohater-bar:nth-child(4) { background: var(--bar-4); }
.bohater-bar:nth-child(5) { background: var(--bar-5); }
.bohater-bar:nth-child(n+6) { background: var(--bar-1); }

/* Tabela ról */
.role-section { margin-top: 2rem; }
.role-section h2 { margin-bottom: 1rem; }
.role-table-wrap { overflow-x: auto; }
.role-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.role-table th, .role-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.role-table th { background: var(--bg3); font-weight: 600; }
.role-table tr:hover td { background: var(--bg3); }

/* Powiązania */
.powiazania-section { margin-top: 2rem; }
.powiazania-section h2 { margin-bottom: 1rem; }
.powiazania-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.powia-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; gap: .75rem; align-items: flex-start; }
.powia-avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.powia-avatar img { width: 100%; height: 100%; object-fit: cover; }
.powia-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.powia-typ { font-size: .75rem; color: var(--txt2); font-style: italic; }
.powia-imie { font-weight: 600; font-size: .9rem; }
.powia-gdzie, .powia-lata { font-size: .78rem; color: var(--txt2); }

/* ============================================================
   FORMULARZE
   ============================================================ */
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 500; }
.form input[type=text],
.form input[type=email],
.form input[type=url],
.form input[type=number],
.form input[type=date],
.form input[type=password],
.form select,
.form textarea {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--txt);
  font-size: .95rem;
  font-family: var(--font);
  width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-btns { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: .5rem !important; }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--bg2); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  list-style: none; max-height: 200px; overflow-y: auto; display: none;
}
.autocomplete-list li { padding: .5rem .75rem; cursor: pointer; font-size: .9rem; }
.autocomplete-list li:hover { background: var(--bg3); }

/* ============================================================
   PRZYCISKI
   ============================================================ */
.btn {
  display: inline-block; padding: .55rem 1.1rem;
  border-radius: var(--radius); border: none; font-size: .9rem;
  font-family: var(--font); cursor: pointer; text-align: center;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--outline  { background: none; border: 1px solid var(--border); color: var(--txt); }
.btn--sm       { padding: .3rem .6rem; font-size: .8rem; }
.btn--danger   { background: #c0392b; color: #fff; }
.btn--ok       { background: #27ae60; color: #fff; }

.akcje-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ============================================================
   ALERTY
   ============================================================ */
.alert { padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert--ok  { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert--err { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
[data-theme="dark"] .alert--ok  { background: #1e3a29; color: #7dcea0; border-color: #27ae60; }
[data-theme="dark"] .alert--err { background: #3a1e1e; color: #e07b7b; border-color: #c0392b; }

/* ============================================================
   PROD HEADER (serial.php)
   ============================================================ */
.prod-header { display: flex; gap: 1.5rem; margin-bottom: 2rem; align-items: flex-start; flex-wrap: wrap; }
.prod-poster { width: 160px; border-radius: var(--radius); flex-shrink: 0; }
.prod-meta h1 { font-size: 1.6rem; margin-bottom: .5rem; }
.prod-opis { margin-top: .5rem; font-size: .95rem; color: var(--txt2); }
.chars-list { margin-top: 2rem; }
.chars-list h3 { margin-bottom: 1rem; }

/* ============================================================
   PANEL ADMIN — górny pasek nawigacji
   ============================================================ */
.admin-body { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }

/* Górny pasek admina */
.admin-sidebar {
  width: 100%;
  background: var(--bg2);
  border-bottom: 2px solid var(--accent);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 1rem;
  gap: 0;
  position: sticky; top: 0; z-index: 200;
}
.sidebar-logo {
  font-weight: 700; font-size: 1rem;
  padding: .65rem 1rem .65rem 0;
  border-right: 1px solid var(--border);
  margin-right: .5rem;
  white-space: nowrap;
}
.sidebar-logo a { color: var(--accent); }

.sidebar-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  flex: 1;
  align-items: center;
}
.sidebar-nav a {
  padding: .7rem .75rem;
  color: var(--txt);
  font-size: .85rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.sidebar-nav a:hover { background: var(--bg3); text-decoration: none; border-bottom-color: var(--accent); }
.sidebar-nav a.active { border-bottom-color: var(--accent); font-weight: 600; }

.nav-group {
  font-size: .7rem; color: var(--txt2);
  padding: 0 .4rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-left: 1px solid var(--border);
  margin-left: .25rem;
  padding-left: .75rem;
  align-self: center;
}

.admin-content { flex: 1; padding: 1.5rem; max-width: 1400px; width: 100%; margin: 0 auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; }
.admin-topbar h1 { font-size: 1.3rem; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1rem; text-align: center; display: block; color: var(--txt); text-decoration: none; transition: box-shadow .15s; }
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card--alert { border-color: var(--accent); }
.stat-num { font-size: 2rem; font-weight: 700; display: block; color: var(--accent); }
.stat-label { font-size: .82rem; color: var(--txt2); }
.quick-links { display: flex; gap: .75rem; flex-wrap: wrap; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th, .admin-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table th { background: var(--bg3); }
.admin-table tr:hover td { background: var(--bg3); }
.td-akcje { white-space: nowrap; }

.form--admin { max-width: 700px; }

/* Tabs */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.tabs a { padding: .4rem .9rem; border-radius: 4px 4px 0 0; color: var(--txt2); font-size: .9rem; }
.tabs a.active { background: var(--accent); color: #fff; }

/* Zgłoszenia */
.zgloszenia-lista { display: flex; flex-direction: column; gap: 1rem; }
.zgl-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.zgl-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; font-size: .88rem; }
.zgl-data { color: var(--txt2); margin-left: auto; }
.zgl-tresc { font-size: .9rem; margin-bottom: .75rem; line-height: 1.5; }
.zgl-akcje { display: flex; gap: .5rem; }
.zgl-warn { font-size: .82rem; color: var(--txt2); font-style: italic; }

/* Logowanie */
.login-page { display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 380px; }
.login-box h1 { margin-bottom: 1.5rem; font-size: 1.3rem; }

/* ============================================================
   RESPONSYWNOŚĆ
   ============================================================ */
@media (max-width: 768px) {
  .main-nav { display: none; width: 100%; order: 3; flex-direction: column; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }

  .form-row { grid-template-columns: 1fr; }
  .prod-header { flex-direction: column; }
  .prod-poster { width: 100%; max-width: 200px; }
  .profil-header { flex-direction: column; align-items: center; text-align: center; }

  .admin-sidebar { flex-wrap: wrap; }
  .sidebar-nav { overflow-x: auto; flex-wrap: nowrap; }
  .sidebar-nav a { padding: .55rem .6rem; font-size: .8rem; }
  .nav-group { display: none; }
  .admin-content { padding: 1rem; }

  .timeline-wrap { height: 400px; }
  .bohater-timeline { min-height: 400px; }

  .char-col { min-width: 60px; max-width: 80px; }
  .char-avatar { width: 36px; height: 36px; font-size: 1rem; }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .powiazania-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .powiazania-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bohater-timeline { padding: .75rem .5rem; }
}

/* ============================================================
   MISC
   ============================================================ */
.empty-info { color: var(--txt2); margin-top: 2rem; text-align: center; font-size: .95rem; }
h1 { margin-bottom: .75rem; }
h2 { margin-bottom: .5rem; }

/* Sekcje formularza z podziałem na kroki */
.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: .85rem;
  background: var(--bg2);
}
.form-section-title {
  font-size: 1rem; font-weight: 700;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .1rem;
}
.form-section-hint { font-size: .82rem; color: var(--txt2); margin-top: -.4rem; }

/* Opcje zdjęcia (A/B/C) */
.zdj-opcje { display: flex; flex-direction: column; gap: .75rem; }
.zdj-opcja {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; display: flex; flex-direction: column; gap: .4rem;
}
.zdj-opcja strong { font-size: .88rem; }
.zdj-opcja input { margin-top: .2rem; }

/* Wiersz jednego wystąpienia */
.wyst-row {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex; flex-direction: column; gap: .75rem;
  background: var(--bg3);
}
.wyst-row-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .88rem;
}

/* Info box — wskazówki w formularzu */
.info-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-left: 3px solid var(--bar-4);
  border-radius: var(--radius); padding: .85rem 1rem;
  font-size: .88rem; line-height: 1.6; margin-bottom: 1rem;
}
.info-box a { font-weight: 600; }

/* ============================================================
   MODAL BOHATERA (serial.php)
   ============================================================ */
.char-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 900; backdrop-filter: blur(2px);
}
.char-modal-overlay.open { display: block; }

.char-modal {
  display: none; position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.94);
  z-index: 1000;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.3);
  width: min(420px, 94vw);
  padding: 1.5rem;
  transition: transform .2s ease, opacity .2s ease;
  opacity: 0;
}
.char-modal.open {
  display: block;
  animation: modalIn .22s ease forwards;
}
@keyframes modalIn {
  from { transform: translate(-50%, -50%) scale(.93); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

.char-modal-close {
  position: absolute; top: .75rem; right: .75rem;
  background: none; border: none; font-size: 1.4rem;
  color: var(--txt2); cursor: pointer; line-height: 1;
  padding: .2rem .4rem; border-radius: 4px;
}
.char-modal-close:hover { background: var(--bg3); }

.char-modal-top {
  display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem;
}
.char-modal-avatar {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2rem; font-weight: 700;
}
.char-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }

.char-modal-inner h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.char-modal-roles p { font-size: .88rem; line-height: 1.5; margin-bottom: .3rem; }
.char-modal-roles small { color: var(--txt2); }

.char-modal-inne { border-top: 1px solid var(--border); padding-top: .85rem; margin-top: .85rem; }
.char-modal-inne h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--txt2); margin-bottom: .5rem; }
.char-modal-inne p { font-size: .85rem; line-height: 1.6; color: var(--txt); }

.lata-tag {
  display: inline-block; background: var(--bg3); border-radius: 3px;
  padding: .05rem .35rem; font-size: .78rem; color: var(--txt2);
}

/* Pusty stan osi czasu — instrukcja */
.empty-timeline-info {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-top: 1.5rem; display: flex; flex-direction: column; gap: .5rem;
  font-size: .95rem; line-height: 1.6;
}
.empty-timeline-info strong { color: var(--txt); }
.empty-timeline-info a { font-weight: 600; }

/* Pasek twórcy rekordu */
.edit-owner-bar {
  background: #FFF8E1; border: 1px solid #FFD54F; border-radius: var(--radius);
  padding: .6rem 1rem; display: flex; justify-content: space-between; align-items: center;
  font-size: .88rem; margin-bottom: 1.25rem;
}
[data-theme="dark"] .edit-owner-bar { background: #2A2410; border-color: #7A6020; }
.edit-owner-bar a { font-weight: 600; }

/* Separator w nawigacji */
.nav-sep { color: var(--border); padding: 0 .25rem; }

/* ============================================================
   RELACJE MIĘDZY BOHATERAMI (serial.php)
   ============================================================ */
.rel-section { margin-top: 2rem; }
.rel-section h3 { margin-bottom: 1rem; }
.rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.rel-card {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1rem;
}
.rel-hero {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  text-align: center; flex: 1; color: var(--txt); text-decoration: none;
  min-width: 0;
}
.rel-hero:hover strong { text-decoration: underline; }
.rel-hero-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.2rem;
}
.rel-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rel-hero strong { font-size: .78rem; line-height: 1.3; word-break: break-word; }
.rel-type-badge {
  font-size: .72rem; color: var(--txt2); text-align: center;
  padding: .25rem .45rem; border: 1px solid var(--border);
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
  background: var(--bg3); line-height: 1.4;
}

/* Responsywność osi czasu */
@media (max-width: 600px) {
  :root { --bar-width: 26px; --timeline-w: 38px; }
}
