/* DreamITeam Content GAP Analyzer — Main CSS */
/* Design: Clean dark editorial / utility tool */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg:          #0f1117;
  --bg-card:     #181c27;
  --bg-hover:    #1e2335;
  --border:      #2a2f45;
  --border-light:#353c58;

  --text:        #e8eaf0;
  --text-muted:  #8b92ab;
  --text-dim:    #555e7a;

  --accent:      #4f7cff;
  --accent-soft: rgba(79,124,255,0.12);

  --green:       #22c55e;
  --blue:        #3b82f6;
  --yellow:      #eab308;
  --orange:      #f97316;
  --red:         #ef4444;
  --purple:      #a855f7;

  --green-soft:  rgba(34,197,94,0.12);
  --blue-soft:   rgba(59,130,246,0.12);
  --yellow-soft: rgba(234,179,8,0.12);
  --orange-soft: rgba(249,115,22,0.12);
  --red-soft:    rgba(239,68,68,0.12);
  --purple-soft: rgba(168,85,247,0.12);

  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.5);

  --font:        'DM Sans', sans-serif;
  --font-mono:   'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: width .25s ease;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-logo .logo-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.sidebar-logo .logo-dot {
  color: var(--accent);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-muted); }

.logout-link {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  text-align: center;
  padding: 6px;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.logout-link:hover { color: var(--red); background: var(--red-soft); }

/* Main content */
.main-content {
  margin-left: 240px;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.content-area {
  padding: 32px;
  flex: 1;
  overflow-x: hidden;
}

/* ============================================================
   KARTY
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   STATYSTYKI — KAFELKI
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Wariant 7-kolumnowy (mapa.php) */
.stats-grid-7 { grid-template-columns: repeat(7, 1fr); }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}

.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { background: var(--bg-hover); border-color: var(--accent); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.green::before  { background: var(--green); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.red::before    { background: var(--red); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.gray::before   { background: var(--text-dim); }
a.stat-card,
a.stat-card:visited {
  text-decoration: none;
  color: inherit;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card.green .stat-value  { color: var(--green); }
.stat-card.blue .stat-value   { color: var(--blue); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.red .stat-value    { color: var(--red); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-card.gray .stat-value   { color: var(--text-muted); }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.stat-info {
  display: inline;
  position: static;
  margin-left: 4px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: help;
  pointer-events: none;
}

/* ============================================================
   TABELE
   ============================================================ */
.th-sort { cursor: pointer; }
.th-sort:hover { color: var(--text); }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--bg-hover);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

td.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   BADGE — pozycje i typy luk
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.badge-excellent { background: var(--green-soft);  color: var(--green); }
.badge-good      { background: var(--blue-soft);   color: var(--blue); }
.badge-weak      { background: var(--yellow-soft); color: var(--yellow); }
.badge-poor      { background: var(--orange-soft); color: var(--orange); }
.badge-missing   { background: var(--red-soft);    color: var(--red); }
.badge-core      { background: var(--green-soft);  color: var(--green); }
.badge-green     { background: var(--green-soft);  color: var(--green); }

.gap-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.gap-missing         { background: var(--red-soft);    color: var(--red); }
.gap-weak            { background: var(--yellow-soft); color: var(--yellow); }
.gap-cannibalization { background: var(--orange-soft); color: var(--orange); }
.gap-orphan          { background: var(--blue-soft);   color: var(--blue); }
.gap-ctr             { background: var(--purple-soft); color: var(--purple); }

/* ── Tooltip dla gap-badge ─────────────────────────────────── */
.gap-badge[data-tooltip] {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
}

/* Ikona ⓘ */
.gap-info-icon {
  font-size: 10px;
  margin-left: 3px;
  opacity: 0.6;
  font-style: normal;
  vertical-align: super;
  line-height: 1;
  font-weight: 400;
  color: currentColor;
}
.gap-badge[data-tooltip]:hover .gap-info-icon {
  opacity: 1;
}

/* Tooltip box */
.gap-badge[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  white-space: pre-line;
  width: 300px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
  line-height: 1.7;
  text-align: left;
  font-family: var(--font);
  pointer-events: none;
}
.gap-badge[data-tooltip]:hover::after {
  display: block;
}

/* Strzałka wskazująca na element */
.gap-badge[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
  display: none;
  z-index: 1001;
}
.gap-badge[data-tooltip]:hover::before {
  display: block;
}

/* Tooltip poniżej gdy brak miejsca nad elementem */
.gap-badge.tooltip-below[data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 8px);
}
.gap-badge.tooltip-below[data-tooltip]::before {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--border);
}

/* Mobile */
@media (max-width: 768px) {
  .gap-badge[data-tooltip]::after {
    bottom: auto;
    top: calc(100% + 8px);
    left: 0;
    transform: none;
    width: 240px;
  }
  .gap-badge[data-tooltip]::before {
    display: none;
  }
}

/* ============================================================
   PRZYCISKI
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #3d6ae0; }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-light); background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid transparent;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ============================================================
   FORMULARZE
   ============================================================ */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color 0.15s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b92ab' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea { resize: vertical; min-height: 80px; }

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ============================================================
   ALERTY FLASH
   ============================================================ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-success { background: var(--green-soft); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.flash-error   { background: var(--red-soft);   color: var(--red);   border: 1px solid rgba(239,68,68,0.2); }
.flash-info    { background: var(--blue-soft);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.2); }

/* ============================================================
   FILTRY / TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; align-items: center; }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Toolbar wielorzędowy (mapa.php) */
.toolbar-stacked { flex-direction: column; align-items: stretch; gap: 8px; }
.toolbar-row { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; justify-content: space-between; }
.toolbar-row .toolbar-left { flex: 1; }
.toolbar-pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.filter-select {
  width: auto;
  min-width: 140px;
}

.search-input {
  width: auto;
  min-width: 220px;
}

/* ============================================================
   DROPZONE upload
   ============================================================ */
.dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon { font-size: 40px; margin-bottom: 12px; }
.dropzone-text { font-size: 14px; color: var(--text-muted); }
.dropzone-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.dropzone input[type="file"] { display: none; }

/* ============================================================
   PUSTE STANY
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-state-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-fill.green  { background: var(--green); }
.progress-fill.blue   { background: var(--blue); }
.progress-fill.yellow { background: var(--yellow); }
.progress-fill.red    { background: var(--red); }

/* ============================================================
   STRONA LOGOWANIA
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(79,124,255,0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(168,85,247,0.04) 0%, transparent 50%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-mark {
  display: inline-flex;
  width: 52px;
  height: 52px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-box .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-size: 14px;
}

/* ============================================================
   ODKRYJ FRAZY — badge NOWA, BRANDED, trendy
   ============================================================ */
.badge-new {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(79, 124, 255, 0.35);
  white-space: nowrap;
}

.badge-branded {
  font-size: 13px;
  opacity: 0.8;
}

.trend-up {
  color: var(--green);
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.trend-down {
  color: var(--red);
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.trend-neutral {
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ============================================================
   MISC
   ============================================================ */
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-mono  { font-family: var(--font-mono); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.url-cell {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.score-fill {
  flex: 1;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}

.score-fill-inner {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================================
   RESPONSYWNOŚĆ — hamburger + overlay
   ============================================================ */

/* Hamburger button — właściwości w base rule, tylko display zmienia się */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 24px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

/* Pomoc button w topbarze */
.topbar-help-btn  { }
.topbar-help-btn.has-ctx-help::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.topbar-help-text { }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.is-open { display: block; }

/* ── Utilities ───────────────────────────────────────────── */
.hide-mobile  { }
.show-mobile  { display: none; }
.brief-text   { }

/* Grid 2-col → 1-col na mobile */
.col-2-to-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ============================================================
   TABLET (769px – 1024px)  — sidebar zwinięty do ikon
   ============================================================ */
@media (max-width: 1024px) and (min-width: 769px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
    transition: width 0.22s ease;
  }
  .sidebar:hover { width: 240px; }

  .sidebar-logo { padding: 16px 10px; overflow: hidden; }
  .sidebar-nav  { padding: 12px 6px; }
  .nav-item     { white-space: nowrap; padding: 8px 10px; }
  .sidebar-footer { padding: 10px 8px; overflow: hidden; }
  .sidebar .logout-link { display: none; }
  .sidebar:hover .logout-link { display: block; }

  .main-content { margin-left: 60px; }
  .content-area { padding: 24px; }
}

/* ============================================================
   MOBILE (≤768px) — hamburger, sidebar jako drawer
   ============================================================ */
@media (max-width: 768px) {

  /* Sidebar — ukryty drawer */
  .sidebar {
    transform: translateX(-260px);
    transition: transform 0.25s ease;
    z-index: 200;
    width: 240px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
  }
  .sidebar.is-open { transform: translateX(0); }

  /* Main content — pełna szerokość */
  .main-content { margin-left: 0; }
  .content-area { padding: 16px; }
  .topbar       { padding: 12px 16px; }

  /* Hamburger widoczny */
  .hamburger-btn { display: flex !important; }

  /* Topbar — tytuł skrócony, Pomoc tylko ikona */
  .topbar { gap: 8px; }
  .topbar .page-title {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }
  .page-subtitle { display: none; }
  .topbar-help-text { display: none; }          /* PROBLEM 2: ukryj słowo "Pomoc" */
  .topbar-help-btn { padding: 8px !important; } /* zostaw tylko ikonę 📖 */

  /* Karty */
  .card { padding: 14px; margin-bottom: 14px; }

  /* Stats grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stats-grid-7 { grid-template-columns: repeat(4, 1fr); }

  /* Tabele — przewijalne */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }
  table, thead th, tbody td { font-size: 12px; }
  thead th { padding: 9px 10px; }
  tbody td  { padding: 9px 10px; }

  /* PROBLEM 3: Gap kafelki — 2 kolumny, 5. rozciąga się */
  .gap-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gap-tile  { padding: 10px 8px; }
  .gap-tile .tile-num { font-size: 22px; }
  .gap-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* PROBLEM 4: Paski CORE — liczby nie wypadają za ekran */
  .core-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    gap: 8px;
  }
  .core-bar-label {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }
  .core-bar-val {
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* PROBLEM 5: Pasek informacyjny — 2 linie + przycisk pełna szerokość */
  .dash-info-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .dash-info-line1,
  .dash-info-line2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }
  .dash-info-sep { display: none; }       /* ukryj kropki · */
  .dash-info-btn {
    width: 100%;
    justify-content: center !important;
    text-align: center;
  }

  /* Brief buttons — tylko ikona */
  .brief-text { display: none; }

  /* Utilities */
  .hide-mobile  { display: none !important; }
  .show-mobile  { display: block; }

  /* Login box */
  .login-box { padding: 28px 20px; margin: 16px; }

  /* Inputs — min 16px żeby iOS nie zoomował */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px;
  }
  .login-box .btn-primary { width: 100%; justify-content: center; }

  /* Dropzone — mniejszy padding */
  .dropzone { padding: 28px 16px; }

  /* Grid 2-col → 1-col na mobile */
  .col-2-to-1 { grid-template-columns: 1fr; }
}

/* ============================================================
   SIDEBAR COLLAPSED
   ============================================================ */
.sidebar-collapsed .sidebar {
  width: 56px;
  overflow: hidden;
}
.sidebar-collapsed .main-content {
  margin-left: 56px;
}
.sidebar-collapsed .sidebar-logo .logo-text,
.sidebar-collapsed .sidebar-logo .logo-name,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-item .nav-text,
.sidebar-collapsed .sidebar-footer .user-name,
.sidebar-collapsed .sidebar-footer .user-role,
.sidebar-collapsed .sidebar-footer .logout-link,
.sidebar-collapsed .user-chip > div:last-child {
  display: none;
}
.sidebar-collapsed #sidebarToggle {
  transform: rotate(180deg);
}
.sidebar-collapsed .sidebar-logo {
  padding: 16px 12px;
  display: flex;
  justify-content: center;
}
.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}
.sidebar-collapsed .nav-icon {
  font-size: 18px;
  width: auto;
}
.sidebar-collapsed .user-chip {
  justify-content: center;
}

/* ============================================================
   SYSTEM POMOCY KONTEKSTOWEJ
   ============================================================ */
.help-ctx-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 300;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.help-ctx-panel.is-open { right: 0; }

.help-ctx-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 299;
}
.help-ctx-overlay.is-open { display: block; }

.help-ctx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.help-ctx-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}
.help-ctx-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.help-ctx-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-ctx-manual-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.help-ctx-manual-link:hover { text-decoration: underline; }
.help-ctx-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.help-ctx-close:hover { background: var(--bg-hover); color: var(--text); }

.help-ctx-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
}

/* Przycisk ? przy nagłówku */
.help-ctx-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
  vertical-align: middle;
}
.help-ctx-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Treść panelu pomocy */
.help-ctx-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.help-ctx-body h3:first-child { margin-top: 0; }
.help-ctx-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 10px 0;
}
.help-ctx-body ul {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 18px;
  margin: 0 0 10px 0;
}
.help-ctx-body li { margin-bottom: 4px; }
.help-highlight {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.help-code {
  font-family: monospace;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  margin: 8px 0;
  color: var(--accent);
  word-break: break-all;
}
.help-geek {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 12px 0;
}
.help-geek-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .help-ctx-panel { width: 100%; right: -100%; }
}

