/* Zmienne kolorów - nasz "Deep Ocean" i neonowe akcenty */
:root {
  --bg-color: #0B101E; /* Głęboki granat/czerń */
  --sidebar-bg: #111827;
  --neon-cyan: #00D4FF;
  --glass-bg: rgba(17, 24, 39, 0.6);
  --glass-border: rgba(0, 212, 255, 0.15);
  --text-main: #FFFFFF;
  --text-muted: #9CA3AF;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden; /* Wyłączamy główny scroll, scrolluje się tylko prawa strona */
}

.app-container {
  display: flex;
  height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 220px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.logo h2 {
  color: var(--neon-cyan);
  margin-bottom: 40px;
  font-size: 20px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;           /* Odstęp między ikoną a tekstem */
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 15px;
}

/* ==========================================================
   ANIMACJE IKON W MENU BOCZNYM (Micro-interactions)
   ========================================================== */

/* Ustawiamy płynne przejście bazowe dla wszystkich ikon */
.nav-item svg {
    transition: transform 0.3s ease, color 0.3s ease;
    transform-origin: center; /* Animacje kręcą się wokół środka ikony */
}

/* 1. Dashboard (Kafelki) - Delikatne pulsowanie */
@keyframes navPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.nav-item[data-target="view-dashboard"]:hover svg {
    animation: navPulse 0.5s ease-in-out;
}

/* 2. Stocks (Wykres) - "Zwyżka" giełdowa (skok w prawo i w górę) */
@keyframes navTrendUp {
    0% { transform: translate(0, 0); }
    50% { transform: translate(2px, -2px); }
    100% { transform: translate(0, 0); }
}
.nav-item[data-target="view-stocks"]:hover svg {
    animation: navTrendUp 0.5s ease-in-out;
}

/* 3. Kolekcje (Teczka) - Wibracja (otwieranie) */
@keyframes navWiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}
.nav-item[data-target="view-collections"]:hover svg {
    animation: navWiggle 0.5s ease;
}

/* 4. Connected Apps (Wtyczka) - Efekt "podłączania" (wciśnięcie) */
@keyframes navPlugIn {
    0% { transform: translateY(0); }
    50% { transform: translateY(3px); }
    100% { transform: translateY(0); }
}
.nav-item[data-target="view-apps"]:hover svg {
    animation: navPlugIn 0.4s ease-in-out;
}

/* 5. Billing (Karta Kredytowa) - Przeciągnięcie karty (Swipe) */
@keyframes navSwipe {
    0% { transform: translateX(0); }
    50% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}
.nav-item[data-target="view-billing"]:hover svg {
    animation: navSwipe 0.5s ease-in-out;
}

/* 6. Calendar (Kalendarz) - Tik-Tak (upływ czasu) */
@keyframes navTickTock {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}
.nav-item[data-target="view-calendar"]:hover svg {
    animation: navTickTock 0.5s ease-in-out;
}

/* 7. Settings (Zębatka) - Płynny obrót o 90 stopni */
.nav-item[data-target="view-settings"]:hover svg {
    transform: rotate(90deg);
}
.nav-item[data-target="view-settings"]:hover svg {
    animation: navSpin 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 8. Support (Koło ratunkowe) - Unoszenie się na wodzie */
@keyframes navFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.nav-item[data-target="view-support"]:hover svg {
    animation: navFloat 1s ease-in-out infinite;
}

/* 9. Rejestr KNF (Dokument) - Wyciągnięcie do przodu */
@keyframes navLift {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}
.nav-item[data-target="view-knf"]:hover svg {
    animation: navLift 0.4s ease-in-out;
}

.nav-item:hover, .nav-item.active {
  background-color: rgba(0, 212, 255, 0.1);
  color: var(--neon-cyan);
}

/* --- PARTNER PROJEKTU (BUENA CLOUD) --- */
.sidebar-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.partner-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.partner-logo-link {
  display: block;
  background: rgba(255, 255, 255, 0.9); /* Jasne tło, by ciemne napisy z logo były czytelne */
  padding: 12px 15px;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.partner-logo-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.2);
}

