/* =========================
   BASE / VARIABLES
========================= */
html { scrollbar-gutter: stable both-edges; }
html, body { overflow-x: hidden; }

:root{
  --primary:#007bff;
  --primary-dark:#0056b3;
  --bg:#f5f5f5;
  --surface:#ffffff;
  --border:#e0e0e0;
  --top-bar-height: 112px;
}

*{ box-sizing:border-box; }

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin:0;
  padding:0;
  background-color:var(--bg);
  background-image:
    radial-gradient(circle at 10px 10px, rgba(0,123,255,0.07) 1.5px, transparent 0),
    radial-gradient(circle at 30px 30px, rgba(0,123,255,0.05) 1.5px, transparent 0);
  background-size:40px 40px;
  color:#222;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* =========================
   TABLE SYSTEM (ONE PLACE)
========================= */
.table-wrapper{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

table{
  width: max-content;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 13px;
}

th, td{
  border:1px solid var(--border);
  padding:6px 8px;
  text-align:center;
  white-space:nowrap;
}

th{
  background:#fafafa;
  font-weight:600;
}

/* Ujednolicone: dashboard + simulations (tabela zawsze „pełna” w wrapperze) */
.dashboard-page .table-wrapper table,
.simulations-page .table-wrapper table{
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
}

/* Empty-state (global) */
.no-results{
  text-align: center;
  padding: 20px;
  font-style: italic;
  color: #6b7280;
}

/* =========================
   BUTTONS (ONE SYSTEM)
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration:none;
  color: inherit;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor:pointer;
  transition:all 0.15s ease;
}

.btn-primary{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover{ background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-secondary{
  background:#f3f4f6;
  color:#111827;
  border-color:#e5e7eb;
}
.btn-secondary:hover{ background:#e5e7eb; }

.btn-danger{
  background:#dc2626;
  color:#fff;
  border-color:#dc2626;
}
.btn-danger:hover{ background:#b91c1c; border-color:#b91c1c; }

.btn-ghost{ background:#fff; }

/* „soft” – mniej agresywne w tabelach */
.btn-danger-soft{
  background: transparent;
  color: #dc2626;
  border: 1px solid rgba(220,38,38,.35);
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
}
.btn-danger-soft:hover{ background: rgba(220,38,38,.08); }

.btn-soft{
  background: transparent;
  color: #0b5ed7;
  border: 1px solid rgba(11,94,215,.35);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
}
.btn-soft:hover{ background: rgba(11,94,215,.08); }

.btn-soft.is-disabled,
.btn-soft:disabled,
.btn.is-disabled,
.btn:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* =========================
   NAV BUTTONS (PILLS)
========================= */
.nav-button{
  background-color:var(--primary);
  color:#fff;
  text-decoration:none;
  padding:8px 14px;
  border-radius:999px;
  font-size:14px;
  border:none;
  cursor:pointer;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.nav-button:hover{ background-color:var(--primary-dark); }

.nav-button.secondary{
  background-color:#eef2f6;
  color:#1f2937;
  border:1px solid var(--border);
}
.nav-button.secondary:hover{ background-color:#dce4ee; }

.nav-button.is-disabled{
  background-color:#e5e7eb;
  color:#9ca3af;
  cursor:default;
}

/* =========================
   TOP BAR / NAV (ONE SYSTEM)
========================= */
.top-bar{
  position:sticky;
  top:0;
  z-index:1000;
  background:#fff;
  border-bottom:1px solid var(--border);
  padding:8px 16px;
}

.top-bar-inner{
  max-width:1200px;
  margin:0 auto;
  display:grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "logo auth"
    "menu menu";
  align-items:center;
  gap:10px 16px;
}

.logo{
  display:flex;
  align-items:center;
  grid-area:logo;
  min-width:0;
}
.logo img{
  height:48px;
  width:auto;
  max-width:100%;
  display:block;
}

.nav-links--auth{
  display:flex;
  grid-area:auth;
  width:auto;
  justify-content:flex-end;
  justify-self:end;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.nav-links--main{
  display:flex;
  grid-area:menu;
  width:100%;
  min-width:0;
  gap:8px;
  flex-wrap:wrap;
  overflow:visible;
  white-space:normal;
  align-items:center;
  justify-content:flex-start;
}

.nav-profile{
  display:inline-flex;
  align-items:center;
  gap:10px;
}

/* hamburger */
.nav-menu-toggle{
  display:none;
  grid-area: unset;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  background:#eef2f6;
  color:#1f2937;
  border:1px solid var(--border);
  border-radius:10px;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
  flex-shrink:0;
}
.nav-menu-toggle:hover{ background:#dce4ee; }

/* badges */
.account-badge{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  font-size:12px;
  font-weight:600;
  border-radius:999px;
  border:1px solid transparent;
}
.account-badge--free{
  background:#f3f4f6;
  color:#374151;
  border-color:#e5e7eb;
}
.account-badge--registered{
  background:#e7f2ff;
  color:#0f52ba;
  border-color:#c7ddff;
}
.account-badge--premium{
  background:#fef3c7;
  color:#92400e;
  border-color:#fcd34d;
}

/* language switch */
.lang-switch{
  display:inline-flex;
  gap:4px;
  padding:2px 6px;
  border-radius:999px;
  background:#eef2f6;
  border:1px solid var(--border);
  align-items:center;
}

.lang-btn{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:16px;
  line-height:1;
  padding:2px 4px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
}

.lang-flag{
  width:18px;
  height:18px;
  display:inline-block;
  vertical-align:middle;
  object-fit:contain;
}

.lang-btn.is-active{ background:#e0e7ff; }
.lang-btn .lang-code{ display:none; }
.lang-btn.no-flag .lang-code{
  display:inline;
  font-size:12px;
  font-weight:700;
  padding:0 6px;
}

/* =========================
   LAYOUT
========================= */
#sidebar-anchor{ display:none; height:0; }

.layout{
  padding:16px;
}

.layout-inner{
  max-width:1200px;
  margin:0 auto;
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  gap:16px;
}

/* Unified page shells + headers */
.page-shell{
  max-width: 980px;
  margin: 0 auto;
}

.page-header{
  text-align: center;
  margin: 0 auto 20px;
  padding: 12px 16px;
}

.page-kicker{
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 6px;
}

.page-title{
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.page-subtitle{
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.content-card{
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.layout-inner,
.sidebar,
.main { min-width: 0; }

.layout-inner.no-sidebar{ grid-template-columns:1fr; }
.layout-inner.no-sidebar .sidebar{ display:none; }

.sidebar{
  background:var(--surface);
  border-radius:12px;
  padding:16px;
  box-shadow:0 1px 3px rgba(0,0,0,0.06);
  border:1px solid var(--border);
}
.sidebar.is-collapsed{ display:none; }

.sidebar h3{
  margin-top:0;
  margin-bottom:12px;
  font-size:16px;
}

.sidebar label{
  font-size:13px;
  margin-top:8px;
  display:block;
}

.sidebar input:not([type="checkbox"]):not([type="radio"]),
.sidebar select,
.sidebar button{
  width:100%;
  padding:8px 10px;
  margin-top:4px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:14px;
}

/* checkboxy */
.sidebar input[type="checkbox"],
.sidebar input[type="radio"]{
  width:auto;
  padding:0;
  margin:0;
  border:none;
  border-radius:0;
}

.sidebar button{ 
  margin-top:12px; 
  background:var(--primary); 
  color:#fff; 
  border:none; 
  cursor:pointer; 
}
.sidebar button:hover{ background:var(--primary-dark); }

.filters-form.is-locked fieldset{
  opacity:0.55;
  pointer-events:none;
  cursor:not-allowed;
}

.filters-locked-note{
  display:flex;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  margin-bottom:8px;
  border-radius:8px;
  background:#f3f4f6;
  color:#374151;
  font-weight:600;
  border:1px dashed #d1d5db;
}

.main{
  background:var(--surface);
  border-radius:12px;
  padding:16px;
  box-shadow:0 1px 3px rgba(0,0,0,0.06);
  border:1px solid var(--border);
  overflow:hidden;
}

.filter-toggle{
  display:none;
  align-items:center;
  justify-content:space-between;
  background:var(--primary);
  color:#fff;
  border:none;
  border-radius:10px;
  padding:10px 12px;
  font-weight:600;
  cursor:pointer;
}
.filter-toggle span{ font-size:13px; opacity:0.9; }

/* =========================
   TILES
========================= */
.tiles{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:8px;
  margin-bottom:12px;
}

.kafelek{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  padding:6px 10px;
  border-radius:10px;
  background:var(--primary);
  color:#fff;
  font-size:14px;
  font-weight:600;
  border:1px solid transparent;
  min-height:36px;
  box-shadow:0 4px 8px rgba(0,123,255,0.08);
}

.kafelek .kafelek-label{
  font-size:12px;
  letter-spacing:0.02em;
  text-transform:uppercase;
  opacity:0.9;
}

.kafelek .kafelek-value{
  font-size:16px;
  font-weight:700;
  white-space:nowrap;
}

.kafelek.is-locked{
  background:#f3f4f6;
  color:#6b7280;
  border-color:#e5e7eb;
  box-shadow:none;
}
.kafelek.is-locked .kafelek-value{ color:#9ca3af; }
.tiles--locked .kafelek{ cursor:not-allowed; }

h3.section-title{
  margin-top:0;
  margin-bottom:8px;
  font-size:16px;
}

/* =========================
   MODAL
========================= */
#postawModal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  justify-content:center;
  align-items:center;
  z-index:20;
}

.modal-content{
  background:#fff;
  padding:16px;
  border-radius:10px;
  width:320px;
  box-shadow:0 2px 8px rgba(0,0,0,0.2);
  font-size:14px;
}

.modal-content label{
  display:block;
  margin-top:8px;
  font-size:13px;
}

.modal-content input{
  width:100%;
  padding:8px 10px;
  margin-top:4px;
  border-radius:6px;
  border:1px solid var(--border);
}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
}

/* modal buttons */
.zapisz, .wroc{
  padding:6px 14px;
  border-radius:999px;
  border:none;
  cursor:pointer;
  font-size:13px;
}
.zapisz{ background:var(--primary); color:#fff; }
.zapisz:hover{ background:var(--primary-dark); }
.wroc{ background:#e0e0e0; }

/* =========================
   TOOLTIP
========================= */
.login-tooltip{
  position:fixed;
  background:#fff;
  padding:10px 14px;
  border-radius:8px;
  box-shadow:0 4px 16px rgba(0,0,0,0.15);
  border:1px solid #d1d5db;
  font-size:13px;
  max-width:220px;
  z-index:99999999;
  display:none;
  opacity:0;
  transform:translateY(-4px);
  transition:opacity 0.15s ease, transform 0.15s ease;
}

.login-tooltip.visible{
  display:block;
  opacity:1;
  transform:translateY(0);
}

.login-tooltip .lt-header{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:600;
  margin-bottom:4px;
}

.login-tooltip .lt-btn{
  margin-top:8px;
  padding:5px 10px;
  border-radius:999px;
  background:var(--primary);
  color:#fff;
  text-align:center;
  display:inline-block;
  font-size:12px;
  cursor:pointer;
}

/* =========================
   FOOTER
========================= */
.site-footer{
  margin-top:auto;
  background:#fff;
  border-top:1px solid var(--border);
  padding:16px;
}

.footer-inner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.footer-links{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}

.footer-links a{
  font-size:13px;
  color:#374151;
  text-decoration:none;
}
.footer-links a:hover{ text-decoration:underline; }

.footer-copy{
  font-size:12px;
  color:#6b7280;
}

/* =========================
   PROFILE (HEADER + OVERVIEW + PREMIUM)
========================= */
.profil-page .main { padding: 0; }

.profil-page .profile-content{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.profil-page .profile-header{
  padding:16px;
  border-bottom:1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius:12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.profil-page .profile-header__left h2{
  margin:0;
  font-size:22px;
}

.profil-page .profile-header__left p{
  margin:6px 0 0;
  color:#4a5568;
  font-size:14px;
}

.profil-page .profile-header__right{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

.profil-page .profile-header__btn{ min-height:40px; }

.profil-page .section-card{
  background:#ffffff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px;
  box-shadow:0 1px 3px rgba(0,0,0,0.05);
}

.profil-page .account-overview{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.profil-page .account-overview__title h3{
  margin:0;
  font-size:16px;
}

.profil-page .account-overview__title .muted-text{
  margin:6px 0 0;
  color:#4b5563;
  font-size:13px;
}

.profil-page .account-overview__grid{
  display:grid;
  gap:12px;
  align-items:stretch;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.profil-page .account-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow:0 1px 2px rgba(0,0,0,.04);
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height: 120px;
}

.profil-page .account-card__head{
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.profil-page .account-card__head > div{ min-width: 0; }

.profil-page .account-card__actions{
  margin-top:auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.profil-page .account-card__actions .nav-button{
  width:100%;
  min-height:40px;
  justify-content:center;
  text-align:center;
  border:1px solid var(--border);
}

.profil-page .account-ico{
  width:34px;
  height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eef2ff;
  border:1px solid #e5e7eb;
  flex:0 0 auto;
  font-size:16px;
}

.profil-page .account-label{
  margin:0;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:#6b7280;
}

.profil-page .account-value{
  margin:2px 0 0;
  font-size:16px;
  font-weight:800;
  color:#111827;
}

.profil-page .account-value--email{
  font-size:13px;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.profil-page .account-meta{
  margin:6px 0 0;
  font-size:12px;
  color:#6b7280;
}

.profil-page .nav-button--status{
  width:100%;
  justify-content:center;
  border-radius:999px;
  border:1px solid var(--border);
}

.profil-page .nav-button--premium{
  background:#fef3c7;
  color:#92400e;
  border-color:#fcd34d;
}

.profil-page .nav-button--registered{
  background:#e7f2ff;
  color:#0f52ba;
  border-color:#c7ddff;
}

.profil-page .premium-cta--clean{
  border: 1px solid #fcd34d;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  display:flex;
  gap:14px;
  align-items:stretch;
  justify-content:space-between;
}

.profil-page .premium-cta__left{
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.profil-page .premium-cta__badge{
  width:38px;
  height:38px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(252,211,77,.25);
  border: 1px solid rgba(252,211,77,.55);
  flex:0 0 auto;
  font-size:18px;
}

.profil-page .premium-cta-title{
  margin:0;
  font-size:16px;
  font-weight:900;
  color:#111827;
}

.profil-page .premium-cta-desc{
  margin:6px 0 0;
  font-size:14px;
  color:#4b5563;
  line-height:1.4;
}

.profil-page .premium-cta-bullets{
  margin:10px 0 0;
  padding-left:18px;
  color:#374151;
  font-size:13px;
}

.profil-page .premium-cta__right{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-end;
  justify-content:center;
  flex-shrink:0;
}

.profil-page .premium-cta-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  font-weight:900;
  background:#111827;
  color:#fff;
  text-decoration:none;
  border:1px solid #111827;
  transition: transform .12s ease, opacity .12s ease;
  white-space:nowrap;
  min-height:42px;
}
.profil-page .premium-cta-button:hover{ transform: translateY(-1px); opacity:.96; }

.profil-page .premium-cta-note{
  font-size:12px;
  color:#6b7280;
  margin:0;
  text-align:right;
}

/* =========================
   PROFILE FORMS
========================= */
.profil-page .section-header{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:12px;
  flex-wrap:wrap;
}

.profil-page .section-header h3{ margin:0; font-size:16px; }

.profil-page .badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#2f3b8f;
  font-weight:600;
  font-size:12px;
}

.profil-page .muted-chip{
  padding:4px 10px;
  background:#f1f5f9;
  color:#4b5563;
  border-radius:999px;
  font-size:12px;
}

.profil-page .muted-text{
  color:#4b5563;
  font-size:14px;
  margin:0 0 12px;
}

.profil-page .profile-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap:12px;
}

.profil-page .form-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap:12px;
  margin-top:8px;
}

.profil-page .form-field label{
  display:block;
  font-size:13px;
  font-weight:600;
  margin-bottom:6px;
  color:#1f2937;
}

.profil-page .form-field input,
.profil-page .form-field select{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  font-size:14px;
  background:#fafafa;
}

.profil-page .form-field input:focus,
.profil-page .form-field select:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 2px rgba(0, 123, 255, 0.1);
  background:#fff;
}

.profil-page .actions-inline{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
}

.profil-page .primary-button{
  padding:10px 16px;
  background:var(--primary);
  color:#fff;
  border:none;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
  transition: background 0.2s ease;
}
.profil-page .primary-button:hover{ background:var(--primary-dark); }

.profil-page .helper-text{
  margin:4px 0 0;
  font-size:12px;
  color:#6b7280;
}

/* =========================
   PREFERENCES TILES (profil)
========================= */
.profil-page .tile-section{ display:grid; gap:12px; }

.profil-page .tile-group{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background:#fafafa;
}

.profil-page .tile-group-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
  flex-wrap:wrap;
}

.profil-page .tile-group-header h4{ margin:0; font-size:15px; }
.profil-page .tile-group-header p{ margin:0; color:#4b5563; font-size:13px; }

.profil-page .tile-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap:8px;
}

.profil-page .preference-tile{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:600;
  text-align:center;
  cursor:pointer;
  transition: all 0.15s ease-in-out;
  color:#1f2937;
}

.profil-page .preference-tile:hover{ background:#f3f4f6; }

.profil-page .preference-tile.active{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
  box-shadow:0 4px 10px rgba(0, 123, 255, 0.25);
}

.profil-page .final-actions{ text-align:right; }

/* =========================
   MARKETING SWITCH
========================= */
.bw-switch{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.bw-switch input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bw-slider{
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #fecaca;
  border-color: #fca5a5;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

.bw-slider::after{
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  transform: translateY(-50%);
  transition: transform .15s ease;
}

.bw-switch input:checked + .bw-slider{
  background: #dcfce7;
  border-color: #86efac;
}

.bw-switch input:checked + .bw-slider::after{
  transform: translate(20px, -50%);
}

.bw-switch:active .bw-slider::after{ width: 22px; }

/* =========================
   NEWS PAGE
========================= */
.news-page .main { padding: 0; }

.news-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.news-badge{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  opacity: .9;
}

.news-badge .dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.news-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.news-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.news-card.featured{
  display:grid;
  grid-template-columns: 1.1fr 1.4fr;
}

.news-media{
  position: relative;
  min-height: 220px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.news-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}

.news-media-placeholder{
  height: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 6px;
  padding: 22px;
  text-align:center;
}

.news-media-icon{ font-size: 30px; }
.news-media-title{ font-weight: 700; font-size: 18px; }

.news-tag{
  position:absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,123,255,.10);
  border: 1px solid rgba(0,123,255,.25);
  font-size: 12px;
  font-weight: 600;
}

.news-body{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.news-meta{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  opacity: .75;
  flex-wrap: wrap;
}

.news-sep{ opacity: .6; }

.news-pin{
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: #fff;
}

.news-tag-inline{
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  opacity: .95;
}

.news-title{
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.news-excerpt{
  margin: 0;
  line-height: 1.55;
  opacity: .9;
}

.news-content{
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.news-list{
  margin: 0;
  padding-left: 18px;
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.news-note{
  margin: 10px 0 0;
  opacity: .85;
  line-height: 1.55;
}

.news-footer{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* =========================
   CONTENT PAGES (Guide/Legal/Contact)
========================= */
.guide-page h1,
.legal-page h1,
.contact-page h1{
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 12px;
}

.guide-page h2,
.legal-page h2,
.contact-page h2{
  font-size: 18px;
  line-height: 1.35;
  margin: 18px 0 8px;
}

.guide-page p,
.legal-page p,
.contact-page p,
.guide-page li,
.legal-page li,
.contact-page li{
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 10px;
}

.guide-wrap,
.legal-wrap,
.contact-wrap{
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 12px 28px;
}

.guide-lead,
.legal-lead,
.contact-lead{
  opacity: 0.85;
  margin-bottom: 14px;
}

.guide-list,
.legal-list,
.contact-list{
  padding-left: 18px;
  margin: 6px 0 0;
}

.guide-section + .guide-section,
.legal-section + .legal-section,
.contact-section + .contact-section{
  margin-top: 16px;
}

.guide-subsection{ margin-top: 12px; }

.content-card{
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.content-box{
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.content-link{
  font-weight: 800;
  text-decoration: none;
}

.content-card--dark{
  background: #0b1220;
  color: #e5e7eb;
}
.content-card--dark h2{ color: #ffffff; }

.guide-two-col{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-features{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* =========================
   PRICING (Premium page)
========================= */
.pricing-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.pricing-card{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pricing-image{
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.pricing-content{
  display: flex;
  flex-direction: column;
}

.pricing-title{ font-weight: 700; font-size: 15px; }
.pricing-price{ font-size: 20px; font-weight: 800; margin-top: 2px; }
.pricing-note{ font-size: 12px; opacity: .75; margin-top: 4px; }
.pricing-meta{ font-size:12px; opacity:.7; margin-top:6px; }

.pricing-tag{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-block;
  line-height: 1.2;
}

.pricing-tag--best{
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #67e8f9;
}
.pricing-tag--balance{
  background: #f5f3ff;
  color: #4c1d95;
  border: 1px solid #ddd6fe;
}
.pricing-tag--try{
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

/* Premium: ukryj filtry */
.premium-page #sidebar-filters,
.premium-page #filter-open,
.premium-page #filters-drawer,
.premium-page #drawer-backdrop{
  display: none !important;
}

/* =========================
   MATCH CALENDAR PAGE
========================= */
.calendar-page .calendar-container{
  max-width: 980px;
  margin: 0 auto;
}

.calendar-page .calendar-title{
  text-align: center;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 600;
}

.calendar-page .date-block{
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.calendar-page .date-header{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.calendar-page .date-main{ font-weight: 600; font-size: 20px; }
.calendar-page .date-count{ font-size: 12px; color: #6b7280; }

.calendar-page .matches-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.calendar-page .match-card{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f9fafb;
}

.calendar-page .match-time-liga{
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.calendar-page .match-time{ font-weight: 600; }
.calendar-page .match-time--tbd{ opacity: 0.7; font-style: italic; }

.calendar-page .match-league{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.calendar-page .match-teams{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.calendar-page .match-teams .team{
  max-width: 80px;
  text-align: center;
}

.calendar-page .match-teams .vs{
  font-size: 11px;
  text-transform: uppercase;
  color: #9ca3af;
}

.calendar-page .match-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
}

.calendar-page .tag{
  padding: 2px 6px;
  border-radius: 999px;
  background: #e5f0ff;
  color: #1f2937;
}

.calendar-page .tag--secondary{ background: #f3f4f6; }

.calendar-page .no-results{
  text-align: center;
  margin-top: 24px;
  color: #6b7280;
}

/* =========================
   RESULTS / BOOKMAKER OVERVIEW
========================= */
.results-page .results-container{
  max-width: 980px;
  margin: 0 auto;
}

.results-page .results-container h3{
  text-align: center;
  margin-bottom: 20px;
}

.results-page .results-table{
  width: 100%;
  border-collapse: collapse;
}

/* =========================
   LEAGUE RANKING (HISTORICAL)
========================= */
.league-ranking-page .results-container{
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

.league-ranking-page .results-note{
  font-size:12px;
  opacity:.7;
  margin-bottom:8px;
  text-align: center;
}

.league-ranking-page .section-title{
  text-align: left;
  margin: 10px 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  opacity: .9;
}

.league-ranking-page .kpi-bar{
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  align-items: stretch;
  margin: 6px 0 14px 0;
  flex-wrap: wrap;
}

.league-ranking-page .kpi-card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 120px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.league-ranking-page .kpi-card.is-reco{
  border-color: #2e7d32;
  background: #f1fff3;
}

.league-ranking-page .kpi-title{
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
  line-height: 1.1;
}

.league-ranking-page .kpi-value{
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.league-ranking-page .kpi-meta{
  font-size: 11px;
  color: #888;
  margin-top: 3px;
  white-space: nowrap;
}

.league-ranking-page .results-table{ width: 100%; }

/* =========================
   PAGINATION
========================= */
.pagination{
  margin: 15px 0;
  text-align: center;
}

/* =========================
   DANGER ZONE (ONE PLACE)
========================= */
.danger-zone{
  margin:32px 0;
  padding:20px;
  background:linear-gradient(120deg, rgba(220, 38, 38, 0.08), rgba(255, 255, 255, 0.9));
  border:1px solid #fecdd3;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.danger-zone__label{
  margin:0;
  color:#b91c1c;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.05em;
  font-size:12px;
}

.danger-zone__text{ margin:6px 0 0; color:#991b1b; }
.danger-zone__actions{ display:flex; align-items:center; gap:12px; }

.delete-account{ max-width:640px; margin:0 auto; padding:20px; }

.delete-account__warning{
  padding:12px 14px;
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#991b1b;
  border-radius:8px;
}

.delete-account__form{ display:flex; flex-direction:column; gap:12px; margin-top:16px; }

.delete-account__form input[type="password"]{
  padding:10px;
  border:1px solid var(--border);
  border-radius:8px;
  font-size:14px;
}

.checkbox-group label{
  display:flex;
  gap:8px;
  align-items:flex-start;
  color:#111827;
}

.form-errors{
  margin:16px 0;
  padding:12px;
  border-radius:8px;
  border:1px solid #fecaca;
  background:#fef2f2;
  color:#991b1b;
}

.form-errors ul{ margin:0; padding-left:18px; }
.form-actions{ display:flex; gap:12px; align-items:center; }

/* =========================
   FILTER DRAWER (MOBILE ONLY)
========================= */
.filters-drawer{
  position: fixed;
  top: var(--top-bar-height, 112px);
  left: 0;
  right: 0;
  bottom: 0;

  background: var(--surface);
  z-index: 3000;

  transform: translateY(100%);
  transition: transform .2s ease;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 30px rgba(0,0,0,.18);
}

.filters-drawer.is-open{ transform: translateY(0); }

.drawer-header{
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  z-index: 1;
  border-radius: 16px 16px 0 0;
}

.drawer-close{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight:700;
}

.drawer-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 2500;
}

#filters-drawer .drawer-body{
  padding: 14px;
  background: var(--bg);
}

#filters-drawer #sidebar-filters{
  display:block;
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

#filters-drawer .drawer-grab{
  display:block;
  width:46px;
  height:5px;
  border-radius:999px;
  background:#d1d5db;
  margin: 6px auto 10px;
}

#filters-drawer .sidebar input,
#filters-drawer .sidebar select{ background:#fafafa; }
#filters-drawer .sidebar input:focus,
#filters-drawer .sidebar select:focus{ background:#fff; }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px){

  .layout-inner > #sidebar-filters{ display:none !important; }
  table{ min-width: 500px; }

  .top-bar-inner{
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo toggle"
      "auth auth";
    align-items:center;
  }

  .logo img{ height:40px; max-width:100%; }

  .nav-menu-toggle{
    display:inline-flex;
    grid-area:toggle;
    justify-self:end;
  }

  .nav-links--main{ display:none; }

  .nav-links--main.is-open{
    display: grid;
    grid-auto-rows: max-content;
    grid-template-columns: max-content;
    justify-items: stretch;

    position: fixed;
    top: calc(var(--top-bar-height, 112px) + 8px);
    right: 12px;

    z-index:9999;
    gap:6px;
    padding:10px;

    border:1px solid var(--border);
    border-radius:12px;
    box-shadow:0 10px 24px rgba(0,0,0,0.12);
    background:#fff;

    width: max-content;
    max-width: calc(100vw - 24px);

    max-height: calc(100vh - (var(--top-bar-height, 112px) + 24px));
    overflow-y:auto;
  }

  .nav-links--main.is-open .nav-button{
    width: 100%;
    justify-content: center;
    padding-inline: 22px;
    background: rgba(0,123,255,0.14);
    color:#0f172a;
  }
  .nav-links--main.is-open .nav-button:hover{
    background:rgba(0,123,255,0.22);
  }

  .nav-links--auth{
    justify-content:center;
    align-items:center;
    width:100%;
    text-align:center;
  }

  .layout{ padding: 8px; }

  .layout-inner{
    grid-template-columns:1fr;
    gap:12px;
    width:100%;
    max-width:100%;
  }

  .main{
    width:100%;
    overflow: visible;
  }

  .filter-toggle{ display:inline-flex; }

  .news-wrap{ max-width:100%; width:100%; }

  .site-footer{
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .footer-inner{ justify-content:center; text-align:center; }
  .footer-links{ justify-content:center; }
}

@media (max-width: 600px){

  .profil-page .main { padding: 12px; }

  .actions-inline,
  .final-actions{
    text-align:center;
    justify-content:center;
  }

  .guide-features{ grid-template-columns: 1fr; }
  .guide-two-col{ grid-template-columns: 1fr; }

  .pricing-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 900px){
  .guide-features{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 901px){
  .filters-drawer,
  .drawer-backdrop,
  .filter-toggle{
    display:none !important;
  }
}

/* =========================
   PROFILE RESPONSIVE
========================= */
@media (max-width: 980px){
  .profil-page .account-overview__grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px){
  .profil-page .account-overview__grid{ grid-template-columns: 1fr; }

  .profil-page .premium-cta--clean{ flex-direction:column; }
  .profil-page .premium-cta__right{ align-items:stretch; }
  .profil-page .premium-cta-note{ text-align:left; }

  .profil-page .profile-header{
    flex-direction:column;
    align-items:flex-start;
  }
  .profil-page .profile-header__right{
    width:100%;
    justify-content:flex-start;
  }
}