/* ============================================================
   MAPA URL — tabela z rozwijalnymi wierszami
   ============================================================ */
.map-row { cursor: pointer; transition: background .12s; }
.map-row:hover { background: var(--bg-hover); }
.map-row.is-open { background: var(--accent-soft); }
.map-expanded-row > td { padding: 0; background: var(--bg-card); border-bottom: 2px solid var(--accent); }
.map-expanded-inner { padding: 20px 28px 20px; border-top: 1px solid var(--accent); }
.map-niemon { opacity: 0.45; }
.page-type-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.pt-blog        { background: rgba(59,130,246,.15);  color: var(--blue); }
.pt-oferta      { background: rgba(34,197,94,.15);   color: var(--green); }
.pt-technologie { background: rgba(168,85,247,.15);  color: var(--purple); }
.pt-realizacje  { background: rgba(249,115,22,.15);  color: var(--orange); }
.pt-cennik      { background: rgba(234,179,8,.15);   color: var(--yellow); }
.pt-archiwum    { background: rgba(139,146,171,.15); color: var(--text-muted); }
.pt-systemowa   { background: rgba(139,146,171,.15); color: var(--text-muted); }
.mapa-th-sort   { cursor: pointer; user-select: none; white-space: nowrap; }
.mapa-th-sort:hover { color: var(--text); }
.mapa-sort-icon { font-size: 10px; margin-left: 3px; color: var(--text-dim); }
.mapa-sort-icon.active { color: var(--accent); }