.partner-logo {
  max-width: 140px;
  display: block;
  filter: contrast(1.1); /* Delikatne wyostrzenie kolorów chmury */
}

/* --- MAIN CONTENT --- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --- SZKLANY HEADER (Glassmorphism) --- */
.glass-header {
  height: 70px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px); /* Efekt rozmycia tła pod paskiem */
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-bar input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  border-radius: 6px;
  color: white;
  width: 250px;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--neon-cyan);
}

.market-status {
  display: flex;
  align-items: center;
  gap: 15px; /* Odstęp między giełdami */
}

.market-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* Podświetlamy tekst na biało, gdy giełda jest otwarta */
.market-badge.is-open {
  color: var(--text-main);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.dot.open {
  background-color: #10B981; /* Zielony */
  box-shadow: 0 0 8px #10B981;
}

.dot.closed {
  background-color: #EF4444; /* Czerwony */
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); /* Słabsza poświata dla zamkniętego */
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bell-icon {
  font-size: 20px;
  cursor: pointer;
}

.avatar {
  width: 35px;
  height: 35px;
  background-color: #374151;
  border-radius: 50%;
}

.plan-badge {
  background: rgba(0, 212, 255, 0.15);
  color: var(--neon-cyan);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid var(--neon-cyan);
}

/* --- OBSZAR ROBOCZY --- */
.workspace {
  padding: 30px;
  flex: 1;
  overflow-y: auto; /* Pozwala na scrollowanie zawartości */
}

.workspace h1 {
  margin-bottom: 20px;
  color: var(--text-main);
}

/* Ukrywamy wszystkie widoki domyślnie */
.view {
  display: none;
  animation: fadeIn 0.3s ease; /* Delikatne pojawianie się */
}

/* Pokazujemy tylko ten z klasą active */
.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* --- KAFELEK ESPI (Glassmorphism) --- */
.feed-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px; /* Nie chcemy, żeby kafelek rozciągał się na całą szerokość monitora */
  margin-top: 20px;
}

