/* Panel Xann – bez kroku budowania, zwykły CSS. */
:root {
    --bg: #F6F7F9; --surface: #FFFFFF; --text: #1B2430; --muted: #667085; --line: #E4E7EC;
    --primary: #1D4ED8; --primary-ink: #FFFFFF; --side: #101828; --side-text: #D0D5DD;
    --ok: #067647; --ok-bg: #ECFDF3; --warn: #B54708; --warn-bg: #FFFAEB; --bad: #B42318; --bad-bg: #FEF3F2;
    --seo: #EEF4FF; --seo-ink: #3538CD; --ads: #FDF2FA; --ads-ink: #C11574; --inne: #F2F4F7; --inne-ink: #344054;
    --radius: 10px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px; line-height: 1.5; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0C111D; --surface: #161B26; --text: #F5F5F6; --muted: #94969C; --line: #2A303C;
        --primary: #528BFF; --side: #0A0D14; --side-text: #CECFD2;
        --ok: #47CD89; --ok-bg: #0B2A1C; --warn: #FDB022; --warn-bg: #2B1F07; --bad: #F97066; --bad-bg: #2C1311;
        --seo: #1B2448; --seo-ink: #A4BCFD; --ads: #3A1530; --ads-ink: #FAA7E0; --inne: #232733; --inne-ink: #CECFD2;
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.danger { color: var(--bad); }

.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.logo { color: #fff; font-weight: 700; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 800; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav { color: var(--side-text); padding: 8px 12px; border-radius: 8px; }
.nav:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sidebar-foot .link { color: var(--side-text); padding: 0; }
.main { padding: 28px 32px; min-width: 0; max-width: 1400px; }

.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.head h1, .head h2 { margin: 0; }
.pager, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
button.link { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }
button.link.danger { color: var(--bad); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.card h2 { margin-top: 0; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.top-gap { margin-top: 16px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .55; }
td.url { max-width: 420px; word-break: break-all; }
.row-actions { display: flex; gap: 12px; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 24px; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--inne); color: var(--inne-ink); margin: 1px 2px 1px 0; }
.tag.seo { background: var(--seo); color: var(--seo-ink); }
.tag.ads { background: var(--ads); color: var(--ads-ink); }
.tag.raport { background: var(--warn-bg); color: var(--warn); }
.status { font-size: 13px; font-weight: 600; white-space: nowrap; }
.status.ok { color: var(--ok); } .status.no_link, .status.error { color: var(--bad); } .status.unchecked { color: var(--muted); }

.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid transparent; }
.flash ul { margin: 4px 0 0; padding-left: 20px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.note { background: var(--warn-bg); padding: 10px 14px; border-radius: 8px; white-space: pre-line; }

.search input { max-width: 360px; margin-bottom: 14px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { width: auto; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-size: 13px; background: var(--surface); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:hover { text-decoration: none; }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.stat-num { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.bad .stat-num { color: var(--bad); } .stat.warn .stat-num { color: var(--warn); }

.svc-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 3px 0; }
.progress { display: inline-flex; align-items: center; gap: 8px; }
.progress .bar { width: 120px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress .bar span { display: block; height: 100%; background: var(--primary); }
.progress.full .bar span { background: var(--ok); }
.progress .num { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; }

.tasks { list-style: none; margin: 0 0 16px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tasks li { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.tasks li:last-child { border-bottom: 0; }
.tasks li.done .t-title { text-decoration: line-through; color: var(--muted); }
.tasks li.late { box-shadow: inset 3px 0 0 var(--bad); }
.tasks li.empty { display: block; }
.tick { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); background: var(--surface); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; margin-top: 1px; }
li.done .tick { background: var(--ok); border-color: var(--ok); }
.t-body { min-width: 0; }

.center-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login h1 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }

/* Raport dla klienta */
.report-page { background: var(--bg); }
.report-bar { display: flex; gap: 8px; padding: 16px; justify-content: center; flex-wrap: wrap; }
.report { max-width: 860px; margin: 0 auto 40px; background: var(--surface); padding: 40px 48px; border-radius: var(--radius); border: 1px solid var(--line); }
.report h1 { font-size: 28px; margin: 0; }
.report-sub { font-size: 17px; margin: 4px 0 0; }
.report header { border-bottom: 3px solid var(--primary); padding-bottom: 16px; margin-bottom: 8px; }
.report table { border: 1px solid var(--line); }
.report footer { margin-top: 32px; }
@media print {
    .no-print { display: none !important; }
    :root { --bg: #fff; --surface: #fff; --text: #000; --line: #ccc; }
    .report { border: 0; padding: 0; margin: 0; max-width: none; }
    a { color: #000; }
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 12px; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; gap: 10px; }
    .main { padding: 20px 16px; }
    .grid2, .grid4, .stats { grid-template-columns: 1fr; }
    .span2, .span3 { grid-column: auto; }
    .report { padding: 24px 16px; }
}