/* ============================================================
   TAG INPUT (produkty-edytuj.php)
   ============================================================ */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  min-height: 42px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: text;
  transition: border-color .15s;
}
.tag-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79,124,255,.15);
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 6px 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.tag-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  margin-left: 1px;
  border-radius: 3px;
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tag-remove:hover { color: #fff; background: rgba(255,255,255,.25); }

/* Tag input — tryb lista */
.tag-input-wrap[data-style="list"] {
  padding: 0;
  min-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.tag-input-wrap[data-style="list"]:focus-within { border: none; box-shadow: none; }
.tag-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  margin-bottom: 7px;
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  box-shadow: inset 0 0 0 1px var(--border);
}
.tag-list-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 15px;
  flex-shrink: 0;
  transition: background .1s, color .1s;
}
.tag-list-remove:hover { background: rgba(252,92,92,.12); color: #fc5c5c; }
.tag-list-input {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  outline: none;
  margin-top: 4px;
  transition: border-color .15s;
}
.tag-list-input:focus { border-color: var(--accent); border-style: solid; }
.tag-list-input::placeholder { color: var(--text-dim); }
.tag-text-input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  flex: 1;
  min-width: 140px;
}

/* ============================================================
   FORMULARZ SEKCJE (produkty-edytuj.php)
   ============================================================ */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   POWIĄZANE PRODUKTY (checkboxy jako kafelki)
   ============================================================ */