.espi-card {
  background: rgba(255, 255, 255, 0.06); /* Minimalnie jaśniejsze tło (wcześniej było 0.03) */
  border: 1px solid rgba(0, 212, 255, 0.2); /* Odrobinę mocniejsza ramka (wcześniej było 0.15) */
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.espi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.08); /* Delikatna poświata przy najechaniu */
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.sentiment-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.sentiment-dot.positive { background-color: #10B981; box-shadow: 0 0 8px #10B981; }
.sentiment-dot.negative { background-color: #EF4444; box-shadow: 0 0 8px #EF4444; }
.sentiment-dot.neutral { background-color: #6B7280; }

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.ticker {
  background: rgba(0, 212, 255, 0.1);
  color: var(--neon-cyan);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
}

.card-title h2 {
  font-size: 18px;
  color: var(--text-main);
}

.card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
}

.card-excerpt {
  color: #D1D5DB;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Podświetlanie słów kluczowych */
.hl-green { color: #10B981; font-weight: bold; }
.hl-red { color: #EF4444; font-weight: bold; }

.card-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-read {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-read:hover {
  background: rgba(0, 212, 255, 0.1);
}
/* --- ANIMOWANE TŁO --- */
#tsparticles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* Bardzo ważne: tło musi być pod spodem! */
}

/* --- POWIADOMIENIA NA ŻYWO (TOASTY) --- */
.toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 9999; /* Musi być zawsze na wierzchu */
  pointer-events: none; /* Żeby niewidzialny kontener nie blokował klikania */
}

.toast {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-left: 4px solid var(--neon-cyan); /* Wyróżniający lewy pasek */
  padding: 15px 20px;
  border-radius: 8px;
  min-width: 300px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto; /* Sam kafelek jest klikalny */
  
  /* Animacja wjazdu */
  animation: slideInRight 0.4s ease forwards;
}

/* Klasa dodawana przez JS tuż przed usunięciem */
.toast.removing {
  animation: fadeOutRight 0.4s ease forwards;
}

.toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.toast-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 4px;
}

/* Definicje animacji */
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* --- ZAKŁADKA STOCKS --- */
.add-stock-container {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  max-width: 800px;
}

.stock-search-input {
  flex: 1;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 15px;
  outline: none;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}

.stock-search-input:focus {
  border-color: var(--neon-cyan);
}

.btn-primary {
  background: rgba(0, 212, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  padding: 0 25px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1000px;
}

.stock-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.stock-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.stock-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.company-name {
  color: var(--text-muted);
  font-size: 13px;
}

.stock-price-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
}

.price-data {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.current-price {
  font-weight: bold;
  font-size: 15px;
  color: var(--text-main);
}

.price-change {
  font-size: 12px;
  font-weight: bold;
}

.price-change.positive { color: #10B981; }
.price-change.negative { color: #EF4444; }
.price-change.neutral { color: #6B7280; }

.btn-icon.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
  border-radius: 6px;
  transition: all 0.2s;
  opacity: 0.3; /* Kosz jest zgaszony dopóki nie najedziesz myszką */
}

.stock-card:hover .delete-btn {
  opacity: 1; /* Kosz pojawia się przy hoverze */
}

.btn-icon.delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* --- LIVE SEARCH DROPDOWN --- */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: calc(100% - 110px); /* Szerokość inputa bez przycisku */
  margin-top: 8px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none; /* Domyślnie ukryte */
  flex-direction: column;
  max-height: 250px;
  overflow-y: auto;
}

.search-result-item {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(0, 212, 255, 0.15);
}

.search-result-item .ticker {
  font-weight: bold;
  color: var(--neon-cyan);
  background: rgba(0, 212, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 10px;
}

.search-result-item .name {
  color: var(--text-main);
  font-size: 14px;
}

/* --- ZAKŁADKA CONNECTED APPS --- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 25px;
  max-width: 1000px;
}

.app-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* Wyróżnienie połączonej aplikacji */
.app-card.active-connection {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.03);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.05);
}

.app-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.app-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  border-radius: 8px;
}

.app-title-group h2 {
  font-size: 18px;
  color: var(--text-main);
}

.status-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 12px;
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid #10B981;
}

.status-badge.disconnected {
  background: rgba(107, 114, 128, 0.15);
  color: #9CA3AF;
  border: 1px solid #6B7280;
}

.app-description {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 25px;
}

.webhook-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.webhook-input {
  flex: 1;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  border-radius: 8px;
  color: white;
  outline: none;
}

.webhook-input:focus {
  border-color: var(--neon-cyan);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- ZAKŁADKA BILLING --- */
.usage-banner {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.usage-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  border-radius: 4px;
}

/* Przełącznik */
.billing-toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
}

.toggle-label {
  color: var(--text-muted);
  font-weight: bold;
  transition: color 0.3s;
}

.toggle-label.active { color: var(--text-main); }

.discount-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 5px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.2);
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: var(--neon-cyan);
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: rgba(0, 212, 255, 0.1); }
input:checked + .slider:before { transform: translateX(24px); }

/* Karty cenowe */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.pricing-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 30px 20px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease;
}

.pricing-card:hover { transform: translateY(-5px); }

.pricing-card.pro-plan {
  background: rgba(0, 212, 255, 0.03);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.1);
  transform: scale(1.02);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--neon-cyan);
  color: #000;
  font-weight: bold;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 12px;
}

.plan-name { text-align: center; color: var(--text-main); margin-bottom: 15px; }
.plan-price { text-align: center; margin-bottom: 25px; }
.plan-price .amount { font-size: 36px; font-weight: bold; color: var(--text-main); margin: 0 5px; }
.plan-price .currency, .plan-price .period { color: var(--text-muted); font-size: 14px; }

.plan-features {
  list-style: none;
  margin-bottom: 30px;
  flex: 1;
}

