/* ============================================================
   GSC Monitor — app.css  v1.0
   Kolejność: variables → base → components → page-specific
   ============================================================ */

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface2:  #21253a;
  --border:    #2d3148;
  --accent:    #4f8ef7;
  --accent2:   #7c5cbf;
  --text:      #e2e8f0;
  --text2:     #94a3b8;
  --text3:     #64748b;
  --green:     #22c55e;
  --red:       #ef4444;
  --orange:    #f59e0b;
  --radius:    12px;
  /* monitor – funnel colours */
  --tofu:      #4f8ef7;
  --mofu:      #a78bfa;
  --bofu:      #34d399;
  --high:      #ef4444;
  --medium:    #f59e0b;
  --low:       #64748b;
}

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

body {
  font-family: Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}
.navbar-left  { display: flex; align-items: center; gap: 32px; }
.navbar-brand {
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.navbar-brand span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-modules { display: flex; gap: 4px; }
.nav-module {
  padding: 7px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text2);
  cursor: pointer; text-decoration: none;
  transition: all .2s; border: 1px solid transparent;
}
.nav-module:hover          { color: var(--text); background: var(--surface2); }
.nav-module.active         { color: var(--text); background: var(--surface2); border-color: var(--border); }
.navbar-right              { display: flex; align-items: center; gap: 10px; }

/* account dropdown */
.account-wrap              { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); cursor: pointer;
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid transparent; transition: all .2s;
}
.account-btn:hover         { border-color: var(--border); background: var(--surface2); color: var(--text); }
.account-btn .avatar       { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); }
.account-btn .avatar-ph {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); display: flex;
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.account-btn .chevron      { font-size: 10px; color: var(--text3); transition: transform .2s; }
.account-btn.open .chevron { transform: rotate(180deg); }