.related-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.related-item:hover { border-color: var(--border-light); color: var(--text); }
.related-item--checked {
  border-color: var(--accent);
  background: rgba(79,124,255,.08);
  color: var(--text);
  font-weight: 600;
}
.related-item input[type=checkbox] { width: auto; accent-color: var(--accent); }

/* P-W-E grid na mobile */
@media (max-width: 768px) {
  .form-section .form-group div[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   BARDZO MAŁE (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid-7 { grid-template-columns: repeat(2, 1fr); }
  .gap-tiles  { grid-template-columns: repeat(2, 1fr); }
  .content-area { padding: 12px; }
  .card { padding: 12px; }
}

/* ── Filter chips (nawigacyjne filtry widoków) ─────────────── */
a.filter-chip,
a.filter-chip:visited {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
  transition: background .15s, border-color .15s, color .15s;
  cursor: pointer;
}
a.filter-chip:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.30);
  color: var(--text);
}
a.filter-chip.active {
  font-weight: 600;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff !important;
  text-decoration: none !important;
}
a.filter-chip.active-red {
  font-weight: 600;
  border-color: #ef4444;
  background: #ef4444;
  color: #fff !important;
  text-decoration: none !important;
}
a.filter-chip .chip-count {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  color: inherit;
}
a.filter-chip.active .chip-count,
a.filter-chip.active-red .chip-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.filter-chips-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0 14px;
}