.plan-features li {
  font-size: 13px;
  color: #D1D5DB;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-features li.disabled { opacity: 0.4; filter: grayscale(100%); }

.pricing-card button { margin-top: auto; padding: 10px; width: 100%; }

/* Tabela faktur */
.invoices-container {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.invoices-table { width: 100%; border-collapse: collapse; text-align: left; }
.invoices-table th { background: rgba(255, 255, 255, 0.05); padding: 15px 20px; color: var(--text-muted); font-size: 13px; font-weight: normal; }
.invoices-table td { padding: 15px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-main); font-size: 14px; }
.invoices-table tr:last-child td { border-bottom: none; }
.invoices-table .btn-icon { font-size: 14px; opacity: 0.7; }
.invoices-table .btn-icon:hover { opacity: 1; }

/* --- ZAKŁADKA SETTINGS --- */
.settings-section-title {
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 15px;
  margin-top: 30px;
}

.settings-section-title.danger-text { color: #EF4444; }

.settings-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  max-width: 800px;
}

.settings-card.danger-zone {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.03);
}

.profile-info-row {
  display: flex;
  align-items: center;
  padding: 0;
}

.profile-avatar-large {
  width: 60px;
  height: 60px;
  background: var(--neon-cyan);
  color: #000;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  margin-right: 20px;
}

.profile-details { flex: 1; }
.profile-details h3 { font-size: 18px; color: var(--text-main); margin-bottom: 5px; }
.profile-details p { color: var(--text-main); font-size: 14px; margin-bottom: 2px; }
.profile-details .login-method { color: var(--text-muted); font-size: 12px; }

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-row:last-child { border-bottom: none; }

.settings-text h4 { font-size: 15px; color: var(--text-main); margin-bottom: 5px; }
.settings-text p { font-size: 13px; color: var(--text-muted); }

.settings-select {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 10px 15px;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  cursor: pointer;
}
.settings-select:focus { border-color: var(--neon-cyan); }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid #EF4444;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}
/* --- PROFIL SPÓŁKI --- */
.glass-panel {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 25px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-title-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ticker.large-ticker {
  font-size: 18px;
  padding: 6px 12px;
}

.profile-actions-group {
  display: flex;
  align-items: center;
  gap: 25px;
}

.chart-container {
  height: 350px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px dashed rgba(0, 212, 255, 0.3); /* Przerywana ramka oznaczająca miejsce na wykres */
}

/* --- SZKLANY MODAL (CZYTNIK RAPORTÓW) --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(11, 16, 30, 0.75); /* Przyciemnienie tła aplikacji */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999; /* Zawsze na samej górze */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 850px;
  max-height: 85vh; /* Nigdy nie wyjdzie poza ekran */
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  margin-bottom: 0; /* reset z klasy glass-panel */
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.modal-title-group { display: flex; align-items: center; gap: 15px; }
.modal-title-group h2 { color: var(--text-main); font-size: 20px; }

.close-btn {
  font-size: 20px; color: var(--text-muted); cursor: pointer;
  background: none; border: none; transition: color 0.2s;
}
.close-btn:hover { color: #EF4444; }

.modal-meta { 
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; color: var(--text-muted); font-size: 13px; 
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  color: #D1D5DB;
  line-height: 1.8;
  font-size: 15px;
  padding-right: 15px; /* miejsce na pasek przewijania */
}

/* Stylowanie paska przewijania (Scrollbar) wewnątrz czytnika */
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.6); }

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* --- DASHBOARD GRID (Dwukolumnowy układ) --- */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px; /* Lewa elastyczna, prawa na sztywno 320px */
  gap: 40px;
  align-items: start; /* KLUCZOWE: zapobiega niepotrzebnemu rozciąganiu w dół */
}

.dashboard-main {
  max-width: 900px;
}

.dashboard-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;

  /* --- NOWOŚĆ: Niezależny scroll dla prawego panelu --- */
  max-height: calc(100vh - 110px); /* 100% ekranu minus wysokość headera i marginesy */
  overflow-y: auto; /* Włącza scrollowanie tylko w pionie */
  padding-right: 5px; /* Daje miejsce na suwak, żeby nie nachodził na ramki */
}

