/* The Paper Craft HUB — Szkielet V1
   Warstwa wizualna centrum zarządzania. Paleta rozszerza zmienne z
   /style.css (generator klienta) o tokeny potrzebne w panelu (sidebar,
   karty, tabele, statusy, wykresy) — ten sam charakter marki: ciepła biel,
   krem, delikatny beż, ciemny brąz tekstu, subtelne akcenty. */

:root {
  --hub-bg:            #faf6f0;
  --hub-panel:         #ffffff;
  --hub-panel-alt:     #fffdf9;
  --hub-text:          #3c2f24;
  --hub-text-muted:    #8a7c6c;
  --hub-text-faint:    #b6aa98;
  --hub-border:        #ecdfcd;
  --hub-border-soft:   #f2e9db;
  --hub-accent:        #b48762;
  --hub-accent-dark:   #8a6242;
  --hub-accent-soft:   #f4e3d3;
  --hub-sidebar-bg:    #fffefb;
  --hub-active-bg:     #f7e9dc;
  --hub-shadow:        0 10px 32px rgba(70, 54, 38, 0.07);
  --hub-shadow-sm:     0 2px 10px rgba(70, 54, 38, 0.05);
  --hub-radius:        14px;
  --hub-radius-sm:     10px;

  --hub-green:         #3fae5a;
  --hub-green-bg:      #e7f5ea;
  --hub-orange:        #e8792d;
  --hub-orange-bg:     #fdece0;
  --hub-red:           #d9534f;
  --hub-red-bg:        #fbeaea;
  --hub-blue:          #3a7bd5;
  --hub-blue-bg:       #e9f1fc;
  --hub-pink:          #c9538e;

  --hub-sidebar-w:     264px;
  --hub-header-h:      76px;
}

* { box-sizing: border-box; }

.hub-shell,
.hub-shell * {
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--hub-bg);
  color: var(--hub-text);
  -webkit-font-smoothing: antialiased;
}

.hub-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ============ SIDEBAR ============ */

.hub-sidebar {
  width: var(--hub-sidebar-w);
  flex-shrink: 0;
  background: var(--hub-sidebar-bg);
  border-right: 1px solid var(--hub-border-soft);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 22px 20px;
  border-bottom: 1px solid var(--hub-border-soft);
}

.sidebar-brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--hub-accent-soft);
  color: var(--hub-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sidebar-brand__name {
  font-family: Georgia, 'Iowan Old Style', serif;
  font-size: 15px;
  letter-spacing: 0.4px;
  color: var(--hub-text);
}

.sidebar-brand__sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--hub-accent);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.nav-item,
.nav-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: var(--hub-radius-sm);
  color: var(--hub-text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.nav-item:hover,
.nav-group__toggle:hover {
  background: var(--hub-border-soft);
  color: var(--hub-text);
}

.nav-item.is-active {
  background: var(--hub-active-bg);
  color: var(--hub-accent-dark);
  font-weight: 600;
}

.nav-item .pc-icon,
.nav-group__toggle .pc-icon {
  flex-shrink: 0;
  color: inherit;
}

.nav-item__label,
.nav-group__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hub-green);
  flex-shrink: 0;
}

.nav-group {
  margin-top: 2px;
}

.nav-group__toggle .pc-icon.chevron {
  transition: transform 0.15s ease;
  color: var(--hub-text-faint);
}

.nav-group.is-open .nav-group__toggle .pc-icon.chevron {
  transform: rotate(90deg);
}

.nav-group__children {
  display: none;
  padding-left: 30px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-group.is-open .nav-group__children {
  display: flex;
}

.nav-subitem {
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--hub-text-muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.nav-subitem:hover {
  background: var(--hub-border-soft);
  color: var(--hub-text);
}

.nav-subitem.is-active {
  color: var(--hub-accent-dark);
  font-weight: 600;
}

/* ---- TRYB POSTĘPU HUB-A: zablokowane sekcje (patrz js/app.js, LOCKED_SECTIONS) ---- */

.nav-item--locked,
.nav-group--locked .nav-group__toggle {
  color: var(--hub-text-faint);
  cursor: not-allowed;
  opacity: 0.62;
  /* pointer-events:none = przegladarka w ogole nie dostarcza zdarzenia click
     do tego elementu (drugi, niezalezny od JS poziom blokady obok
     preventDefault w js/app.js) -- element fizycznie nie reaguje na klik. */
  pointer-events: none;
}

.nav-item--locked:hover,
.nav-group--locked .nav-group__toggle:hover {
  background: none;
  color: var(--hub-text-faint);
}

.nav-item--locked .pc-icon,
.nav-group--locked .nav-group__toggle .pc-icon {
  color: inherit;
}

/* Przekreslenie WYLACZNIE na nazwie modulu (nie na ikonie/plakietce "Wkrótce")
   -- czytelny sygnal "jeszcze nie zrobione", bez wygladu bledu/uszkodzenia. */
.nav-item--locked .nav-item__label,
.nav-group--locked .nav-group__label {
  text-decoration: line-through;
  text-decoration-color: var(--hub-text-faint);
  text-decoration-thickness: 1px;
}

.nav-item__soon {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--hub-text-faint);
  background: var(--hub-border-soft);
  border-radius: 999px;
  padding: 3px 7px;
}

.nav-group--locked .nav-subitem {
  cursor: not-allowed;
  opacity: 0.62;
  pointer-events: none;
}

.sidebar-footer {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--hub-border-soft);
  font-size: 11px;
  color: var(--hub-text-faint);
  line-height: 1.6;
}