/* ── Badges źródła fraz (frazy-gsc.php) ─────────────────── */
.badge-source {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
  white-space: nowrap;
}
.badge-source-both {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
}
.badge-source-import {
  background: rgba(34,197,94,0.12);
  color: var(--green);
}

/* ── Proces — jednokolumnowy układ pionowy ───────────────── */
.proc-flow {
  max-width: 560px;
  margin: 0 auto;
}
.proc-step {
  border-radius: 8px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.04);
  margin-bottom: 4px;
  text-decoration: none;
  display: block;
  transition: filter .15s;
}
a.proc-step:hover { filter: brightness(1.08); }
.proc-step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.proc-step-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.proc-action {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
}
.proc-context {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.4;
}
.proc-alert {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245,158,11,.15);
  color: #d97706;
}
.proc-ok {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(34,197,94,.12);
  color: var(--green);
}
.proc-arrow {
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1;
  padding: 6px 0;
}
.proc-footnote {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.proc-fork-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}
@media (max-width: 680px) {
  .proc-fork-grid { grid-template-columns: 1fr; }
}
.proc-count {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  margin: 4px 0 2px;
}
.proc-count-label {
  font-size: 12px;
  color: var(--text-muted);
}
.proc-count-muted {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.1;
  margin: 4px 0 2px;
}

/* ── Baner nowych stron WP (header.php) ── */
/* ============================================================
   KANIBALIZACJA — wiersze tabeli (v266)
   ============================================================ */
tr.cannib-in-db td:first-child { border-left: 3px solid var(--green); }
tr.cannib-not-db                { opacity: 0.65; }
tr.cannib-not-db td             { color: var(--text-muted); }
tr.cannib-not-db:hover          { opacity: 1; }
tr.cannib-not-db:hover td       { color: var(--text); }

@keyframes _wpShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes _wpPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,.5); }
  50%     { box-shadow: 0 0 0 7px rgba(139,92,246,0); }
}
@keyframes _wpBounce {
  0%,100% { transform: translateY(0); }
  40%     { transform: translateY(-5px); }
  70%     { transform: translateY(-2px); }
}
#wpNewBanner {
  background: linear-gradient(90deg,#1e1040,#3b1f8c,#6d28d9,#3b1f8c,#1e1040);
  background-size: 300% auto;
  animation: _wpShimmer 4s linear infinite, _wpPulse 2.5s ease-in-out infinite;
  border-bottom: 2px solid #7c3aed;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #ddd6fe;
}
#wpNewBanner .wp-bounce {
  font-size: 20px;
  animation: _wpBounce 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