/* --- NOWOŚĆ: Cienki, elegancki suwak tylko dla tego paska (Chrome/Edge/Safari) --- */
.dashboard-sidebar::-webkit-scrollbar {
  width: 4px;
}
.dashboard-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.dashboard-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.2);
  border-radius: 4px;
}
.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.5); /* Rozświetla się przy najechaniu */
}

/* --- NOWOŚĆ: Responsywność dla ekranów 1080p i laptopów --- */
@media (max-width: 1400px) {
  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) 280px; /* Węższy panel na mniejszych ekranach */
    gap: 25px; /* Mniejszy odstęp */
  }
}

/* Kafelki widżetów */
.widget-panel {
  padding: 20px;
  margin-bottom: 0; /* nadpisuje domyślny margin z glass-panel */
}

.widget-title {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

/* Widżet Statusu */
.system-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
}

.status-indicator.blinking {
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { opacity: 1; box-shadow: 0 0 8px #10B981; }
  50% { opacity: 0.4; box-shadow: 0 0 2px #10B981; }
  100% { opacity: 1; box-shadow: 0 0 8px #10B981; }
}

.system-stats {
  display: flex;
  justify-content: space-between;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label { font-size: 11px; color: var(--text-muted); }
.stat-value { font-size: 14px; color: var(--text-main); font-weight: bold; }

/* Widżet Filtrów */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.chip.active {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* --- ZAŁĄCZNIKI (FEED I MODAL) --- */
.tag.attachment-tag {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

.attachment-download-link {
  display: flex;
  align-items: center;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 12px 15px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  max-width: 400px;
}

.attachment-download-link:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

.attachment-icon {
  font-size: 24px;
  margin-right: 15px;
}

.attachment-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.attachment-name {
  color: var(--neon-cyan);
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 3px;
}

.attachment-size {
  color: var(--text-muted);
  font-size: 12px;
}

.download-icon {
  font-size: 18px;
  opacity: 0.7;
}
.attachment-download-link:hover .download-icon {
  opacity: 1;
}

/* --- ZAKŁADKA KALENDARZ (HEATMAPA) --- */
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px; /* Heatmapa elastyczna, feed na 400px */
  gap: 30px;
  align-items: start;
}

.heatmap-panel { padding: 30px; }

.heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.heatmap-legend { display: flex; align-items: center; gap: 5px; }

.heatmap-container {
  display: grid;
  grid-template-rows: repeat(7, 1fr); /* 7 rzędów = 7 dni tygodnia */
  grid-auto-flow: column; /* Kolejne dni wypełniają kolumny od góry do dołu */
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 15px;
}

/* Ukrywamy domyślny, brzydki scrollbar pod heatmapą */
.heatmap-container::-webkit-scrollbar { height: 6px; }
.heatmap-container::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
.heatmap-container::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 4px; }

.heatmap-cell, .legend-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.05); /* Pusty dzień */
  transition: transform 0.1s, border-color 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.heatmap-cell:hover {
  border-color: var(--neon-cyan);
  transform: scale(1.3); /* Przybliża kwadracik pod myszką */
  z-index: 10;
}

/* Skala kolorów (Odcienie Cyjanu) */
.level-0 { background-color: rgba(255, 255, 255, 0.05); } /* 0 raportów */
.level-1 { background-color: rgba(0, 212, 255, 0.2); }  /* Mało */
.level-2 { background-color: rgba(0, 212, 255, 0.5); }  /* Średnio */
.level-3 { background-color: rgba(0, 212, 255, 0.8); }  /* Dużo */
.level-4 { background-color: rgba(0, 212, 255, 1); box-shadow: 0 0 6px var(--neon-cyan); } /* "Gorący" dzień */

.months-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  color: var(--text-muted);
  font-size: 12px;
  padding-right: 20px;
}

.calendar-feed-panel {
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 25px;
  min-height: 500px;
  max-height: 700px;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

/* --- AI FEATURES (PREMIUM) --- */

/* Plakietki płatnych planów */
.badge-pro, .badge-plus {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}
.badge-pro { background: rgba(0, 212, 255, 0.2); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.badge-plus { background: rgba(168, 85, 247, 0.2); color: #A855F7; border: 1px solid #A855F7; }

/* AI na głównym Feedzie */
.ai-badge-inline {
  font-size: 11px;
  color: #A855F7;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

/* AI Ramka w Modalu */
.ai-summary-box {
  background: rgba(88, 28, 135, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
}

.ai-summary-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.ai-summary-list {
  color: #E9D5FF;
  font-size: 14px;
  line-height: 1.6;
  padding-left: 20px;
}
.ai-summary-list li { margin-bottom: 8px; }

/* --- PROFIL SPÓŁKI 2.0 (DWUKOLUMNOWY) --- */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 30px;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;

  /* Niezależny scroll */
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 5px;
}

.profile-sidebar::-webkit-scrollbar { width: 4px; }
.profile-sidebar::-webkit-scrollbar-track { background: transparent; }
.profile-sidebar::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.2); border-radius: 4px; }
.profile-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.5); }

/* Lista szczegółów kontaktowych */
.company-details-list {
  list-style: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.company-details-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 5px;
}
.detail-label { color: var(--text-muted); }
.detail-value { color: var(--text-main); font-weight: 500; text-align: right; }

/* Akcjonariat (Paski postępu) */
.shareholders-list { display: flex; flex-direction: column; gap: 15px; }
.shareholder-item { display: flex; flex-direction: column; gap: 6px; }
.shareholder-info { display: flex; justify-content: space-between; font-size: 13px; }
.sh-name { color: var(--text-main); }
.sh-percent { color: var(--neon-cyan); font-weight: bold; }
.sh-progress-bg {
  width: 100%; height: 6px; background: rgba(255, 255, 255, 0.1);
  border-radius: 3px; overflow: hidden;
}
.sh-progress-fill {
  height: 100%; background: var(--neon-cyan); border-radius: 3px;
  box-shadow: 0 0 8px var(--neon-cyan);
}

/* Tag Indeksów */
.indices-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.index-chip {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main); padding: 6px 12px;
  border-radius: 6px; font-size: 12px; cursor: pointer;
  transition: all 0.2s;
}
.index-chip:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  transform: translateY(-2px);
}