.sidebar-footer strong {
  display: block;
  color: var(--hub-text-muted);
  font-weight: 600;
  font-size: 12px;
}

/* ============ HEADER ============ */

.hub-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hub-header {
  height: var(--hub-header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  background: var(--hub-panel);
  border-bottom: 1px solid var(--hub-border-soft);
  position: sticky;
  top: 0;
  z-index: 30;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--hub-border);
  background: var(--hub-panel);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--hub-text);
  cursor: pointer;
  flex-shrink: 0;
}

.header-search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--hub-bg);
  border: 1px solid var(--hub-border);
  border-radius: 999px;
  color: var(--hub-text-faint);
}

.header-search .pc-icon { flex-shrink: 0; color: var(--hub-text-faint); }

.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--hub-text);
}

.header-search input::placeholder { color: var(--hub-text-faint); }

.header-search kbd {
  font-size: 11px;
  color: var(--hub-text-faint);
  border: 1px solid var(--hub-border);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--hub-panel);
  font-family: inherit;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.btn--primary {
  background: var(--hub-accent-dark);
  color: #fff;
}
.btn--primary:hover { opacity: 0.9; }

.btn--ghost {
  background: var(--hub-panel);
  border-color: var(--hub-border);
  color: var(--hub-text);
}
.btn--ghost:hover { background: var(--hub-border-soft); }

/* TRYB BUDOWY (usuwanie projektu): przycisk "Usuń" w dialogu potwierdzenia
   -- jedyne miejsce w HUB-ie, gdzie potrzebny jest czerwony/destrukcyjny
   wariant .btn (patrz deleteConfirmModalHtml w generator.js). */
.btn--danger {
  background: var(--hub-red);
  color: #fff;
}
.btn--danger:hover { opacity: 0.9; }
.btn--danger:disabled,
.btn--ghost:disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.btn--sm { padding: 8px 14px; font-size: 12.5px; }

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--hub-border);
  background: var(--hub-panel);
  color: var(--hub-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--hub-border-soft); }

.icon-btn__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--hub-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hub-panel);
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 6px 4px 4px;
  border-radius: 10px;
  font-family: inherit;
}
.user-menu__trigger:hover { background: var(--hub-border-soft); }

.user-menu__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hub-accent-soft);
  color: var(--hub-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-menu__text {
  text-align: left;
  line-height: 1.3;
}

.user-menu__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--hub-text);
}

.user-menu__role {
  font-size: 11px;
  color: var(--hub-text-faint);
}

.user-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--hub-panel);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  box-shadow: var(--hub-shadow);
  padding: 8px;
  display: none;
  z-index: 50;
}
.user-menu.is-open .user-menu__dropdown { display: block; }

.dropdown-link {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--hub-text);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.dropdown-link:hover { background: var(--hub-border-soft); }

.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 300px;
  background: var(--hub-panel);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  box-shadow: var(--hub-shadow);
  padding: 14px;
  display: none;
  z-index: 50;
}
.notif-wrap.is-open .notif-dropdown { display: block; }
.notif-wrap { position: relative; }

.notif-dropdown h4 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--hub-text-muted);
}

/* ============ CONTENT ============ */

.hub-content {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.view-title {
  margin: 0 0 6px;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--hub-text);
}

.view-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: var(--hub-text-muted);
}

/* POPRAWKA NAWIGACJI HUB (wrzesien 2026): ekran podgladu jednego projektu
   (Generator / Druk i Generator / Bilecik, patrz renderProjectPreview w
   hub/js/views/generator-druk.js i generator-bilecik.js) -- generator laduje
   sie tu w <iframe> pod wlasnym originem HUB-a, zamiast w oddzielnej karcie.
   Jedyna nowa reguła CSS dla tej poprawki -- reszta wyglądu HUB-a (przycisk
   powrotu, naglowek) korzysta z istniejacych klas .btn/.btn--ghost/.btn--sm/
   .view-header/.view-title/.view-subtitle bez zmian. */
.project-preview-iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 480px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  background: #fff;
}

@media (max-width: 760px) {
  .project-preview-iframe {
    height: calc(100vh - 260px);
    min-height: 420px;
  }
}

/* ---- stat cards ---- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--hub-panel);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius);
  padding: 20px 20px 18px;
  box-shadow: var(--hub-shadow-sm);
}

.stat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.stat-card__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--hub-text-faint);
}

.stat-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--hub-accent-soft);
  color: var(--hub-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__value {
  font-family: Georgia, serif;
  font-size: 28px;
  color: var(--hub-text);
  margin-bottom: 8px;
}

.stat-card__delta {
  font-size: 12px;
  font-weight: 600;
}
.stat-card__delta.positive { color: var(--hub-green); }
.stat-card__delta.negative { color: var(--hub-red); }

/* ---- generic panel/card ---- */

.panel {
  background: var(--hub-panel);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow-sm);
  padding: 22px 24px 24px;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--hub-text);
}

.panel__select {
  font-size: 12.5px;
  padding: 6px 10px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  background: var(--hub-bg);
  color: var(--hub-text);
  font-family: inherit;
}

