/*
 * Studfolio 0.90.0 — styl bazowy wspólnych elementów szablonów.
 *
 * Zastępuje stary blok <style> z base.html (motyw „LEGO” + v70 Investment Catalog).
 * Ładowany PRZED stylami podstron (block extra_head), dokładnie w miejscu dawnego
 * bloku, więc lokalne style podstron mogą go nadpisywać jak wcześniej.
 * Tokeny kolorów: studfolio.css (motyw jasny/ciemny z preferencji konta).
 */

html { --ui-accent: #F2B705; }

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 28px 32px; box-sizing: border-box; }
@media (max-width: 980px) { .main-content { padding: 16px 13px 22px; } }

/* ---------- tabele ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 15px; border-radius: 12px; overflow: hidden; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--ui-line); text-align: left; vertical-align: middle; }

/* ---------- miniatury z powiększeniem ---------- */
.img-container { position: relative; display: inline-block; cursor: pointer; }
.img-container img { width: 60px; height: auto; border-radius: 6px; transition: transform .25s ease; }
.img-container:hover img { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }

/* ---------- statusy ---------- */
.status-badge { display: inline-block; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; }

/* ---------- małe przyciski akcji (PDF / klocki / figurki) ---------- */
:is(.btn-pdf, .btn-parts, .btn-figs) {
  display: inline-block;
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  background: var(--ui-accent);
  color: #141A24;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
}
:is(.btn-pdf, .btn-parts, .btn-figs):hover { filter: brightness(1.06); }

/* ---------- plakietki serwisów (kolory serwisów zostają) ---------- */
.link-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
:is(.badge-lego, .badge-reb, .badge-bl, .badge-bs) { padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; text-decoration: none; }
.badge-lego { background: #FFCF00; color: #1A1400; }
.badge-reb { background: #0055BF; color: #FFFFFF; }
.badge-bl { background: #D01012; color: #FFFFFF; }
.badge-bs { background: #2C3E50; color: #FFFFFF; }

/* ---------- pasek filtrów i sortowanie (ogólne) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 20px; padding: 15px 18px; border-radius: 14px; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 13px; font-weight: 800; color: var(--ui-muted); }
.sort-btn { padding: 6px 12px; border-radius: 8px; background: var(--ui-card-soft); color: var(--ui-ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.sort-btn.active { background: var(--b-yellow); color: var(--b-yellow-ink); }
.reset-btn { padding: 6px 12px; border-radius: 8px; border: 2px solid var(--ui-line); color: var(--ui-muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- wykresy i podsumowania ---------- */
.charts-container { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.chart-box { flex: 1; min-width: 300px; max-height: 350px; display: flex; flex-direction: column; align-items: center; padding: 20px; border-radius: 14px; }
.chart-box h3 { margin: 0 0 15px; font-size: 15px; color: var(--ui-muted); }
.summary-box { display: flex; align-items: center; gap: 40px; padding: 20px; border-radius: 14px; border-left: 5px solid var(--b-red); font-size: 16px; }
.summary-item b { color: var(--b-red-text); font-size: 18px; }
form.simple-form { max-width: 600px; padding: 25px; border-radius: 14px; }

/* ---------- okna (modal) ---------- */
.modal { display: none; position: fixed; z-index: 1000; inset: 0; justify-content: center; align-items: center; background: rgba(6, 10, 16, .72); }
.modal-content { position: relative; width: 90%; max-width: 850px; padding: 25px; border-radius: 20px; text-align: center; }
.close-btn { position: absolute; top: 10px; right: 15px; font-size: 24px; font-weight: 800; cursor: pointer; color: var(--ui-muted); }
.close-btn:hover { color: var(--ui-ink); }
.gallery-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-height: 450px; margin-top: 15px; padding: 5px; overflow-y: auto; }
.gallery-grid img { width: 130px; height: auto; border-radius: 8px; border: 2px solid var(--ui-line); cursor: pointer; transition: transform .2s; }
.gallery-grid img:hover { transform: scale(1.05); }

/* ---------- przyciski ogólne (poza treścią strony, np. w oknach) ---------- */
button { padding: 10px 18px; border: none; border-radius: 10px; background: var(--ui-accent); color: #141A24; font: 700 14px var(--b-font, Inter, sans-serif); cursor: pointer; }
.btn-danger { background: var(--b-red); color: #FFFFFF; }
.btn-warning { background: var(--b-yellow); color: var(--b-yellow-ink); }

/* ---------- konto w nagłówku (menu konta) ---------- */
.language-switcher { display: inline-flex; align-items: center; }
.logout-inline { display: inline; margin: 0; }