/* Modal Indeksów (Lista Spółek) */
.index-companies-list { display: flex; flex-direction: column; gap: 10px; }
.index-company-row {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 15px; border-radius: 8px; transition: background 0.2s;
}
.index-company-row:hover { background: rgba(255, 255, 255, 0.06); }
.company-basic-info { display: flex; align-items: center; gap: 12px; }
.company-basic-info .name { color: var(--text-main); font-size: 14px; }

/* --- ZAKŁADKA KOLEKCJE (WATCHLISTS) --- */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  padding: 25px;
  margin-bottom: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.collection-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.05);
}

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.collection-header h3 {
  font-size: 16px;
  color: var(--text-main);
  margin: 0;
}

.company-count {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 12px;
}

.collection-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
  flex: 1; /* Popycha stopkę na sam dół karty */
}

.collection-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 15px;
}

/* Plakietki powiadomień Webhook */
.webhook-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 6px;
}

.webhook-badge.discord { background: rgba(88, 101, 242, 0.15); color: #5865F2; border: 1px solid rgba(88, 101, 242, 0.3); }
.webhook-badge.slack { background: rgba(224, 30, 90, 0.15); color: #E01E5A; border: 1px solid rgba(224, 30, 90, 0.3); }
.webhook-badge.none { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.1); }

.btn-icon {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
  display: inline-flex; /* Wyrównuje ikonę do środka */
  align-items: center;
  justify-content: center;
  color: var(--text-muted); /* Zapewnia, że SVG odziedziczy odpowiedni kolor bazowy */
}

.btn-icon:hover {
  opacity: 1;
  color: var(--text-main); /* Ikona pojaśnieje przy najechaniu */
}

/* Wyjątek dla przycisku usuwania, by podświetlał się na czerwono! */
.btn-icon.delete-btn:hover,
.btn-icon.btn-delete-integration:hover {
  color: #EF4444 !important;
}

/* --- ANIMOWANY PASEK ESPI (TICKER TAPE) --- */
.espi-ticker-tape {
  width: 100%;
  background: rgba(11, 16, 30, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  display: flex;
  position: relative;
  z-index: 10;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-ticker 40s linear infinite;
}

/* Zatrzymanie paska, gdy najedziesz myszką (żeby móc przeczytać) */
.ticker-content:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  margin-right: 50px; /* Odstęp między raportami */
  font-size: 13px;
  color: #D1D5DB;
  cursor: pointer;
  transition: color 0.2s;
}

.ticker-item:hover { color: #fff; }

.ticker-time {
  color: var(--text-muted);
  margin-right: 10px;
  font-size: 11px;
}

.ticker-symbol {
  color: var(--neon-cyan);
  font-weight: bold;
  margin-right: 10px;
  background: rgba(0, 212, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Animacja przesuwania */
@keyframes scroll-ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } /* Przesuwamy o połowę, bo w JS sklonujemy zawartość */
}

/* --- LATA NAPRAWCZA (BUGFIX) --- */

/* 1. Zabezpieczenie szerokości (żeby pasek ESPI nie psuł prawej strony) */
.espi-ticker-tape {
  max-width: 100%;
  box-sizing: border-box;
}

/* Zabezpiecza główny obszar przed "rozpychaniem" przez animację */
.main-content {
  overflow-x: hidden;
}

/* 2. Zablokowanie rozciągania tickerów (żeby obramówki były małe i zgrabne) */
.ticker, .ticker-symbol {
  padding: 2px 6px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  height: fit-content !important; /* Blokuje rozciąganie w pionie! */
  white-space: nowrap !important;
}

/* Zapobiega psuciu się przycisków przez flexbox */
.btn-primary, .btn-secondary, .btn-read {
  height: fit-content !important;
}

/* --- ZAKŁADKA SUPPORT (FAQ i Feedback) --- */
.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 30px;
  align-items: start;
}

/* Formularz w stylu szklanym */
.feedback-form .form-group {
  margin-bottom: 15px;
}
.feedback-form label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 10px 15px;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

/* FAQ Akordeon */
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text-main);
  transition: color 0.2s;
}
.faq-question:hover { color: var(--neon-cyan); }
.faq-toggle { font-size: 10px; color: var(--text-muted); transition: transform 0.3s ease; }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
  color: #D1D5DB;
  font-size: 13px;
  line-height: 1.6;
}