/* ---- dashboard grid ---- */

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

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
}

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

@media (max-width: 1080px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
}

.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1080px) {
  .dash-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .dash-grid-3 { grid-template-columns: 1fr; }
}

/* ---- tables ---- */

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

.pc-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--hub-text-faint);
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--hub-border-soft);
}

.pc-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--hub-border-soft);
  color: var(--hub-text);
  vertical-align: middle;
}

.pc-table tr:last-child td { border-bottom: none; }

.pc-table td.muted { color: var(--hub-text-muted); }

.cell-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--hub-accent-soft);
  color: var(--hub-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cell-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cell-product__name { font-weight: 600; }
.cell-product__meta { font-size: 11.5px; color: var(--hub-text-faint); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge--green { background: var(--hub-green-bg); color: var(--hub-green); }
.badge--gray { background: var(--hub-border-soft); color: var(--hub-text-muted); }
.badge--orange { background: var(--hub-orange-bg); color: var(--hub-orange); }
.badge--red { background: var(--hub-red-bg); color: var(--hub-red); }
.badge--blue { background: var(--hub-blue-bg); color: var(--hub-blue); }

.channel-icons {
  display: flex;
  gap: 6px;
}

.channel-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.channel-icon.shopify { background: var(--hub-green-bg); color: var(--hub-green); }
.channel-icon.allegro { background: var(--hub-orange-bg); color: var(--hub-orange); }
.channel-icon.instagram { background: #fbe7f0; color: var(--hub-pink); }
.channel-icon.etsy { background: var(--hub-orange-bg); color: var(--hub-orange); }

.row-actions {
  border: none;
  background: none;
  color: var(--hub-text-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
}
.row-actions:hover { background: var(--hub-border-soft); color: var(--hub-text); }

/* ---- activity / notifications lists ---- */

.activity-list, .notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hub-border-soft);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--hub-accent-soft);
  color: var(--hub-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-text { flex: 1; min-width: 0; font-size: 12.5px; }
.activity-text strong { color: var(--hub-text); font-weight: 600; }
.activity-text span.muted { color: var(--hub-text-muted); }
.activity-date { font-size: 11px; color: var(--hub-text-faint); white-space: nowrap; }

.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hub-border-soft);
  font-size: 13px;
}
.notif-item:last-child { border-bottom: none; }

.notif-item .pc-icon { flex-shrink: 0; }
.notif-item.warning .pc-icon { color: var(--hub-orange); }
.notif-item.danger .pc-icon { color: var(--hub-red); }
.notif-item__text { flex: 1; }
.notif-item__link {
  font-size: 12px;
  color: var(--hub-accent-dark);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ---- quick actions ---- */

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

@media (max-width: 1180px) { .quick-actions-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .quick-actions-grid { grid-template-columns: repeat(2, 1fr); } }

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 10px;
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  background: var(--hub-panel-alt);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.quick-action:hover { background: var(--hub-border-soft); }

.quick-action__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--hub-accent-soft);
  color: var(--hub-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action__label { font-size: 12px; font-weight: 600; color: var(--hub-text); line-height: 1.3; }

/* ---- charts ---- */

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.chart-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--hub-text);
}

.chart-legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend__value {
  margin-left: auto;
  font-weight: 700;
  color: var(--hub-text-muted);
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.donut-total {
  text-align: center;
  font-size: 11px;
  color: var(--hub-text-faint);
  margin-top: 6px;
}

/* ---- placeholder / coming-soon views ---- */

.placeholder-panel {
  background: var(--hub-panel);
  border: 1px dashed var(--hub-border);
  border-radius: var(--hub-radius);
  padding: 56px 40px;
  text-align: center;
  color: var(--hub-text-muted);
}

.placeholder-panel__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 14px;
  background: var(--hub-accent-soft);
  color: var(--hub-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-panel__title {
  font-family: Georgia, serif;
  font-size: 18px;
  color: var(--hub-text);
  margin: 0 0 8px;
}

.placeholder-panel__text {
  font-size: 13.5px;
  max-width: 480px;
  margin: 0 auto 4px;
  line-height: 1.6;
}

.placeholder-panel__note {
  display: inline-block;
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--hub-text-faint);
  background: var(--hub-bg);
  border: 1px solid var(--hub-border-soft);
  border-radius: 999px;
  padding: 6px 14px;
}

.roadmap-list {
  list-style: none;
  margin: 22px auto 0;
  padding: 0;
  max-width: 420px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roadmap-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--hub-text-muted);
}

.roadmap-list li .pc-icon { color: var(--hub-text-faint); flex-shrink: 0; }

/* ---- tabs (Produkty submenu) ---- */

.view-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--hub-border-soft);
  flex-wrap: wrap;
}

.view-tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hub-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}

.view-tab:hover { color: var(--hub-text); }
.view-tab.is-active { color: var(--hub-accent-dark); border-bottom-color: var(--hub-accent-dark); }

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.chip-card {
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  padding: 16px;
  background: var(--hub-panel-alt);
}

.chip-card__name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.chip-card__count { font-size: 12px; color: var(--hub-text-muted); }

