:root {
  --navy: #1b3556;
  --navy-dark: #0f1e38;
  --red: #d00837;
  --red-dark: #a80630;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --yellow-bg: #fef9c3;
  --blue-bg: #dbeafe;
  --shadow: 0 1px 3px rgba(15,23,42,0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 28px 32px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.sidebar .brand .dot {
  width: 12px; height: 12px; background: var(--red); border-radius: 50%;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 16px;
  gap: 4px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: rgba(208,8,55,0.18); color: #fff; font-weight: 600; }
.sidebar nav a span:first-child { font-size: 20px; }
.sidebar .footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .user-info { flex: 1; min-width: 0; }
.sidebar .user-name { color: #fff; font-weight: 600; font-size: 14px; }
.sidebar .user-role { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.5); }
.sidebar .btn-logout {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
}
.sidebar .btn-logout:hover { background: rgba(208,8,55,0.18); color: #fff; }

.demo-banner {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #78350f;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}
.demo-banner strong { color: #92400e; letter-spacing: 0.5px; }

/* Main */
.main {
  flex: 1;
  padding: 40px 48px;
  max-width: 1750px;
  overflow-x: auto;
}

/* Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  gap: 20px;
}
h1 { font-size: 32px; font-weight: 700; color: var(--navy); letter-spacing: -0.5px; }
h2 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 28px 0 14px; }
h3 { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 14px; }
.back { color: var(--muted); font-size: 14px; text-decoration: none; display: inline-block; margin-bottom: 6px; }
.back:hover { color: var(--navy); }

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.kpi {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.kpi-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 6px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.card.hidden { display: none; }
.card header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.form-grid label.span-2 { grid-column: span 2; }
.form-grid label.span-3 { grid-column: span 3; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
input, select, textarea {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,53,86,0.1);
}
textarea { resize: vertical; min-height: 90px; font-family: inherit; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn:hover { background: var(--bg); border-color: var(--navy); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* Account block — sectioned campaigns view */
.account-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.account-head {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
  background: linear-gradient(0deg, var(--bg) 0%, #fff 100%);
  border-bottom: 1px solid var(--border);
}
.account-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.account-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}
.account-stats {
  display: flex;
  gap: 28px;
}
.account-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}
.account-stats strong {
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
}
.account-actions {
  display: flex;
  gap: 6px;
}

.campaign-list {
  display: flex;
  flex-direction: column;
}
.campaign-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.campaign-row:last-child { border-bottom: none; }
.campaign-row:hover { background: var(--bg); }

.campaign-main { flex: 1; min-width: 0; }
.campaign-num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.campaign-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.campaign-name strong {
  font-size: 16px;
  color: var(--navy);
  font-weight: 700;
}
.campaign-meta {
  display: flex;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.campaign-meta strong { color: var(--text); font-weight: 600; }
.campaign-effect {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

.campaign-numbers {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 16px;
  flex-shrink: 0;
}
.campaign-numbers > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.campaign-numbers strong {
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .campaign-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .campaign-numbers { grid-template-columns: repeat(4, 1fr); }
  .account-head { flex-wrap: wrap; }
  .account-stats { gap: 18px; }
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  font-size: 14px;
  table-layout: auto;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table td.contact { max-width: 220px; word-break: break-word; }
.data-table td.col-source { max-width: 180px; word-break: break-word; }
.data-table td.col-product { max-width: 180px; word-break: break-word; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; margin-bottom: 24px; }
.table-wrap > .data-table { margin-bottom: 0; }
.data-table th {
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .empty { text-align: center; padding: 50px; color: var(--muted); font-style: italic; }
.data-table a { color: var(--navy); text-decoration: none; }
.data-table a:hover { color: var(--red); }

/* Badges & status */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
}
.badge-google { background: #fef3c7; color: #92400e; }
.badge-fb { background: #dbeafe; color: #1e40af; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.status {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
}
.status-enabled, .status-aktywna { background: var(--green-bg); color: var(--green); }
.status-paused, .status-wstrzymana { background: var(--yellow-bg); color: #854d0e; }
.status-removed { background: #fee2e2; color: var(--red); }
.status-open { background: var(--blue-bg); color: #1e40af; }
.status-in_progress { background: var(--yellow-bg); color: #854d0e; }
.status-blocked { background: #fee2e2; color: var(--red); }
.status-done { background: var(--green-bg); color: var(--green); }

.status-lead-new       { background: var(--blue-bg); color: #1e40af; }
.status-lead-contacted { background: var(--yellow-bg); color: #854d0e; }
.status-lead-quoted    { background: #fed7aa; color: #9a3412; }
.status-lead-won       { background: var(--green-bg); color: var(--green); }
.status-lead-lost      { background: #fee2e2; color: var(--red); }

.prio { font-size: 13px; font-weight: 600; }
.prio-high { color: var(--red); }
.prio-medium { color: var(--muted); }
.prio-low { color: var(--muted); opacity: 0.7; }

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.filter-tabs a {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}
.filter-tabs a.active { background: var(--navy); color: #fff; }

/* Task detail grid */
.task-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}
.task-grid aside { display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack hr, .card hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Comments */
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.comment {
  border-left: 3px solid var(--navy);
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 0 8px 8px 0;
}
.comment-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; font-size: 13px; }
.comment-body { white-space: pre-wrap; font-size: 15px; line-height: 1.55; }
.mention {
  background: rgba(208,8,55,0.1);
  color: var(--red);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.comment-form { display: flex; flex-direction: column; gap: 12px; }

/* Notes */
.notes-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.notes-list .card h3 { margin: 0; }
.tag {
  display: inline-block;
  background: var(--blue-bg);
  color: #1e40af;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}

/* Flash */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.flash {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 15px;
  transition: opacity 0.4s;
  border: 1px solid;
}
.flash-ok { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.flash-err { background: #fee2e2; color: var(--red); border-color: var(--red); }
.flash.fade { opacity: 0; }

/* Responsive */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .task-grid { grid-template-columns: 1fr; }
  .notes-list { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; flex-direction: row; padding: 8px; position: relative; }
  .sidebar .brand { padding: 10px 14px; font-size: 18px; }
  .sidebar nav { flex-direction: row; gap: 4px; padding: 0 8px; }
  .sidebar .footer { display: none; }
  .main { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
}

/* ===== DASHBOARD (DNK) ===== */
.nav-group { padding: 16px 12px 6px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,0.45); font-weight: 700; }
.sidebar nav a.sub { padding-left: 22px; }

.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dash-sub { color: var(--muted); font-size: 13px; margin: 4px 0 20px; }
.period-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.period-switch a { padding: 9px 16px; font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; border-right: 1px solid var(--border); }
.period-switch a:last-child { border-right: 0; }
.period-switch a:hover { background: var(--bg); color: var(--navy); }
.period-switch a.on { background: var(--navy); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow); }
.tile-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; }
.tile-value { font-size: 28px; font-weight: 700; color: var(--navy); margin: 6px 0 2px; letter-spacing: -0.5px; }
.tile-sub { font-size: 12px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.dash-grid .card { padding: 0; }
.dash-grid .card header { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dash-grid .card header h3 { font-size: 15px; font-weight: 700; color: var(--navy); }
.dash-grid .card header .muted { font-size: 13px; color: var(--muted); font-weight: 600; }

/* slupki pionowe */
.chart-bars { display: flex; align-items: flex-end; gap: 5px; height: 210px; padding: 18px 20px 8px; overflow-x: auto; }
.bar-col { flex: 1 1 0; min-width: 20px; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; height: 100%; }
.bar-val { font-size: 11px; font-weight: 700; color: var(--navy); height: 15px; }
.bar { width: 100%; max-width: 44px; min-height: 3px; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #2d5488, var(--navy)); transition: opacity .15s; }
.bar-col:hover .bar { opacity: .75; }
.bar-lab { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* slupki poziome */
.hbars { padding: 18px 20px; display: flex; flex-direction: column; gap: 11px; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 96px; align-items: center; gap: 12px; }
.hbar-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: var(--bg); border-radius: 6px; height: 22px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--navy), #2d5488); min-width: 3px; }
.hbar-fill.alt { background: linear-gradient(90deg, var(--red), #ef4f6f); background: linear-gradient(90deg, var(--red), #ef4f6f); }
.hbar-val { font-size: 13px; font-weight: 700; color: var(--navy); text-align: right; }

table.mini { width: 100%; border-collapse: collapse; margin: 0 0 4px; }
table.mini th, table.mini td { padding: 9px 20px; font-size: 13px; text-align: left; border-top: 1px solid var(--border); }
table.mini th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge.on { background: var(--green-bg); color: var(--green); }
.badge.off { background: var(--bg); color: var(--muted); }
tr.dim { opacity: 0.55; }
td.strong { font-weight: 600; color: var(--navy); }
.empty { padding: 24px 20px; color: var(--muted); font-size: 14px; text-align: center; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* tabela w karcie dashboardu */
.card > table { width: 100%; border-collapse: collapse; }
.card > table thead th { padding: 11px 16px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); text-align: left; background: var(--bg);
  border-bottom: 1px solid var(--border); white-space: nowrap; }
.card > table tbody td { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.card > table tbody tr:last-child td { border-bottom: 0; }
.card > table tbody tr:hover { background: var(--bg); }
.chart-bars .bar-lab { min-height: 13px; }

/* ===== KREACJE + LIGHTBOX ===== */
.cre-cell { width: 74px; }
.cre-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: zoom-in; display: block; background: var(--bg);
  transition: transform .12s, box-shadow .12s; }
.cre-thumb:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(15,23,42,0.18); }
.cre-none { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px;
  border-radius: 8px; border: 1px dashed var(--border); color: var(--muted);
  font-size: 15px; font-weight: 700; background: var(--bg); }

.cre-lightbox { display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(10,18,32,0.86); align-items: center; justify-content: center; padding: 30px; }
.cre-lightbox.open { display: flex; }
.cre-box { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 94vw; }
.cre-box img { max-width: 88vw; max-height: 76vh; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); background: #fff; }
.cre-title { color: #fff; font-size: 15px; font-weight: 600; text-align: center; max-width: 700px; }
.cre-close { background: #fff; border: 0; border-radius: 8px; padding: 10px 20px;
  font-size: 14px; font-weight: 700; color: var(--navy); cursor: pointer; }
.cre-close:hover { background: var(--bg); }

/* ROAS badge */
.roas { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.roas.good { background: var(--green-bg); color: var(--green); }
.roas.mid { background: var(--yellow-bg); color: #a16207; }
.roas.bad { background: #fee2e2; color: #b91c1c; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

.note-warn { background: var(--yellow-bg); border: 1px solid #fde047; border-left: 4px solid #eab308;
  border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #713f12; margin: 0 0 18px; line-height: 1.55; }

/* zakladki firm */
.firm-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.firm-tabs a { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.firm-tabs a:hover { border-color: var(--navy); color: var(--navy); }
.firm-tabs a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.acc-card { padding: 0; margin-bottom: 16px; }
.acc-card header { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.acc-card header h3 { font-size: 15px; font-weight: 700; color: var(--navy); }
.acc-card header .muted { font-size: 13px; color: var(--muted); font-weight: 600; }
.acc-card table { width: 100%; border-collapse: collapse; }
.acc-card thead th { padding: 10px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); text-align: left; background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.acc-card tbody td { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.acc-card tbody tr:last-child td { border-bottom: 0; }
.acc-card tbody tr:hover { background: var(--bg); }

/* ===== BUDZETY I ALERTY ===== */
.bud-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:14px;margin-bottom:22px}
.bud{background:var(--surface);border:1px solid var(--border);border-left:5px solid var(--green);
 border-radius:12px;padding:16px 18px;box-shadow:var(--shadow)}
.bud-warn{border-left-color:#eab308;background:#fffbeb}
.bud-over{border-left-color:var(--red);background:#fef2f2}
.bud-top{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:9px}
.bud-name{font-size:14px;font-weight:700;color:var(--navy)}
.bud-pct{font-size:19px;font-weight:800;color:var(--navy)}
.bud-warn .bud-pct{color:#a16207}
.bud-over .bud-pct{color:var(--red)}
.bud-bar{background:var(--bg);border-radius:6px;height:9px;overflow:hidden;margin-bottom:9px}
.bud-fill{height:100%;background:var(--green);border-radius:6px}
.bud-warn .bud-fill{background:#eab308}
.bud-over .bud-fill{background:var(--red)}
.bud-num{display:flex;justify-content:space-between;gap:10px;font-size:13px;color:var(--muted);margin-bottom:6px;flex-wrap:wrap}
.bud-num strong{color:var(--navy)}
.bud-left{color:var(--muted)}
.bud-msg{font-size:12px;color:var(--muted);line-height:1.45}
.bud-warn .bud-msg{color:#a16207;font-weight:600}
.bud-over .bud-msg{color:var(--red);font-weight:700}


/* czytelnosc tabeli kampanii */
.kanal-tag { display:inline-block; margin-left:.5rem; padding:.1rem .45rem; border-radius:999px;
  background:#eef2f7; color:#4a5b70; font-size:.72rem; font-weight:600; vertical-align:middle; white-space:nowrap; }
.ad-text { display:block; margin-top:.35rem; color:#6b7785; font-size:.78rem; font-weight:400; line-height:1.35; max-width:34ch; }
.link-cell a { color:#1b6ac9; text-decoration:none; font-size:.82rem; word-break:break-all; }
.link-cell a:hover { text-decoration:underline; }
.link-cell .muted { font-size:.8rem; }


/* zakladka firmy: nasze kreacje */
.kre-group header { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.kre-link { margin:.2rem 0 .9rem; font-size:.85rem; color:#6b7785; }
.kre-link a { color:#1b6ac9; text-decoration:none; }
.kre-link a:hover { text-decoration:underline; }
.kre-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(168px, 1fr)); gap:14px; padding:2px 0 6px; }
.kre-item { position:relative; margin:0; background:#f7f8fa; border:1px solid #e6eaef; border-radius:10px; overflow:hidden; }
.kre-item img { display:block; width:100%; height:150px; object-fit:cover; cursor:zoom-in; transition:transform .18s ease; }
.kre-item img:hover { transform:scale(1.03); }
.kre-item figcaption { padding:.45rem .55rem; font-size:.75rem; line-height:1.3; color:#4a5b70;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.kre-flag { position:absolute; top:6px; right:6px; background:#fff3cd; color:#8a6d1f; font-size:.68rem;
  font-weight:600; padding:.1rem .4rem; border-radius:5px; }
.cre-body { margin-top:.7rem; color:#d6dbe2; font-size:.85rem; line-height:1.45; max-width:56ch; }
@media (max-width: 640px) {
  .kre-grid { grid-template-columns:repeat(auto-fill, minmax(132px, 1fr)); gap:10px; }
  .kre-item img { height:118px; }
}


/* wykresy liniowe: koszt leada, CPC, CTR */
.line-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:18px; margin-bottom:22px; }
.line-card { padding-bottom:14px; }
.line-sub { margin:-.35rem 0 .5rem; color:#6b7785; font-size:.8rem; }
.line-svg { display:block; width:100%; height:96px; overflow:visible; }
.line-foot { display:flex; justify-content:space-between; align-items:baseline; margin-top:.55rem;
  font-size:.85rem; color:#4a5b70; }
.line-foot strong { font-size:1.05rem; color:var(--navy, #12233b); }
.bar.alt { background:linear-gradient(180deg,#2e9e6b,#1f7d52); }


/* czytelnosc v2 */
.acc-card table { width:100%; table-layout:auto; }
.acc-card { overflow-x:auto; }
.acc-card table th, .acc-card table td { white-space:nowrap; }
.acc-card table td.strong, .acc-card table td.link-cell { white-space:normal; }
.acc-card table td.strong { min-width:200px; max-width:300px; }
.link-cell { max-width:190px; }
.link-cell a { display:inline-block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; }
.tile-value { font-size:1.5rem; line-height:1.2; word-break:normal; }
.tile-label { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tiles { grid-template-columns:repeat(auto-fit, minmax(155px, 1fr)); }
.chart-bars .bar-lab { font-size:9.5px; }
@media (max-width: 900px) { .tile-value { font-size:1.25rem; } }

.kre-teksty { margin:.2rem 0 .35rem; font-size:.85rem; color:#6b7785; }
.kre-teksty span { color:#12233b; font-weight:600; }


/* tabela v3 */
.acc-card table { font-size:.86rem; }
.acc-card table th { font-size:.7rem; letter-spacing:.02em; }
.acc-card table td.strong { min-width:180px; max-width:230px; }
.ad-text { max-width:100%; -webkit-line-clamp:3; display:-webkit-box; -webkit-box-orient:vertical; overflow:hidden; }
.acc-card table td, .acc-card table th { padding-left:.5rem; padding-right:.5rem; }
.cre-cell { width:58px; }
.cre-thumb { width:48px; height:48px; object-fit:cover; border-radius:7px; cursor:zoom-in; }

.td-sub { display:block; margin-top:.15rem; font-size:.72rem; color:#8b97a5; font-weight:400; }


/* tabela v4 */
.acc-card table td.strong { min-width:150px; max-width:190px; }
.ad-text { -webkit-line-clamp:2; font-size:.74rem; }
.acc-card table td, .acc-card table th { padding-left:.4rem; padding-right:.4rem; }
.link-cell { max-width:150px; }
.link-cell a { font-size:.78rem; }


/* tabela v5 */
.acc-card table th { white-space:normal; line-height:1.25; vertical-align:bottom; }
.acc-card table td.strong { min-width:140px; max-width:175px; }
.link-cell { max-width:132px; }


/* tabela naszych reklam */
.kre-tab { width:100%; border-collapse:collapse; font-size:.85rem; }
.kre-tab th { font-size:.7rem; text-transform:uppercase; letter-spacing:.02em; color:#8b97a5;
  text-align:left; padding:.5rem .5rem .45rem; border-bottom:1px solid #e6eaef; white-space:normal;
  line-height:1.25; vertical-align:bottom; font-weight:700; }
.kre-tab td { padding:.6rem .5rem; border-bottom:1px solid #f0f2f5; vertical-align:top; }
.kre-tab tr:last-child td { border-bottom:none; }
.kre-tab td.strong { font-weight:600; color:#12233b; min-width:130px; max-width:180px; }
.kre-td-img { width:78px; padding-right:0; }
.kre-td-img img { width:66px; height:66px; object-fit:cover; border-radius:8px; cursor:zoom-in;
  border:1px solid #e6eaef; background:#f7f8fa; transition:transform .15s ease; }
.kre-td-img img:hover { transform:scale(1.06); }
.kre-td-tresc { color:#5a6878; max-width:250px; line-height:1.4; font-size:.8rem;
  display:table-cell; }
.kre-td-cta { white-space:nowrap; font-weight:600; color:#12233b; }
.kre-td-cta .cta-link { display:block; margin-top:.15rem; font-weight:400; font-size:.74rem;
  color:#1b6ac9; text-decoration:none; max-width:150px; overflow:hidden; text-overflow:ellipsis; }
.kre-td-cta .cta-link:hover { text-decoration:underline; }
.kre-tab td.liczba { text-align:right; white-space:nowrap; }
.kre-tab td.liczba strong { font-size:1.05rem; color:#12233b; }
@media (max-width: 820px) {
  .kre-tab { font-size:.78rem; }
  .kre-td-tresc { max-width:150px; }
  .kre-td-img img { width:52px; height:52px; }
}

.znacznik-nowa { display:block; margin-top:.25rem; font-size:.68rem; font-weight:600;
  color:#1f7d52; background:#e8f6ee; padding:.1rem .4rem; border-radius:5px; width:fit-content; }


/* tabela reklam v2 */
.kre-td-tresc { max-width:230px; display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical;
  overflow:hidden; }
.kre-tab td.strong { min-width:110px; max-width:145px; font-size:.82rem; }
.kre-tab td, .kre-tab th { padding-left:.4rem; padding-right:.4rem; }
.kre-td-cta { white-space:normal; max-width:130px; font-size:.8rem; }
.kre-td-cta .cta-link { max-width:120px; }
.kre-td-img { width:66px; }
.kre-td-img img { width:56px; height:56px; }


/* cta v2 */
.kre-td-cta .cta-link { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:118px;
  display:block; }


/* lejek rejestracji QR */
.lejek { display:flex; align-items:center; gap:.9rem; flex-wrap:wrap; padding:.4rem 0 .2rem; }
.lejek-krok { flex:1 1 150px; background:#f7f8fa; border:1px solid #e6eaef; border-radius:10px; padding:.8rem .9rem; }
.lejek-krok.zle { background:#fdf0f0; border-color:#f3c9c9; }
.lejek-liczba { font-size:1.9rem; font-weight:800; color:#12233b; line-height:1.1; }
.lejek-krok.zle .lejek-liczba { color:#b02a2a; }
.lejek-opis { margin-top:.25rem; font-size:.8rem; color:#5a6878; line-height:1.35; }
.lejek-strzalka { color:#b6c0cc; font-size:1.3rem; }
.lejek-alarm { margin:.9rem 0 0; padding:.75rem .9rem; background:#fdf0f0; border-left:3px solid #b02a2a;
  border-radius:6px; color:#7d2020; font-size:.86rem; line-height:1.5; }
.lejek-info { margin:.8rem 0 0; color:#5a6878; font-size:.85rem; }
@media (max-width:700px) { .lejek-strzalka { display:none; } }
