/* =========================================================================
   ReportDashboard — motyw marki Fabryka e-biznesu (feb.net.pl)
   Kolory marki: pomarańcz #f58220 (akcent), granat #29244e (ciemny),
   font Lato. Panel /admin ma własny styl Django i nie jest tu ruszany.
   ========================================================================= */
:root {
    --orange: #F5821E;        /* akcent marki (przyciski, linki, wyróżnienia) */
    --orange-dark: #d96f11;   /* hover akcentu */
    --orange-soft: #fff1e3;   /* delikatne tło pomarańczowe */
    --ink-dark: #232323;      /* ciemny marki (hero, nagłówki kafelków KPI, PDF) */
    --paper: #f6f4f1;         /* ciepła biel tła raportu */
    --navy: #29244e;          /* ciemny granat marki (nagłówek, tytuły) */
    --navy-2: #1d1a38;        /* ciemniejszy granat */
    --ink: #23202e;           /* podstawowy kolor tekstu */
    --bg: #f4f5f8;            /* tło strony */
    --card: #ffffff;
    --border: #e6e7ee;
    --muted: #7c7a8a;
    --up: #16a34a; --down: #dc2626;
    --shadow: 0 1px 2px rgba(41,36,78,.06), 0 6px 20px rgba(41,36,78,.05);
    --radius: 12px;
    --font: "Lato", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
       line-height: 1.55; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); text-decoration: underline; }
h1, h2, h3 { color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
h1 { margin: 0 0 6px; font-size: 28px; }
.muted { color: var(--muted); font-size: 13px; }
code { background: #fff3e8; color: #9a4d05; padding: 1px 6px; border-radius: 5px;
       font-size: .92em; }

/* --- Górna belka --- */
.topbar { display: flex; justify-content: space-between; align-items: center;
          background: #fff; padding: 12px 28px; border-bottom: 1px solid var(--border);
          border-top: 4px solid var(--orange); box-shadow: var(--shadow); }
.topbar .brand { display: flex; align-items: center; gap: 12px; font-weight: 800;
                 color: var(--navy); font-size: 18px; }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.topbar .brand small { display: block; font-size: 11px; font-weight: 600;
                       color: var(--muted); letter-spacing: .02em; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--navy); font-weight: 600; font-size: 14px; }
.topbar nav a:hover { color: var(--orange); text-decoration: none; }
.topbar .user { color: var(--muted); font-size: 13px; font-weight: 400; }

.container { max-width: 1120px; margin: 30px auto; padding: 0 22px; }
.footer { text-align: center; color: var(--muted); padding: 34px 20px; font-size: 12px; }