/* ---- generator dashboard cards ---- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 1080px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .project-grid { grid-template-columns: 1fr; } }

.project-card {
  position: relative;
  background: var(--hub-panel);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius);
  overflow: hidden;
  box-shadow: var(--hub-shadow-sm);
  display: flex;
  flex-direction: column;
}

/* TRYB BUDOWY (usuwanie projektu, wersja "✕" + modal): maly, okragly
   przycisk w prawym gornym rogu kafelka projektu -- zastepuje poprzedni
   wzorzec "kliknij Usun na dole karty, aby uzbroic". Umieszczony NAD
   miniatura (.project-card ma teraz position:relative wyzej), wiec dziala
   niezaleznie od tego, czy miniatura to <img> czy placeholder-ikona. */
.project-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--hub-border-soft);
  background: rgba(255, 255, 255, 0.92);
  color: var(--hub-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--hub-shadow-sm);
}
.project-card__close:hover {
  background: var(--hub-red);
  border-color: var(--hub-red);
  color: #fff;
}

.project-card__thumb {
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, var(--hub-accent-soft), var(--hub-bg));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hub-accent-dark);
  overflow: hidden;
}

/* TRYB BUDOWY: realny podglad projektu (miniatura zapisana przez Generator,
   patrz ImageExport.renderToThumbnailDataUrl w export.js) zamiast ikony --
   wypelnia dokladnie ten sam kwadrat co placeholder, bez zniekształcenia. */
.project-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card__body { padding: 14px 16px 16px; }
.project-card__name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.project-card__meta { font-size: 11.5px; color: var(--hub-text-faint); margin-bottom: 12px; }
.project-card__nick { font-size: 11.5px; color: var(--hub-text-faint); margin-top: 6px; }

.new-project-tile {
  border: 1.5px dashed var(--hub-border);
  border-radius: var(--hub-radius);
  aspect-ratio: 3 / 4.55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--hub-accent-dark);
  background: var(--hub-panel-alt);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
}
.new-project-tile:hover { background: var(--hub-active-bg); }

/* ---- KROK 5: katalog wzorow -- chipy filtra kategorii ----
   Zaden istniejacy styl (.chip-card, .option-card) nie byl kompaktowym
   przelacznikiem "pill" dopasowanym do paska wyszukiwania (.table-search) --
   ten mały, dedykowany zestaw uzywa WYLACZNIE istniejacych zmiennych
   --hub-* (tych samych, ktorych uzywa reszta HUB-a). */
.template-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.template-filter-chip {
  padding: 5px 13px;
  border: 1px solid var(--hub-border);
  border-radius: 999px;
  background: var(--hub-panel);
  color: var(--hub-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.template-filter-chip:hover { border-color: var(--hub-accent); color: var(--hub-text); }
.template-filter-chip.is-active {
  border-color: var(--hub-accent-dark);
  background: var(--hub-accent-dark);
  color: #fff;
}

/* ---- toast ---- */

.pc-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--hub-text);
  color: #fff;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--hub-shadow);
  z-index: 200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 320px;
}
.pc-toast.is-visible { opacity: 1; transform: translateY(0); }

/* ---- TRYB BUDOWY: dialog potwierdzenia usunięcia projektu (Generator) ----
   Prosty, wlasny modal (w HUB-ie nie bylo dotad zadnego komponentu modal/
   dialog do ponownego uzycia) -- wylacznie do potwierdzania nieodwracalnych
   akcji, na razie uzywany jedynie przez usuwanie projektu w generator.js
   (deleteConfirmModalHtml). z-index wyzszy niz cokolwiek innego w HUB-ie
   (patrz najwyzsza dotychczasowa wartosc 500 przy .notif-panel), zeby
   zawsze przykrywac cala reszte, laczenie z paskiem bocznym. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(60, 47, 36, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-panel {
  background: var(--hub-panel);
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow);
  padding: 24px;
  max-width: 360px;
  width: 100%;
}
.modal-panel__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--hub-text);
  margin: 0 0 8px;
}
.modal-panel__text {
  font-size: 13px;
  color: var(--hub-text-muted);
  margin: 0 0 20px;
}
.modal-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
@media (max-width: 480px) {
  .modal-panel__actions { flex-direction: column-reverse; }
  .modal-panel__actions .btn { width: 100%; justify-content: center; }
}

/* ---- disclaimer strip (integracje/shopify/allegro/instagram) ---- */

.disclaimer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--hub-orange-bg);
  color: var(--hub-orange);
  border-radius: var(--hub-radius-sm);
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 22px;
}
.disclaimer .pc-icon { flex-shrink: 0; }

/* ============ RESPONSIVE / MOBILE SIDEBAR ============ */

.sidebar-overlay {
  display: none;
}

@media (max-width: 900px) {
  .hub-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .hub-shell.sidebar-open .hub-sidebar {
    transform: translateX(0);
    box-shadow: var(--hub-shadow);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(60, 47, 36, 0.35);
  }
  .hub-shell.sidebar-open .sidebar-overlay {
    display: block;
  }
  .mobile-menu-btn { display: flex; }
  .hub-header { padding: 0 18px; gap: 12px; }
  .header-search { max-width: none; }
  .header-search kbd { display: none; }
  .hub-content { padding: 20px 18px; }
}

@media (max-width: 640px) {
  .user-menu__text { display: none; }
  .header-search { display: none; }
  .header-actions { margin-left: 0; }
  .btn--primary span.btn-label-full { display: none; }
}