.account-dd {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 270px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  z-index: 300; display: none; overflow: hidden;
}
.account-dd.open           { display: block; }
.dd-head {
  padding: 10px 14px; font-size: 11px; color: var(--text3);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; border-bottom: 1px solid var(--border);
}
.acc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background .15s; text-decoration: none; color: var(--text);
}
.acc-item:hover            { background: var(--surface2); }
.acc-item.active,
.acc-item.active-acc       { background: rgba(79,142,247,.1); }
.acc-av                    { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); }
.acc-av-ph {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); display: flex;
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.acc-info                  { flex: 1; min-width: 0; }
.acc-name                  { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-email                 { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-check                 { color: var(--accent); font-size: 14px; margin-left: auto; flex-shrink: 0; }
.dd-divider                { border: none; border-top: 1px solid var(--border); margin: 0; }
.dd-action {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--text2);
  text-decoration: none; transition: background .15s;
}
.dd-action:hover           { background: var(--surface2); }
.dd-action.danger:hover    { color: var(--red); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.main { max-width: 1300px; margin: 0 auto; padding: 28px 24px; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
}
.card-title {
  font-size: 13px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}

/* ── FILTERS ────────────────────────────────────────────────── */
.filters-row1 {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 16px; align-items: end; margin-bottom: 16px;
}
.filters-row2 {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border);
}
.form-group    { display: flex; flex-direction: column; gap: 6px; }
.form-label    { font-size: 12px; color: var(--text3); font-weight: 500; }
.form-control {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 8px;
  font-size: 14px; font-family: Inter, sans-serif;
  transition: border-color .2s; width: 100%;
}
.form-control:focus        { outline: none; border-color: var(--accent); }
.form-control option       { background: var(--surface2); }

/* ── QUICK DATES ────────────────────────────────────────────── */
.quick-dates   { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-quick {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 14px; border-radius: 8px;
  font-size: 13px; cursor: pointer; font-family: Inter, sans-serif;
  transition: all .2s; white-space: nowrap;
}
.btn-quick:hover,
.btn-quick.active          { background: var(--accent); border-color: var(--accent); color: #fff; }

.date-range    { display: flex; gap: 10px; align-items: center; }
.date-click-wrap { position: relative; cursor: pointer; }
.date-click-wrap input { pointer-events: none; opacity: .45; transition: opacity .2s; width: 160px; }
.date-click-wrap.unlocked input { pointer-events: auto; opacity: 1; }
.date-sep      { color: var(--text3); font-size: 13px; }

.compare-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.checkbox-wrap { display: flex; align-items: center; gap: 8px; }
.checkbox-wrap input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.checkbox-wrap label { font-size: 13px; color: var(--text2); cursor: pointer; white-space: nowrap; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #fff; padding: 11px 28px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: Inter, sans-serif; transition: opacity .2s, transform .1s;
  white-space: nowrap; height: 42px;
}
.btn-primary:hover         { opacity: .9; transform: translateY(-1px); }
.btn-primary:disabled      { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 11px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: Inter, sans-serif; transition: all .2s; height: 42px; white-space: nowrap;
}
.btn-secondary:hover       { border-color: var(--accent); color: var(--accent); }
.btn-secondary:disabled    { opacity: .5; cursor: not-allowed; }

.btn-export {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: Inter, sans-serif; transition: all .2s;
}
.btn-export:hover          { border-color: var(--green); color: var(--green); }

.btn-png {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 16px; border-radius: 8px;
  font-size: 13px; cursor: pointer; font-family: Inter, sans-serif; transition: all .2s;
}
.btn-png:hover             { border-color: var(--accent); color: var(--accent); }
.btn-png:disabled          { opacity: .5; cursor: not-allowed; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert         { padding: 14px 18px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-info    { background: rgba(79,142,247,.1); border: 1px solid rgba(79,142,247,.3); color: #93c5fd; font-size: 12px; padding: 10px 16px; border-radius: 8px; margin-top: 12px; }
.alert-error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }

/* ── CHARTS ─────────────────────────────────────────────────── */
.charts-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.charts-section-title      { font-size: 14px; font-weight: 600; }
.charts-stack              { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.chart-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.chart-label               { font-size: 14px; font-weight: 600; }
.chart-hint                { font-size: 11px; font-weight: 400; color: var(--text3); background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px; margin-left: 8px; vertical-align: middle; }
.chart-legend              { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item               { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); }
.legend-dot                { width: 10px; height: 10px; border-radius: 50%; }
.chart-canvas              { height: 220px !important; }

/* ── TABS ───────────────────────────────────────────────────── */
.data-tabs-wrap            { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 0; }
.data-tabs-header {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surface2); padding: 0 8px;
}
.data-tab {
  padding: 14px 20px; font-size: 14px; font-weight: 500;
  color: var(--text3); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s;
  user-select: none; display: flex; align-items: center; gap: 8px;
}
.data-tab:hover            { color: var(--text); }
.data-tab.active           { color: var(--text); border-bottom-color: var(--accent); }
.tab-badge {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text3); font-size: 11px; padding: 2px 7px;
  border-radius: 10px; font-weight: 600; transition: all .3s;
}
.data-tab.active .tab-badge.has-canib { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.data-tab-panel            { display: none; padding: 24px; }
.data-tab-panel.active     { display: block; }

/* ── TABLE ──────────────────────────────────────────────────── */
.table-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-box    { position: relative; min-width: 260px; }
.search-box .form-control  { padding-left: 36px; padding-right: 70px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 14px; pointer-events: none;
}
.search-hint {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text3); pointer-events: none;
  background: var(--surface2); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
}
.table-info    { font-size: 13px; color: var(--text3); white-space: nowrap; }
.table-wrap    { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table          { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--surface2); color: var(--text3); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  padding: 12px 16px; text-align: left; cursor: pointer; user-select: none;
  white-space: nowrap; border-bottom: 1px solid var(--border); transition: color .2s;
}
thead th:hover                        { color: var(--text); }
thead th.sort-asc::after              { content: ' ↑'; color: var(--accent); }
thead th.sort-desc::after             { content: ' ↓'; color: var(--accent); }
tbody tr                              { border-bottom: 1px solid rgba(45,49,72,.6); transition: background .15s; }
tbody tr:last-child                   { border-bottom: none; }
tbody tr:hover                        { background: rgba(79,142,247,.05); }
tbody td                              { padding: 11px 16px; vertical-align: middle; }
.td-url  { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); font-size: 12px; }
.td-url a { color: var(--text3); text-decoration: none; transition: color .15s; }
.td-url a:hover { color: var(--accent); text-decoration: underline; }
.td-query { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-kw    { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.td-kw:hover { color: var(--accent); }
.td-r     { text-align: right; font-variant-numeric: tabular-nums; }
.td-c     { text-align: center; }
.badge-up   { color: var(--green); font-size: 12px; }
.badge-down { color: var(--red);   font-size: 12px; }
.badge-same { color: var(--text3); font-size: 12px; }

/* position badges – dashboard */
.pos-badge   { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 12px; }
.pos-top3    { background: rgba(34,197,94,.15);  color: #4ade80; }
.pos-top10   { background: rgba(79,142,247,.15); color: #93c5fd; }
.pos-top20   { background: rgba(245,158,11,.15); color: #fcd34d; }
.pos-low     { background: rgba(100,116,139,.15);color: #94a3b8; }

/* position badges – monitor */
.p1 { background: rgba(34,197,94,.15);  color: #4ade80; }
.p2 { background: rgba(79,142,247,.15); color: #93c5fd; }
.p3 { background: rgba(245,158,11,.15); color: #fcd34d; }
.p4 { background: rgba(100,116,139,.15);color: #94a3b8; }
.p0 { background: rgba(100,116,139,.1); color: #475569; font-style: italic; }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination    { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pg-info       { font-size: 13px; color: var(--text3); margin-right: auto; }
.btn-pg {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); padding: 6px 8px; border-radius: 6px;
  font-size: 13px; cursor: pointer; font-family: Inter, sans-serif;
  transition: all .2s; min-width: 36px; text-align: center; white-space: nowrap;
}
.btn-pg:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-pg:disabled              { opacity: .4; cursor: not-allowed; }
.btn-pg.active                { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-pg-num    { width: 36px; padding: 6px 0; }

/* ── LOADER / SPINNER ───────────────────────────────────────── */
.loader        { display: none; text-align: center; padding: 48px; color: var(--text3); font-size: 14px; }
.spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state   { text-align: center; padding: 48px; color: var(--text3); }
.empty-icon    { font-size: 40px; margin-bottom: 12px; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 24px; color: var(--text3);
  font-size: 12px; border-top: 1px solid var(--border); margin-top: 24px;
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 20px; font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4); z-index: 999;
  transform: translateY(80px); opacity: 0; transition: all .3s; pointer-events: none;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.ok      { border-color: rgba(34,197,94,.4);  color: #86efac; }
.toast.err     { border-color: rgba(239,68,68,.4);  color: #fca5a5; }

/* ── BADGES (funnel / priority) ─────────────────────────────── */
.badge         { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.badge-tofu    { background: rgba(79,142,247,.18);  color: #93c5fd; }
.badge-mofu    { background: rgba(167,139,250,.18); color: #c4b5fd; }
.badge-bofu    { background: rgba(52,211,153,.18);  color: #6ee7b7; }
.badge-high    { background: rgba(239,68,68,.18);   color: #fca5a5; }
.badge-medium  { background: rgba(245,158,11,.18);  color: #fcd34d; }
.badge-low     { background: rgba(100,116,139,.18); color: #94a3b8; }

/* ── DASHBOARD – kanibalizacja ──────────────────────────────── */
.canib-header-row  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.canib-threshold-label { font-size: 12px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.canib-stats       { display: flex; gap: 14px; flex-wrap: wrap; }
.canib-stat {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 20px; min-width: 140px;
}
.canib-stat .cs-val  { font-size: 24px; font-weight: 700; color: var(--red); }
.canib-stat .cs-lbl  { font-size: 12px; color: var(--text3); margin-top: 2px; }
.canib-stat.is-btn   { cursor: pointer; transition: transform .15s, border-color .2s, background .2s; user-select: none; position: relative; }
.canib-stat.is-btn:hover               { border-color: rgba(239,68,68,.5); transform: translateY(-2px); }
.canib-stat.is-btn.active              { border-color: rgba(239,68,68,.7); background: rgba(239,68,68,.08); }
.canib-stat.is-btn .cs-val             { transition: color .2s; }
.canib-stat.is-btn:hover .cs-val,
.canib-stat.is-btn.active .cs-val      { color: #ff6b6b; }
.canib-stat.is-btn .pick-hint {
  position: absolute; bottom: 6px; right: 10px;
  font-size: 10px; color: var(--text3); opacity: 0; transition: opacity .2s;
}
.canib-stat.is-btn:hover .pick-hint,
.canib-stat.is-btn.active .pick-hint   { opacity: 1; }
.canib-stat.is-btn.active .pick-hint   { color: rgba(239,68,68,.6); }

.canib-row         { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.canib-row-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface2); cursor: pointer; transition: background .15s; gap: 12px;
}
.canib-row-head:hover      { background: rgba(239,68,68,.07); }
.canib-phrase              { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canib-meta                { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.canib-count               { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }
.canib-chevron             { color: var(--text3); font-size: 11px; transition: transform .2s; }
.canib-row.open .canib-chevron { transform: rotate(180deg); }
.canib-urls                { display: none; border-top: 1px solid var(--border); }
.canib-row.open .canib-urls { display: block; }
.canib-url-head,
.canib-url-row             { display: grid; grid-template-columns: 1fr 90px 90px 100px 80px; gap: 8px; padding: 8px 16px; font-size: 12px; }
.canib-url-head            { background: rgba(45,49,72,.4); font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.canib-url-row             { align-items: center; padding: 10px 16px; border-bottom: 1px solid rgba(45,49,72,.5); }
.canib-url-row:last-child  { border-bottom: none; }
.canib-url-row:hover       { background: rgba(79,142,247,.04); }
.canib-url-link            { color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── MONITOR – table filters ────────────────────────────────── */
.table-filters {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 14px 16px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
}
.filter-label  { font-size: 12px; color: var(--text3); font-weight: 500; white-space: nowrap; }
.filter-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 6px 12px; border-radius: 6px; font-size: 13px;
  font-family: Inter, sans-serif; cursor: pointer;
}
.filter-select:focus       { outline: none; border-color: var(--accent); }
.filter-reset {
  font-size: 12px; color: var(--text3); cursor: pointer;
  padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border);
  background: none; font-family: Inter, sans-serif; transition: all .15s;
}
.filter-reset:hover        { color: var(--text); border-color: var(--text3); }

/* ── MONITOR – keyword management ───────────────────────────── */
.kw-manage-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; }
.kw-add-form    { display: flex; flex-direction: column; gap: 12px; }
.kw-add-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
textarea.form-control { resize: vertical; min-height: 140px; line-height: 1.6; }
.kw-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.kw-list-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.kw-list-wrap   { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; padding-right: 2px; }
.kw-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; transition: border-color .15s;
}
.kw-item:hover             { border-color: rgba(239,68,68,.3); }
.kw-item-text  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-item-badges { display: flex; gap: 4px; flex-shrink: 0; }
.kw-date       { font-size: 11px; color: var(--text3); flex-shrink: 0; }
.btn-del {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px;
  transition: color .15s; line-height: 1; flex-shrink: 0;
}
.btn-del:hover             { color: var(--red); }
.kw-empty      { text-align: center; padding: 32px; color: var(--text3); font-size: 13px; }
.kw-stat       { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.kw-stat-item  { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: 12px; color: var(--text3); text-align: center; min-width: 80px; }
.kw-stat-item strong { display: block; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 2px; }

/* ── MONITOR – import zone ──────────────────────────────────── */
.import-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.import-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 28px 28px 20px; text-align: center; cursor: pointer;
  transition: all .2s; position: relative; overflow: hidden;
}
.import-zone:hover,
.import-zone.drag          { border-color: var(--accent); background: rgba(79,142,247,.05); }
.import-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.import-zone-icon          { font-size: 32px; margin-bottom: 8px; pointer-events: none; }
.import-zone-text          { font-size: 13px; color: var(--text3); line-height: 1.6; pointer-events: none; }
.import-zone-text strong   { color: var(--text); }
.import-template-wrap      { text-align: center; margin-top: 10px; }
.import-template {
  font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: none;
  background: var(--surface2); border: 1px solid var(--border);
  font-family: Inter, sans-serif; padding: 6px 14px; border-radius: 6px;
  display: inline-block; transition: all .2s;
}
.import-template:hover     { border-color: var(--accent); background: rgba(79,142,247,.1); }
.import-preview            { margin-top: 16px; display: none; }
.import-preview-title      { font-size: 12px; color: var(--text3); margin-bottom: 8px; font-weight: 600; }
.import-preview-table      { width: 100%; border-collapse: collapse; font-size: 12px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.import-preview-table th   { background: var(--surface2); padding: 6px 10px; text-align: left; color: var(--text3); font-weight: 600; font-size: 11px; }
.import-preview-table td   { padding: 6px 10px; border-top: 1px solid rgba(45,49,72,.5); color: var(--text2); }
.import-actions            { display: flex; gap: 10px; margin-top: 12px; }

/* ── MONITOR – kw chart header ──────────────────────────────── */
.kw-chart-header  { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kw-chart-phrase  { background: rgba(79,142,247,.15); border: 1px solid rgba(79,142,247,.3); color: #93c5fd; padding: 4px 12px; border-radius: 6px; font-size: 13px; }
.btn-close-chart  { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 18px; margin-left: auto; padding: 4px 8px; border-radius: 4px; transition: color .15s; }
.btn-close-chart:hover { color: var(--text); }

/* ── INDEX (login page) ─────────────────────────────────────── */
body.page-login {
  display: flex; align-items: center; justify-content: center;
}
body.page-login .card {
  text-align: center; max-width: 380px; width: 100%;
  padding: 48px 40px;
}
.logo          { font-size: 40px; margin-bottom: 16px; }
h1             { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
h1 span {
  background: linear-gradient(135deg, #4f8ef7, #7c5cbf);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
p              { font-size: 14px; color: #64748b; margin-bottom: 32px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; color: #1a1a1a; padding: 14px 24px; border-radius: 10px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.btn-google:hover          { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,142,247,.25); }
.btn-google svg            { width: 20px; height: 20px; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .kw-manage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .filters-row1   { grid-template-columns: 1fr 1fr; }
  .btn-primary,
  .btn-secondary  { width: 100%; }
  .canib-url-row,
  .canib-url-head { grid-template-columns: 1fr 70px 70px; }
}

/* ── UTILITY ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Śledzenie domeny (nowe nazwy = tracking-*, stare monitoring-* zachowane dla monitor.php) ── */
.tracking-box          { background: var(--card2, #1a1d27); border: 1px solid var(--border, #2d3148); border-radius: 8px; padding: 10px 14px; margin-top: 4px; transition: border-color .2s; }
.tracking-box.active   { border-color: var(--accent, #4f8ef7); }
.tracking-label        { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text1, #e2e8f0); cursor: pointer; margin: 0; }
.tracking-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent, #4f8ef7); }
.tracking-desc         { font-size: 12px; color: var(--text3, #64748b); margin: 6px 0 0 24px; line-height: 1.5; }

/* ── Modal potwierdzenia ──────────────────────────────────── */
.mon-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.mon-modal-box {
    background: var(--card, #141720);
    border: 1px solid var(--border, #2d3148);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.mon-modal-icon { font-size: 36px; margin-bottom: 12px; }
.mon-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text1, #e2e8f0);
    margin: 0 0 12px;
}
.mon-modal-text {
    font-size: 14px;
    color: var(--text2, #94a3b8);
    margin: 0 0 8px;
}
.mon-modal-warning {
    font-size: 13px;
    color: var(--orange, #fb923c);
    background: rgba(251,146,60,.08);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0 0 20px;
}
.mon-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.btn-danger:hover { background: #dc2626; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* ── Overlay pierwsze pobieranie ── */
#fetch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 20, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayIn .3s ease;
}
@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#fetch-overlay-box {
    background: #13162080;
    border: 1px solid #2d3148;
    border-radius: 16px;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 48px rgba(79,142,247,.15);
    max-width: 360px;
    width: 90%;
}
#fetch-anim {
    width: 220px;
    height: 80px;
}

/* Słupki — fade-in z opóźnieniem */
.bar-anim {
    opacity: 0;
    animation: barIn .4s ease forwards;
    animation-delay: var(--d);
}
@keyframes barIn {
    from { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
    to   { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
}

/* Linia — rysowanie się */
#fetch-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawLine 1.2s ease forwards .2s;
}
@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* Kropki — pop-in */
.dot-anim {
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
    animation: dotPop .3s cubic-bezier(.34,1.56,.64,1) forwards;
    animation-delay: var(--d);
}
@keyframes dotPop {
    to { opacity: 1; transform: scale(1); }
}

/* Pulsowanie całego SVG po zakończeniu animacji */
#fetch-anim {
    animation: svgPulse 2s ease-in-out infinite 1.5s;
}
@keyframes svgPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .6; }
}

#fetch-overlay-title {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    text-align: center;
}
#fetch-overlay-sub {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    line-height: 1.6;
}

/* Animowane kropki ładowania */
#fetch-overlay-dots {
    display: flex;
    gap: 6px;
}
#fetch-overlay-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4f8ef7;
    animation: dotBounce 1.2s ease-in-out infinite;
}
#fetch-overlay-dots span:nth-child(2) { animation-delay: .2s; background: #6a7ef7; }
#fetch-overlay-dots span:nth-child(3) { animation-delay: .4s; background: #7c5cbf; }
@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(.8); opacity: .5; }
    40%            { transform: scale(1.2); opacity: 1; }
}