/* Kiedy FAQ jest aktywne/otwarte */
.faq-item.active .faq-answer {
  max-height: 200px; /* Wysokość wystarczająca na rozwinięcie tekstu */
  margin-top: 15px;
}
.faq-item.active .faq-toggle {
  transform: rotate(180deg);
  color: var(--neon-cyan);
}

/* --- ZAKŁADKA REJESTR KNF (SHORTY) --- */
.knf-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.knf-stats-grid .stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.knf-stats-grid h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

.knf-stats-grid .stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.knf-stats-grid .stat-change {
  font-size: 12px;
}

/* Tabela KNF */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.knf-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.knf-table th {
  padding: 15px 20px;
  color: var(--text-muted);
  font-weight: normal;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.knf-table td {
  padding: 15px 20px;
  color: #D1D5DB;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.knf-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Kolory i znaczki (Badges) w tabeli */
.text-red { color: #EF4444; }
.text-green { color: #10B981; }

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 11px;
}
.badge-red { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.badge-neutral { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

/* --- LOGOTYPY SPÓŁEK --- */
.company-logo {
  width: 32px;
  height: 32px;
  object-fit: contain; /* Zachowuje proporcje, nie ucina logo */
  background: #ffffff; /* Białe tło pod logo, by ciemne logotypy były widoczne */
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
}

.company-logo-large {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

@keyframes slideDownFade {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.new-report-pulse {
    animation: slideDownFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: 1px solid var(--neon-cyan) !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    transition: border 2s ease, box-shadow 2s ease;
}

/* Baza dla wszystkich tagów */
.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Warianty kolorystyczne */
.tag.tag-cyan {
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--neon-cyan);
  background: rgba(0, 212, 255, 0.05);
}

.tag.tag-green {
  border-color: rgba(16, 185, 129, 0.4);
  color: #10B981;
  background: rgba(16, 185, 129, 0.05);
}

.tag.tag-purple {
  border-color: rgba(168, 85, 247, 0.4);
  color: #A855F7;
  background: rgba(168, 85, 247, 0.05);
}

.tag.tag-red {
  border-color: rgba(239, 68, 68, 0.4);
  color: #EF4444;
  background: rgba(239, 68, 68, 0.05);
}

/* Tagi generowane przez AI */
.tag-ai {
  border-color: rgba(168, 85, 247, 0.4); /* Fioletowy odcień AI */
  color: #c084fc;
  background: rgba(168, 85, 247, 0.05);
}

/* ==========================================================
   WIDOK AGENDY (KALENDARZ 2.0)
   ========================================================== */
.agenda-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 900px;
  padding-bottom: 50px;
}

.agenda-card {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(10px);
}

.agenda-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.3);
}

.agenda-date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding-right: 20px;
  border-right: 1px dashed rgba(255, 255, 255, 0.1);
  margin-right: 20px;
}

.agenda-day { font-size: 28px; font-weight: bold; color: var(--text-main); line-height: 1; }
.agenda-month { font-size: 12px; color: var(--neon-cyan); text-transform: uppercase; font-weight: bold; letter-spacing: 1px; margin-top: 4px;}
.agenda-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px;}

.agenda-content { flex: 1; }
.agenda-title { font-size: 16px; color: var(--text-main); margin-bottom: 8px; font-weight: bold; }
.agenda-company { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }

.agenda-actions { display: flex; gap: 10px; align-items: center; margin-left: 20px; }

/* ==========================================================
   ZABEZPIECZENIE AI (PAYWALL & TEASER)
   ========================================================== */
.ai-locked-wrapper {
    position: relative;
    background: rgba(168, 85, 247, 0.05);
    border-left: 2px solid #A855F7;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.ai-locked-content {
    filter: blur(5px);
    opacity: 0.5;
    user-select: none;
    pointer-events: none; /* Zapobiega kopiowaniu tekstu myszką */
}

.ai-locked-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.3); /* Lekkie przyciemnienie */
    z-index: 10;
}