/* ======================================================================
   MASTER BUILD — AI Manager, Obsluga klienta, Generator (kreator),
   Produkty (rozszerzone), Analityka, Marketing, Automatyzacje, Cel roczny.
   ====================================================================== */

/* ---- licznik przy pozycji sidebaru (AI Manager / Obsluga klienta) ---- */

.nav-item__badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--hub-red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- tony priorytetu (uzywane w "Dzisiaj", zadaniach, rekomendacjach) ---- */

.tone-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.tone-dot.red { background: var(--hub-red); }
.tone-dot.orange { background: var(--hub-orange); }
.tone-dot.yellow { background: #d9a441; }
.tone-dot.green { background: var(--hub-green); }

/* ---- Cel roczny (progress bar) ---- */

.goal-card {
  background: linear-gradient(135deg, var(--hub-accent-soft), var(--hub-panel-alt));
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius);
  padding: 24px 26px;
  box-shadow: var(--hub-shadow-sm);
  margin-bottom: 20px;
}

.goal-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.goal-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--hub-accent-dark);
}

.goal-card__numbers {
  font-family: Georgia, serif;
  font-size: 22px;
  color: var(--hub-text);
}
.goal-card__numbers strong { color: var(--hub-accent-dark); }

.goal-progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--hub-border-soft);
  overflow: hidden;
  margin-bottom: 16px;
}

.goal-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hub-accent-dark), var(--hub-accent));
  transition: width 0.4s ease;
}

.goal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .goal-stats { grid-template-columns: repeat(2, 1fr); } }

.goal-stat__label {
  font-size: 10.5px;
  color: var(--hub-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.goal-stat__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--hub-text);
}

/* ---- Dzisiaj (briefing) ---- */

.today-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1180px) { .today-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .today-grid { grid-template-columns: repeat(2, 1fr); } }

.today-card {
  background: var(--hub-panel);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  padding: 16px;
  box-shadow: var(--hub-shadow-sm);
}
.today-card__label { font-size: 10.5px; color: var(--hub-text-faint); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.today-card__value { font-size: 19px; font-weight: 700; color: var(--hub-text); font-family: Georgia, serif; }

.today-focus {
  grid-column: 1 / -1;
  background: var(--hub-active-bg);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--hub-accent-dark);
}
.today-focus strong { color: var(--hub-text); }

/* ---- lista "wymaga uwagi" ---- */

.attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.attention-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--hub-border-soft);
  cursor: pointer;
  border-radius: 8px;
  background: none;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.attention-item:hover { background: var(--hub-border-soft); }
.attention-item:last-child { border-bottom: none; }
.attention-item__text { flex: 1; font-size: 13px; color: var(--hub-text); }
.attention-item__count { font-weight: 700; color: var(--hub-accent-dark); }

/* ---- rekomendacje AI ---- */

.rec-list { display: flex; flex-direction: column; gap: 14px; }

.rec-card {
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  padding: 18px 20px;
  background: var(--hub-panel);
  display: flex;
  gap: 14px;
}

.rec-card__icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--hub-accent-soft); color: var(--hub-accent-dark);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.rec-card__body { flex: 1; min-width: 0; }
.rec-card__title { font-weight: 700; font-size: 13.5px; color: var(--hub-text); margin-bottom: 6px; }
.rec-card__detail { font-size: 12.5px; color: var(--hub-text-muted); line-height: 1.55; margin-bottom: 12px; }

.rec-card__footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.rec-card__actions { display: flex; gap: 8px; }

.rec-card.is-resolved { opacity: 0.65; }

.tier-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
}
.tier-badge.auto { background: var(--hub-green-bg); color: var(--hub-green); }
.tier-badge.approve { background: var(--hub-orange-bg); color: var(--hub-orange); }
.tier-badge.manual { background: var(--hub-red-bg); color: var(--hub-red); }

/* ---- poziomy autonomii (legenda) ---- */

.autonomy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .autonomy-grid { grid-template-columns: 1fr; } }

.autonomy-card {
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius-sm);
  padding: 18px;
  background: var(--hub-panel-alt);
}
.autonomy-card__title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 8px; color: var(--hub-text); }
.autonomy-card__text { font-size: 12px; color: var(--hub-text-muted); line-height: 1.6; margin: 0; }
.autonomy-card ul { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--hub-text-muted); line-height: 1.7; }

/* ---- log AI (timeline) ---- */

.log-list { list-style: none; margin: 0; padding: 0; }
.log-item { display: flex; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--hub-border-soft); font-size: 12.5px; }
.log-item:last-child { border-bottom: none; }
.log-item__time { color: var(--hub-text-faint); font-weight: 700; white-space: nowrap; width: 46px; flex-shrink: 0; }
.log-item__text { color: var(--hub-text); }

/* ---- zadania ---- */

.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--hub-border-soft); }
.task-item:last-child { border-bottom: none; }
.task-item.is-done .task-item__title { text-decoration: line-through; color: var(--hub-text-faint); }
.task-item__title { flex: 1; font-size: 13px; color: var(--hub-text); }
.task-item__meta { font-size: 11px; color: var(--hub-text-faint); white-space: nowrap; }
.task-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--hub-border); background: var(--hub-panel);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: transparent;
}
.task-check:hover { border-color: var(--hub-accent); }
.task-item.is-done .task-check { background: var(--hub-green); border-color: var(--hub-green); color: #fff; }

/* ---- obsluga klienta (inbox) ---- */

.inbox-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 980px) { .inbox-layout { grid-template-columns: 1fr; } }