#wpNewBanner strong { color: #fff; }
#wpNewBanner .wp-titles {
  font-size: 11px;
  color: #c4b5fd;
  margin-top: 2px;
}
#wpNewBanner .wp-btn {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
  padding: 5px 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s;
}
#wpNewBanner .wp-btn:hover { background: rgba(255,255,255,.22); }

/* ── Task title — wieloliniowy display (v3.46.6) ── */
.tt-main   { display: block; font-size: .875rem; font-weight: 500; color: var(--text); }
.tt-phrase { display: block; font-size: .8rem; color: var(--text-muted, var(--text-dim)); margin-top: 1px; }
.tt-url    { display: block; font-size: .75rem; color: var(--accent); font-family: monospace;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px;
             cursor: pointer; text-decoration: none; }
.tt-url:hover { text-decoration: underline; }

/* ── Page header layout ──────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

/* ── Sortowalny nagłówek tabeli ──────────────────────────────── */
.sort-link {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.sort-link:hover { color: var(--text); }
.sort-link.active { color: var(--text); }

.sort-icon {
  font-size: 10px;
  margin-left: 3px;
  color: var(--text-dim);
  display: inline-block;
}
.sort-icon.active { color: var(--accent); }

/* ── Tooltip komponent (globalny) ────────────────────────────── */
.tooltip-wrap          { position: relative; display: inline-block; }
.tooltip-wrap .tip     { font-size: 11px; cursor: help; opacity: 0.6; margin-left: 4px; vertical-align: middle; user-select: none; }
.tooltip-wrap:hover .tip-box { display: block; }
.tip-box {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  z-index: 100;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.tip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}

/* ── Pasek świeżości danych (data-meta-bar) ──────────────────── */
.data-meta-bar {
  margin: -32px -32px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 5px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.data-meta-bar.dmb-warn {
  background: rgba(234,179,8,0.06);
  border-bottom-color: rgba(234,179,8,0.2);
}
.dmb-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dmb-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.dmb-item strong { color: var(--text-muted); font-weight: 500; }
.dmb-item.dmb-warn-text { color: var(--yellow); font-weight: 500; }
.dmb-sep { color: var(--border-light); }
.dmb-link { font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.dmb-link:hover { text-decoration: underline; }
.dmb-link.dmb-link-warn { color: var(--yellow); }

@media (max-width: 768px) { .data-meta-bar { margin: -16px -16px 16px; padding: 5px 16px; } }

/* ── Trend drill-down: panel szczegółów tygodniowych ─────── */
.trend-panel > td {
  background: var(--bg-card);
  padding: 0 !important;
  border-bottom: 2px solid var(--border);
}
.trend-panel-inner {
  padding: 10px 20px 14px;
  overflow-x: auto;
}
.trend-mini-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.trend-mini-table th {
  color: var(--text-dim);
  font-weight: 500;
  padding: 4px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.trend-mini-table th:first-child { text-align: left; }
.trend-mini-table td {
  padding: 4px 10px;
  text-align: right;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-variant-numeric: tabular-nums;
}
.trend-mini-table td:first-child {
  text-align: left;
  color: var(--text-dim);
  white-space: nowrap;
}
.trend-panel-last td {
  border-bottom: none;
  font-weight: 600;
  color: var(--text);
}
.tdelta-pos { color: var(--green, #10b981); font-weight: 600; }
.tdelta-neg { color: var(--red,   #ef4444); font-weight: 600; }

.trend-page-cell { text-align: left !important; max-width: 220px; }
.trend-page-link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 200px;
  vertical-align: middle;
}
.trend-page-link:hover { text-decoration: underline; }
.trend-page-link-new { color: var(--green, #10b981); font-weight: 600; }
.trend-new-page-badge {
  display: inline-block;
  font-size: 10px;
  background: rgba(16,185,129,.12);
  color: var(--green, #10b981);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 4px;
  white-space: nowrap;
  vertical-align: middle;
}