.messages { max-width: 1120px; margin: 14px auto 0; padding: 0 22px; }
.msg { padding: 11px 15px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.msg.error { background: #fee2e2; color: #991b1b; }
.msg.success { background: #dcfce7; color: #166534; }

/* --- Logowanie (allauth) --- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
             padding: 24px;
             background: radial-gradient(1200px 500px at 50% -10%, #fff 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 400px; background: var(--card);
             border: 1px solid var(--border); border-radius: 16px; padding: 34px 30px;
             box-shadow: var(--shadow); text-align: center; }
.auth-card .logo { width: 66px; height: 66px; border-radius: 16px; margin: 0 auto 16px;
                   box-shadow: 0 6px 18px rgba(245,130,32,.35); }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth-card form { text-align: left; }
.auth-card label { display: block; font-size: 12px; font-weight: 700; color: var(--navy);
                   margin: 12px 0 5px; text-transform: uppercase; letter-spacing: .03em; }
.auth-card input[type=text], .auth-card input[type=email], .auth-card input[type=password] {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px;
    font-size: 15px; font-family: var(--font); background: #fbfbfd; }
.auth-card input:focus { outline: none; border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245,130,32,.16); background: #fff; }
.auth-card .helptext, .auth-card ul.errorlist { font-size: 12px; color: var(--muted);
    margin: 4px 0 0; padding: 0; list-style: none; }
.auth-card ul.errorlist { color: var(--down); }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--muted);
            font-size: 12px; margin: 20px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 9px;
    background: #fff; color: var(--navy); font-weight: 700; font-size: 15px; }
.btn-google:hover { text-decoration: none; border-color: var(--orange); background: #fff8f1; }
.btn-google svg { width: 18px; height: 18px; }

/* --- Przyciski --- */
.btn, .btn-block { display: inline-block; background: var(--orange); color: #fff !important;
    padding: 11px 20px; border-radius: 9px; font-weight: 700; font-size: 15px; border: 0;
    cursor: pointer; font-family: var(--font); text-align: center; }
.btn:hover, .btn-block:hover { text-decoration: none; background: var(--orange-dark); }
.btn-block { display: block; width: 100%; margin-top: 6px; }

/* --- Ręczne odświeżenie raportu (karta klienta, pod listą raportów) --- */
.refresh-report { display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; margin: 4px 0 26px; }
.refresh-report label { font-size: 12px; font-weight: 700; color: var(--navy);
    text-transform: uppercase; letter-spacing: .03em; }
.refresh-report input[type=month] { padding: 9px 11px; border: 1px solid var(--border);
    border-radius: 9px; font-size: 15px; font-family: var(--font); background: #fbfbfd; }
.refresh-report input[type=month]:focus { outline: none; border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245,130,32,.16); background: #fff; }
/* Podpowiedź schodzi do własnego wiersza, gdy zabraknie miejsca obok przycisku. */
.refresh-report .muted { font-size: 12px; flex-basis: 100%; }

/* --- Generyczne strony allauth (błąd logowania, wylogowanie, zarządzanie kontem) --- */
.auth-body { text-align: left; }
.auth-body h1 { font-size: 18px; margin: 18px 0 8px; text-align: center; }
.auth-body p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 14px; text-align: center; }
.auth-body ul:not(.errorlist) { list-style: none; padding: 0; margin: 0 0 14px; }
.auth-body ul:not(.errorlist) li { margin: 6px 0; }
.auth-body button, .auth-body [type=submit], .auth-body .button, .auth-body a.button {
    display: block; width: 100%; margin-top: 10px; background: var(--orange); color: #fff !important;
    padding: 11px 20px; border: 0; border-radius: 9px; font-weight: 700; font-size: 15px;
    cursor: pointer; font-family: var(--font); text-align: center; text-decoration: none; }
.auth-body button:hover, .auth-body [type=submit]:hover, .auth-body .button:hover,
.auth-body a.button:hover { background: var(--orange-dark); }
.auth-body a:not(.button) { color: var(--orange); font-weight: 700; }

/* --- Tabela klientów --- */
table.clients { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card);
                border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
                box-shadow: var(--shadow); }
table.clients th, table.clients td { padding: 14px 16px; border-bottom: 1px solid var(--border);
                                     text-align: left; vertical-align: top; }
table.clients tbody tr:last-child td { border-bottom: 0; }
table.clients tbody tr:hover { background: #fdf7f0; }
table.clients th { background: var(--navy); color: #eceaf5; font-size: 11.5px;
                   text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-list { list-style: none; padding-left: 0; margin: 8px 0 0; }
.report-list li { padding: 3px 0; }
.report-list .pdf { margin-left: 10px; font-size: 12px; color: var(--muted); }
.report-list.big li { padding: 10px 0; border-bottom: 1px solid var(--border); }
details summary { cursor: pointer; color: var(--navy); font-weight: 600; }

/* --- Karty (dashboard klienta) --- */
.cards { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 16px 20px; min-width: 140px; box-shadow: var(--shadow);
        border-left: 4px solid var(--orange); }
.card .k { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase;
           letter-spacing: .04em; font-weight: 700; }
.card .v { font-size: 28px; font-weight: 800; color: var(--navy); }
a.card { text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-1px); }

/* --- Tabele danych (dashboard klienta; raport nadpisuje je niżej) --- */
table.data { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13.5px; }
table.data th { text-align: left; color: var(--muted); font-weight: 700; font-size: 12px;
    padding: 12px 12px; border: 0; border-bottom: 2px solid var(--orange-soft);
    white-space: nowrap; }
table.data td { border: 0; padding: 11px 12px; text-align: left; }
table.data tbody tr:nth-child(odd) { background: var(--paper); }
table.data .url { color: var(--muted); font-size: 12px; word-break: break-all; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Raport SEO — szablon w stylu feb.net.pl
   Ostre krawędzie, Oswald (wersaliki) w nagłówkach, jeden akcent: pomarańcz.
   Czerń #000 zarezerwowana dla TEKSTU; elementy graficzne (bloki, linie,
   obwódki, osie) używają --r-graph = #232323.
   Wszystko scopowane do body.report-view — dashboard i /admin bez zmian.
   ========================================================================= */
body.report-view {
    --r-orange: #F58220;
    --r-orange-d: #D96A0F;
    --r-black: #000000;       /* tekst */
    --r-graph: #232323;       /* elementy graficzne */
    --r-muted: #6E6864;
    --r-line: #E3E0DC;
    --r-paper: #FFFFFF;
    --r-paper-2: #F6F4F1;
    --r-up: #1E7A34; --r-up-bg: #E7F2E9;
    --r-down: #C0281F; --r-down-bg: #FBE9E7;
    --r-disp: "Oswald", Impact, "Arial Narrow", sans-serif;
    background: var(--r-paper);
    color: var(--r-black);
}
body.report-view * { border-radius: 0; }
body.report-view h1, body.report-view h2, body.report-view h3,
body.report-view .disp {
    font-family: var(--r-disp); font-weight: 700; text-transform: uppercase;
    letter-spacing: normal;
}
/* Widok raportu jest pełnoszerokościowy — sekcje same trzymają szerokość. */
body.report-view main.container { max-width: none; margin: 0; padding: 0; }
body.report-view .footer { display: none; }

/* --- Okładka --------------------------------------------------------- */
.cover { background: var(--r-graph); color: #fff; }
.cover-inner { position: relative; overflow: hidden;
    max-width: 1040px; margin: 0 auto; padding: 44px 40px 48px; }
.cover-bar { position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: var(--r-orange); }
.cover-top { display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; }
.cover-logo { display: inline-flex; align-items: center; }
.cover-logo:hover { text-decoration: none; }
.cover-logo img { height: 52px; width: auto; display: block; }
.period { font-family: var(--r-disp); font-weight: 700; text-transform: uppercase;
    font-size: 14px; letter-spacing: .06em; background: #fff; color: var(--r-black);
    padding: 8px 15px; }
/* line-height >= 1 — przy ciaśniejszym ogonki (ę, ą) nachodziły na kolejny wiersz */
.cover h1 { font-size: clamp(42px, 8.5vw, 88px); line-height: 1.08;
    letter-spacing: .005em; margin: 30px 0 0; color: #fff; }
/* Drugi wiersz jako blok — 8 px realnego odstępu, niezależnie od line-height */
.cover h1 em { display: block; margin-top: 8px; font-style: normal; color: var(--r-orange); }
.cover-sub { margin-top: 16px; color: #c7c1bb; font-size: 16px; }
.cover-sub b { color: #fff; font-weight: 800; }
.cover-rule { margin-top: 26px; display: flex; }
.cover-rule i { height: 4px; background: #3a3a3a; flex: 1; }
.cover-rule i:first-child { background: var(--r-orange); max-width: 88px; }

/* --- Sticky nawigacja sekcji ----------------------------------------- */
body.report-view .rpt-nav { position: sticky; top: 0; z-index: 20;
    background: rgba(255,255,255,.95); border-bottom: 1px solid var(--r-line); }
/* Padding 22 px = 40 px kolumny sekcji − 18 px wewnętrznego paddingu linku,
   dzięki temu napis „Widoczność" trafia w tę samą oś co treść sekcji. */
body.report-view .rpt-nav ul { list-style: none; margin: 0 auto; padding: 0 22px;
    max-width: 1040px; display: flex; flex-wrap: wrap; gap: 0; }
body.report-view .rpt-nav a { display: block; padding: 13px 18px;
    font-family: var(--r-disp); font-weight: 500; text-transform: uppercase;
    letter-spacing: .06em; font-size: 12.5px; color: var(--r-black);
    border-bottom: 3px solid transparent; }
body.report-view .rpt-nav a:hover { color: var(--r-orange-d); text-decoration: none;
    border-bottom-color: var(--r-orange); }

/* --- Sekcja ----------------------------------------------------------- */
.report-section { padding: 46px 40px 24px; max-width: 1040px; margin: 0 auto;
    background: transparent; border: 0; box-shadow: none; }
/* Sekcja „alt" ma tło na całą szerokość okna, ale treść trzyma tę samą
   kolumnę 1040 px co pozostałe — stąd padding liczony z szerokości viewportu. */
.report-section.alt { background: var(--r-paper-2); max-width: none;
    padding-left: max(40px, calc((100% - 1040px) / 2 + 40px));
    padding-right: max(40px, calc((100% - 1040px) / 2 + 40px)); }
.report-section .eyebrow { font-family: var(--r-disp); font-weight: 700;
    text-transform: uppercase; font-size: 12px; letter-spacing: .1em;
    color: var(--r-orange-d); display: flex; align-items: center; gap: 9px; }
.report-section .eyebrow::before { content: ""; width: 11px; height: 11px;
    background: var(--r-orange); border-radius: 50%; flex: none; }
.report-section h2 { font-size: clamp(26px, 4.4vw, 42px); line-height: 1.12;
    letter-spacing: .01em; color: var(--r-black); margin: 12px 0 0;
    background: none; padding: 0; display: block; }
.h-rule { height: 3px; background: var(--r-graph); margin: 16px 0 0; position: relative; }
.h-rule::before { content: ""; position: absolute; left: 0; top: 0;
    height: 3px; width: 96px; background: var(--r-orange); }
.report-section .intro { text-transform: none; color: var(--r-muted);
    font-size: 15px; max-width: 72ch; margin: 16px 0 0; }
.report-section h3 { font-size: 16px; letter-spacing: .04em; color: var(--r-black);
    margin: 34px 0 14px; }

/* --- Kafelki KPI ------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
    gap: 0; border-left: 1px solid var(--r-line); border-top: 1px solid var(--r-line);
    margin: 24px 0 4px; }
.kpi { border-right: 1px solid var(--r-line); border-bottom: 1px solid var(--r-line);
    background: var(--r-paper); padding: 18px 18px 16px; position: relative; }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; width: 100%;
    height: 4px; background: var(--r-orange); opacity: 0; transition: opacity .15s; }
.kpi:hover::before { opacity: 1; }
.k-label { display: block; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; font-size: 11px; color: var(--r-muted); }
.k-val { font-family: var(--r-disp); font-weight: 700; font-size: 42px;
    line-height: .98; color: var(--r-black); margin-top: 8px;
    font-variant-numeric: tabular-nums; }
.k-val .u { font-size: 18px; color: var(--r-muted); margin-left: 3px; }
.chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px;
    font-family: var(--r-disp); font-weight: 700; font-size: 13px; letter-spacing: .02em;
    padding: 3px 8px; font-variant-numeric: tabular-nums; }
.chip.up { color: var(--r-up); background: var(--r-up-bg); }
.chip.down { color: var(--r-down); background: var(--r-down-bg); }
.chip.flat { color: var(--r-muted); background: #EFECE8; }

/* --- Karta wykresu ---------------------------------------------------- */
.chart-card { background: var(--r-paper); border: 1px solid var(--r-line);
    padding: 22px 24px; margin: 20px 0; }
.report-section.alt .chart-card { background: #fff; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--r-line);
    padding-bottom: 12px; margin-bottom: 14px; }
.chart-title { font-family: var(--r-disp); font-weight: 700; text-transform: uppercase;
    font-size: 14px; letter-spacing: .06em; color: var(--r-black); }
.chart-note { font-size: 12px; color: var(--r-muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; color: var(--r-muted); margin-top: 12px; }
.legend i { width: 22px; height: 4px; display: inline-block; vertical-align: middle;
    margin-right: 7px; }

body.report-view .chart { width: 100%; min-height: 300px; margin: 0; }
body.report-view .chart.chart-empty { display: flex; align-items: center;
    justify-content: center; min-height: 150px; color: var(--r-muted); font-size: 13px;
    background: var(--r-paper-2); border: 1px dashed var(--r-line); }
body.report-view .report-section.alt .chart.chart-empty { background: #fff; }

/* --- Liczniki działań / dostępności ----------------------------------- */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 0; border-left: 1px solid var(--r-line); border-top: 1px solid var(--r-line);
    margin: 22px 0 4px; }
.counter { border-right: 1px solid var(--r-line); border-bottom: 1px solid var(--r-line);
    padding: 18px; background: var(--r-paper); }
.c-l { font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    font-size: 11px; color: var(--r-muted); }
.c-m { font-family: var(--r-disp); font-weight: 700; font-size: 38px; line-height: 1;
    color: var(--r-black); margin-top: 8px; font-variant-numeric: tabular-nums; }
.c-m.small { font-size: 24px; }
.c-m .u { font-size: 20px; color: var(--r-muted); }
.c-t { font-size: 12px; font-weight: 700; color: var(--r-muted); margin-top: 6px;
    text-transform: uppercase; letter-spacing: .03em; }
.c-t b { color: var(--r-orange-d); }
.ssl-ok { color: var(--r-up); }

/* --- Rozwijane listy działań ------------------------------------------ */
.work-lists { margin-top: 22px; border-top: 1px solid var(--r-line); }
body.report-view details { border: 1px solid var(--r-line); border-top: 0;
    background: var(--r-paper); padding: 0; margin: 0; }
body.report-view details summary { cursor: pointer; font-family: var(--r-disp);
    font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: var(--r-black); padding: 15px 20px; font-size: 14px; list-style: none;
    display: flex; align-items: center; justify-content: space-between; }
body.report-view details summary::-webkit-details-marker { display: none; }
body.report-view details summary::after { content: "+"; color: var(--r-orange);
    font-family: var(--r-disp); font-size: 22px; line-height: 1; }
body.report-view details[open] summary::after { content: "\2013"; }
body.report-view details[open] summary { border-bottom: 1px solid var(--r-line); }
body.report-view details ul { margin: 0; padding: 14px 20px 18px; list-style: none;
    display: flex; flex-direction: column; gap: 10px; }
body.report-view details li { font-size: 13.5px; color: var(--r-black);
    padding-left: 18px; position: relative; }
body.report-view details li::before { content: ""; position: absolute; left: 0; top: 8px;
    width: 7px; height: 7px; background: var(--r-orange); }
body.report-view details li.muted::before { background: var(--r-line); }
body.report-view details li .d { font-family: var(--r-disp); font-weight: 500;
    font-size: 12px; color: var(--r-muted); margin-right: 6px; letter-spacing: .02em; }
body.report-view details li a { color: var(--r-orange-d); font-weight: 800; }
body.report-view details li .tag { color: var(--r-muted); font-size: 12px; }

.notice { background: #FDF0E2; border: 1px solid #F3C68C; color: #8a4a09;
    max-width: 1040px; margin: 22px auto 0; padding: 14px 18px; font-size: 14px; }

/* --- Tabele danych ---------------------------------------------------- */
.tbl-wrap { overflow-x: auto; margin-top: 2px; }
body.report-view table.data { width: 100%; border-collapse: collapse; font-size: 13.5px;
    margin: 0; }
body.report-view table.data thead th { text-align: left; font-family: var(--r-disp);
    font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 12px;
    color: var(--r-black); padding: 0 12px 11px; border: 0;
    border-bottom: 3px solid var(--r-graph); white-space: nowrap; background: none; }
body.report-view table.data thead th.num { text-align: right; }
body.report-view table.data tbody tr { background: none; }
body.report-view table.data tbody td { padding: 12px; border: 0;
    border-bottom: 1px solid var(--r-line); font-weight: 400; }
body.report-view table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
body.report-view table.data .url { color: var(--r-muted); font-size: 12px; word-break: break-all; }
body.report-view table.data .muted { color: var(--r-muted); }
.pos { font-family: var(--r-disp); font-weight: 700; font-size: 14px; }
.pos.up { color: var(--r-up); }
.pos.down { color: var(--r-down); }

/* --- Stopka raportu --------------------------------------------------- */
.report-foot { max-width: 1040px; margin: 34px auto 0; padding: 22px 40px 70px;
    border-top: 3px solid var(--r-graph); display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; font-family: var(--r-disp); font-weight: 500;
    text-transform: uppercase; letter-spacing: .05em; font-size: 12px; color: var(--r-muted);
    text-align: left; }
.report-foot .fl { position: relative; padding-top: 14px; }
.report-foot .fl::before { content: ""; position: absolute; top: 0; left: 0;
    width: 60px; height: 4px; background: var(--r-orange); }

/* --- Statusy zadań SEO (zaplanowane / wykonane) --- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge-done { background: #e3f4e8; color: #1c7a3d; }
.badge-planned { background: #eef1f5; color: #5a6472; }

/* --- Pływający przycisk PDF --- */
.pdf-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; background: var(--r-graph);
    color: #fff !important; border: 0; padding: 14px 22px; font-family: var(--r-disp);
    font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    font-size: 13px; display: inline-flex; align-items: center; gap: 9px;
    box-shadow: 0 10px 30px rgba(0,0,0,.28); }
.pdf-fab:hover { background: var(--r-orange); text-decoration: none; }
.pdf-fab svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }
/* Stan „generuję PDF" — ikona strzałki ustępuje miejsca kręcącemu się kółku */
.pdf-fab .fab-spin { display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
    animation: fab-spin .7s linear infinite; }
.pdf-fab.is-loading { background: var(--r-orange); cursor: progress; pointer-events: none; }
.pdf-fab.is-loading .fab-ico { display: none; }
.pdf-fab.is-loading .fab-spin { display: block; }
@keyframes fab-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pdf-fab .fab-spin { animation-duration: 2.4s; } }

/* --- Druk / zrzut PDF raportu (Ctrl+P → Zapisz jako PDF) --- */
@media print {
    @page { size: A4; margin: 12mm; }
    html, body, body.report-view { background: #fff !important; }
    /* Zachowaj kolory marki (pomarańcz, czerń graficzna, chipy) w druku */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    /* Elementy interaktywne poza wydrukiem */
    .rpt-nav, .pdf-fab { display: none !important; }
    .cover { break-inside: avoid; }
    .report-section { padding: 26px 0 10px; break-inside: auto; }
    .report-section h2, .report-section h3, .eyebrow, .chart-head { break-after: avoid; }
    /* Nie tnij pojedynczych kafli, wykresów, wierszy tabel i list działań */
    .kpi, .counter, .chart-card, .chart, .work-lists details { break-inside: avoid; }
    /* Historia widoczności + udział sesji organicznych = jedna wspólna karta */
    .chart-pair { background: var(--r-paper); border: 1px solid var(--r-line);
        padding: 22px 24px; margin: 20px 0; break-inside: avoid; }
    .report-section.alt .chart-pair { background: #fff; }
    .chart-pair .chart-card { background: none; border: 0; padding: 0; margin: 0; }
    .chart-pair .chart-card + .chart-card { margin-top: 18px; }
    body.report-view table.data tr, body.report-view table.data thead { break-inside: avoid; }
    /* Wymuszony podział strony przed wybranymi nagłówkami */
    .pdf-break-before { break-before: page; }
    /* Blok trzymany w całości na jednej stronie (nagłówek sekcji + KPI + wykresy) */
    .pdf-keep { break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
}

/* --- Responsywność --- */
@media (max-width: 720px) {
    .topbar { padding: 10px 16px; }
    .topbar .brand small { display: none; }
    .container { margin: 20px auto; }
    table.clients { display: block; overflow-x: auto; white-space: nowrap; }
    .cover-inner { padding: 30px 20px 34px; }
    .report-section, .report-section.alt { padding: 34px 20px 18px; }
    body.report-view .rpt-nav ul { padding: 0 2px; }  /* 20 px kolumny − 18 px linku */
    .report-foot { padding: 20px 20px 80px; }
    .chart-card { padding: 16px 14px; }
}