.inbox-filters { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.inbox-filter {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 8px; border: none; background: none;
  font-size: 13px; color: var(--hub-text-muted); cursor: pointer; text-align: left; font-family: inherit;
}
.inbox-filter:hover { background: var(--hub-border-soft); }
.inbox-filter.is-active { background: var(--hub-active-bg); color: var(--hub-accent-dark); font-weight: 700; }
.inbox-filter__count { font-size: 11px; color: var(--hub-text-faint); }
.inbox-filter.is-active .inbox-filter__count { color: var(--hub-accent-dark); }

.inbox-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 640px; overflow-y: auto; }

.inbox-item {
  display: block; width: 100%; text-align: left; font-family: inherit;
  border: 1px solid var(--hub-border-soft); border-radius: var(--hub-radius-sm);
  padding: 12px 14px; background: var(--hub-panel); cursor: pointer;
}
.inbox-item:hover { background: var(--hub-panel-alt); }
.inbox-item.is-active { border-color: var(--hub-accent); background: var(--hub-active-bg); }
.inbox-item__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
.inbox-item__customer { font-weight: 700; font-size: 13px; color: var(--hub-text); display: flex; align-items: center; gap: 6px; }
.inbox-item__subject { font-size: 12px; color: var(--hub-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item__time { font-size: 10.5px; color: var(--hub-text-faint); white-space: nowrap; }

.thread-panel { background: var(--hub-panel); border: 1px solid var(--hub-border-soft); border-radius: var(--hub-radius); padding: 22px 24px; }
.thread-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--hub-border-soft); flex-wrap: wrap; gap: 10px; }
.thread-header__title { font-weight: 700; font-size: 15px; color: var(--hub-text); }
.thread-header__meta { font-size: 12px; color: var(--hub-text-muted); }

.thread-bubble { border-radius: var(--hub-radius-sm); padding: 14px 16px; margin-bottom: 14px; }
.thread-bubble.customer { background: var(--hub-bg); border: 1px solid var(--hub-border-soft); }
.thread-bubble.ai { background: var(--hub-active-bg); border: 1px solid var(--hub-border-soft); }
.thread-bubble__label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--hub-text-faint); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.thread-bubble.ai .thread-bubble__label { color: var(--hub-accent-dark); }
.thread-bubble__text { font-size: 13.5px; color: var(--hub-text); line-height: 1.6; }

.thread-editor { width: 100%; min-height: 90px; border: 1px solid var(--hub-border); border-radius: var(--hub-radius-sm); padding: 12px 14px; font-family: inherit; font-size: 13.5px; color: var(--hub-text); resize: vertical; background: var(--hub-panel-alt); }
.thread-editor:focus { outline: none; border-color: var(--hub-accent); }

.thread-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.empty-hint { padding: 60px 20px; text-align: center; color: var(--hub-text-faint); font-size: 13px; }

/* ---- toggle switch (automatyzacje) ---- */

.switch { position: relative; display: inline-flex; align-items: center; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track { position: absolute; inset: 0; background: var(--hub-border); border-radius: 999px; transition: background-color 0.15s ease; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.15s ease; }
.switch input:checked ~ .switch__track { background: var(--hub-green); }
.switch input:checked ~ .switch__thumb { transform: translateX(18px); }

/* ---- automatyzacje ---- */

.automation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .automation-grid { grid-template-columns: 1fr; } }

.automation-card { border: 1px solid var(--hub-border-soft); border-radius: var(--hub-radius); padding: 18px 20px; background: var(--hub-panel); box-shadow: var(--hub-shadow-sm); }
.automation-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.automation-card__name { font-weight: 700; font-size: 14px; color: var(--hub-text); }
.automation-card__desc { font-size: 12.5px; color: var(--hub-text-muted); line-height: 1.55; margin-bottom: 14px; }
.automation-card__footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---- kreator generatora (wizard) ---- */

.wizard-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.wizard-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--hub-text-faint); font-weight: 600; }
.wizard-step__num { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--hub-border); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.wizard-step.is-active { color: var(--hub-accent-dark); }
.wizard-step.is-active .wizard-step__num { background: var(--hub-accent-dark); border-color: var(--hub-accent-dark); color: #fff; }
.wizard-step.is-done .wizard-step__num { background: var(--hub-green); border-color: var(--hub-green); color: #fff; }
.wizard-sep { width: 24px; height: 1px; background: var(--hub-border); }

.option-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
@media (max-width: 980px) { .option-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .option-grid { grid-template-columns: repeat(2, 1fr); } }

.option-card {
  border: 1.5px solid var(--hub-border-soft); border-radius: var(--hub-radius-sm);
  padding: 20px 14px; text-align: center; cursor: pointer; background: var(--hub-panel-alt);
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: inherit;
}
.option-card:hover { border-color: var(--hub-accent); }
.option-card.is-selected { border-color: var(--hub-accent-dark); background: var(--hub-active-bg); }
.option-card__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--hub-accent-soft); color: var(--hub-accent-dark); display: flex; align-items: center; justify-content: center; }
.option-card__label { font-size: 12.5px; font-weight: 600; color: var(--hub-text); }