.btn-unlock-ai {
    background: linear-gradient(90deg, #A855F7, var(--neon-cyan));
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    transition: transform 0.2s;
}

.btn-unlock-ai:hover {
    transform: scale(1.05);
}

.badge-teaser {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 6px;
    font-weight: bold;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================
   USTAWIENIA WIDOKU (TEXT vs AI)
   ========================================================== */
/* Gdy user chce tylko AI (domyślnie) - ukrywamy oryginalny tekst */
body.view-mode-ai .espi-view-text {
    display: none !important;
}

/* Gdy user chce tylko zwykły tekst - ukrywamy ramki AI */
body.view-mode-text .espi-view-ai {
    display: none !important;
}

/* Gdy user chce widzieć oba (oddzielamy je wizualnie) */
body.view-mode-both .espi-view-text {
    border-top: 1px dashed rgba(255,255,255,0.1);
    padding-top: 10px;
    margin-top: 10px;
}

/* ==========================================================
   EFEKT POWIĘKSZANIA LOGO SPÓŁKI (POP-OUT)
   ========================================================== */
.logo-hover-wrapper {
    position: relative;
    z-index: 1; /* Ustawiamy warstwę bazową */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efekt sprężyny */
    transform-origin: center center; /* Powiększa się idealnie ze środka */
    cursor: pointer;
    flex-shrink: 0;
}

.logo-hover-wrapper:hover {
    transform: scale(1.3); /* Powiększenie o 30% */
    z-index: 10; /* Unosi logo nad ewentualny tekst, żeby go nie ucinało */
}

/* Opcjonalnie: wzmacniamy cień samego obrazka podczas hovera */
.logo-hover-wrapper:hover img {
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3) !important;
}