.wizard-footer { display: flex; justify-content: space-between; margin-top: 8px; }

/* ---- formularze (Nowy produkt itp.) ---- */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 20px; margin-bottom: 22px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--hub-text-muted); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--hub-border); border-radius: 8px; padding: 10px 12px;
  font-family: inherit; font-size: 13.5px; color: var(--hub-text); background: var(--hub-panel-alt);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--hub-accent); }
.form-field textarea { resize: vertical; min-height: 80px; }

/* ---- Analityka / KPI ---- */

.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.range-tabs { display: flex; gap: 6px; }
.range-tab { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--hub-border); background: var(--hub-panel); color: var(--hub-text-muted); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.range-tab.is-active { background: var(--hub-accent-dark); border-color: var(--hub-accent-dark); color: #fff; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--hub-border-soft); }
.rank-item:last-child { border-bottom: none; }
.rank-item__pos { width: 22px; font-size: 12px; font-weight: 700; color: var(--hub-text-faint); }
.rank-item__name { flex: 1; font-size: 13px; color: var(--hub-text); }
.rank-item__value { font-size: 13px; font-weight: 700; color: var(--hub-text); }
.rank-item__value.negative { color: var(--hub-red); }
.rank-item__value.positive { color: var(--hub-green); }

/* ---- Marketing ---- */

.channel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 980px) { .channel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .channel-grid { grid-template-columns: 1fr; } }

.channel-card { border: 1px solid var(--hub-border-soft); border-radius: var(--hub-radius-sm); padding: 18px; background: var(--hub-panel); box-shadow: var(--hub-shadow-sm); }
.channel-card__name { font-weight: 700; font-size: 13.5px; margin-bottom: 12px; color: var(--hub-text); }
.channel-card__row { display: flex; justify-content: space-between; font-size: 12px; color: var(--hub-text-muted); padding: 4px 0; }
.channel-card__row strong { color: var(--hub-text); font-weight: 700; }
.channel-card__roas { font-size: 20px; font-family: Georgia, serif; color: var(--hub-accent-dark); margin: 6px 0; }

/* ---- subtabs generyczne (Allegro/Shopify moduly) ---- */

.subtab-grid { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.subtab { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--hub-border); background: var(--hub-panel); color: var(--hub-text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; }
.subtab.is-active { background: var(--hub-accent-dark); border-color: var(--hub-accent-dark); color: #fff; }

.recommend-strip { background: var(--hub-active-bg); border: 1px solid var(--hub-border-soft); border-radius: var(--hub-radius-sm); padding: 16px 18px; margin-top: 20px; }
.recommend-strip__title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12.5px; color: var(--hub-accent-dark); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.recommend-strip ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--hub-text); line-height: 1.7; }

/* ======================================================================
   ETAP 9 -- Product Master: karta produktu, wyszukiwarka, kreator 8 krokow.
   ====================================================================== */

/* ---- wiersze tabeli klikalne (przejscie do karty produktu) ---- */

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--hub-active-bg); }

/* ---- pasek wyszukiwania nad tabela produktow ---- */

.table-search-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.table-search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--hub-border); border-radius: 999px;
  padding: 8px 14px; background: var(--hub-panel);
  flex: 1; max-width: 420px; color: var(--hub-text-faint);
}
.table-search input {
  border: none; outline: none; background: none; font-family: inherit;
  font-size: 13px; color: var(--hub-text); flex: 1; padding: 0;
}

/* ---- karta produktu: siatka klucz-wartosc (Informacje/Cena/Produkcja/AI) ---- */

.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; }
@media (max-width: 900px) { .kv-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kv-grid { grid-template-columns: 1fr; } }

.kv-row { display: flex; flex-direction: column; gap: 3px; }
.kv-row__key { font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--hub-text-faint); }
.kv-row__value { font-size: 13.5px; color: var(--hub-text); line-height: 1.5; }

/* ---- karta produktu: siatka mediow ---- */

.media-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 980px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }

.media-tile {
  border: 1px dashed var(--hub-border); border-radius: var(--hub-radius-sm);
  padding: 16px 10px; text-align: center; background: var(--hub-panel-alt);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.media-tile__icon { color: var(--hub-text-faint); }
.media-tile__label { font-size: 11px; font-weight: 600; color: var(--hub-text); }

/* ============ ETAP HUB ONLINE v0.1: logowanie + ladowanie ============ */
/* hub-shell zostaje ukryty, dopoki js/auth.js nie doda klasy .is-ready --
   czyli dopoki uzytkownik nie jest zalogowany I stan nie zostal zaladowany
   (z API lub, awaryjnie, z lokalnego cache) -- brief pkt 6. */

.hub-shell:not(.is-ready) { display: none; }

.hub-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hub-bg);
  padding: 24px;
}

/* Bug fix (HUB PREVIEW): powyzsza reguła .hub-auth-overlay ma display:flex
   i jako regula autora wygrywa nad domyslnym [hidden]{display:none}
   przegladarki, wiec gdy JS (auth.js) ustawia atrybut hidden na ekranie
   logowania/ladowania, nakladka i tak zostawala widoczna nad Dashboardem.
   Ta regula przywraca priorytet atrybutowi hidden. */
.hub-auth-overlay[hidden] { display: none !important; }

.hub-auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--hub-panel);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.hub-auth-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--hub-accent-soft);
  margin-bottom: 10px;
}

.hub-auth-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--hub-text);
  margin: 0;
}

.hub-auth-sub {
  font-size: 13px;
  color: var(--hub-text-muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.hub-auth-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 18px;
  text-align: left;
}
.hub-auth-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--hub-text-faint);
}
.hub-auth-field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--hub-radius-sm);
  border: 1px solid var(--hub-border);
  background: var(--hub-panel-alt);
  color: var(--hub-text);
  font-size: 13.5px;
  font-family: inherit;
}
.hub-auth-field input:focus {
  outline: none;
  border-color: var(--hub-accent);
}

.hub-auth-submit { width: 100%; justify-content: center; }

.hub-auth-error {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--hub-red);
  background: var(--hub-red-bg);
  border-radius: var(--hub-radius-sm);
  padding: 8px 12px;
  width: 100%;
}

.hub-auth-status {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--hub-text-muted);
}

.hub-loading-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--hub-border-soft);
  border-top-color: var(--hub-accent);
  animation: hub-spin 0.8s linear infinite;
}
@keyframes hub-spin { to { transform: rotate(360deg); } }

/* ============ ETAP HUB ONLINE v0.1: wskaznik synchronizacji ============ */

.hub-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--hub-border);
  background: var(--hub-panel);
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.hub-sync-indicator__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hub-text-faint);
  flex-shrink: 0;
}
.hub-sync-indicator__label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--hub-text-muted);
  white-space: nowrap;
}

.hub-sync-indicator.is-synced .hub-sync-indicator__dot { background: var(--hub-green); }
.hub-sync-indicator.is-synced .hub-sync-indicator__label { color: var(--hub-green); }

.hub-sync-indicator.is-syncing .hub-sync-indicator__dot {
  background: var(--hub-blue);
  animation: hub-pulse 1s ease-in-out infinite;
}
.hub-sync-indicator.is-syncing .hub-sync-indicator__label { color: var(--hub-blue); }

.hub-sync-indicator.is-error { border-color: var(--hub-red); background: var(--hub-red-bg); }
.hub-sync-indicator.is-error .hub-sync-indicator__dot { background: var(--hub-red); }
.hub-sync-indicator.is-error .hub-sync-indicator__label { color: var(--hub-red); }

.hub-sync-indicator.is-offline .hub-sync-indicator__dot { background: var(--hub-text-faint); }

@keyframes hub-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (max-width: 700px) {
  .hub-sync-indicator__label { display: none; }
  .hub-sync-indicator { padding: 8px; }
}
.media-tile__count { font-size: 10.5px; color: var(--hub-text-faint); }

/* ---------------------------------------------------------------------
 * MOCARZ PRO -- HUB / BIBLIOTEKA CZCIONEK (KROK 3)
 * Modal "Dodaj czcionkę" (Google Fonts / Własny plik). Nowy, samodzielny
 * blok klas -- nic powyżej w tym pliku nie zostało zmienione. Modal
 * korzysta z istniejącego .modal-backdrop/.modal-panel (patrz wyżej), tu
 * tylko rozszerzamy .modal-panel dla wariantu font-modal (szerszy niż
 * domyślne 360px) i dodajemy klasy specyficzne dla zawartości tego modala.
 * --------------------------------------------------------------------- */
.font-modal { max-width: 480px; text-align: left; }

.font-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.font-modal__tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hub-border);
}
.font-modal__tab {
  padding: 8px 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--hub-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.font-modal__tab.is-active { color: var(--hub-accent-dark); border-bottom-color: var(--hub-accent-dark); }

.font-modal__body { max-height: 60vh; overflow-y: auto; }

.font-modal__results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  max-height: 260px;
  overflow-y: auto;
}

.font-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  background: var(--hub-panel);
}
.font-picker-item.is-selected { border-color: var(--hub-accent-dark); background: var(--hub-accent-bg, rgba(150, 100, 60, 0.06)); }
.font-picker-item__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.font-picker-item__name { font-size: 13.5px; font-weight: 700; color: var(--hub-text); margin: 0; }
.font-picker-item__sample { font-size: 20px; color: var(--hub-text); margin: 0; line-height: 1.2; }

.font-modal__preview {
  margin: 14px 0;
  padding: 14px;
  border: 1px dashed var(--hub-border);
  border-radius: 8px;
  text-align: center;
}
.font-modal__preview-name { font-size: 12.5px; font-weight: 700; color: var(--hub-text-muted); margin: 0 0 6px; }
.font-modal__preview-sample { font-size: 26px; color: var(--hub-text); margin: 8px 0 0; }

.font-modal__dropzone {
  border: 2px dashed var(--hub-border);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--hub-text-muted);
  margin-bottom: 10px;
}
.font-modal__dropzone.is-dragover { border-color: var(--hub-accent-dark); background: rgba(150, 100, 60, 0.05); }
.font-modal__dropzone p { margin: 4px 0; }

.font-modal__file-summary { margin-bottom: 10px; }
.font-modal__ready-hint { margin: 10px 0; }

.font-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hub-border);
}
@media (max-width: 480px) {
  .font-modal__footer { flex-direction: column-reverse; }
  .font-modal__footer .btn { width: 100%; justify-content: center; }
}
