/* ================================================================
   testybaterii.pl — nowy system designu
   Ładowany PRZED starym <style> w app.blade.php
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Fallback dla przeglądarek bez oklch ── */
:root {
    --brand-fb:       #0d9488;
    --brand-deep-fb:  #0f766e;
    --brand-soft-fb:  #f0fdfa;
    --brand-tint-fb:  #f0fdfa;
    --accent-fb:      #ea580c;
    --accent-deep-fb: #9a3412;
    --accent-soft-fb: #fff7ed;
    --good-fb:        #16a34a;
    --bad-fb:         #dc2626;
    --ink-faint-fb:   #64748b;
    --border-fb:      #e2e8f0;
    --bg-2-fb:        #f1f5f9;
    --night-fb:       #0f172a;
}

@supports (color: oklch(0 0 0)) {
:root {
    /* Surfaces */
    --bg-new:      oklch(0.985 0.003 240);
    --bg-2:        oklch(0.965 0.004 240);
    --surface:     #ffffff;

    /* Ink */
    --ink-soft:    oklch(0.46 0.015 240);
    --ink-faint:   oklch(0.62 0.012 240);
    --ink-ghost:   oklch(0.78 0.008 240);

    /* Borders */
    --border:      oklch(0.93 0.004 240);
    --border-2:    oklch(0.88 0.006 240);
    --border-strong: oklch(0.80 0.008 240);

    /* Brand teal */
    --brand:       oklch(0.58 0.11 178);
    --brand-2:     oklch(0.52 0.12 178);
    --brand-deep:  oklch(0.30 0.08 178);
    --brand-soft:  oklch(0.95 0.04 178);
    --brand-tint:  oklch(0.97 0.022 178);

    /* Accent coral */
    --accent-new:  oklch(0.70 0.17 38);
    --accent-deep: oklch(0.52 0.16 38);
    --accent-soft: oklch(0.96 0.04 55);

    /* Status */
    --good:        oklch(0.65 0.14 150);
    --good-soft:   oklch(0.95 0.04 150);
    --bad:         oklch(0.60 0.18 25);

    /* Night panels */
    --night:       oklch(0.16 0.018 240);
    --night-2:     oklch(0.22 0.018 240);
    --night-text:  oklch(0.96 0.005 240);
    --night-text-soft: oklch(0.70 0.012 240);
    --night-border: oklch(0.28 0.018 240);

    /* Override starych zmiennych aby komponenty spoza redesignu też korzystały */
    --accent:      oklch(0.58 0.11 178);
    --accent-dark: oklch(0.30 0.08 178);
    --accent-light:oklch(0.92 0.05 178);
    --accent-xlight: oklch(0.97 0.022 178);
    --line:        oklch(0.93 0.004 240);
    --line2:       oklch(0.88 0.006 240);
    --bg:          oklch(0.985 0.003 240);
    --panel:       #ffffff;
    --ink:         oklch(0.18 0.02 240);
    --ink2:        oklch(0.32 0.02 240);
    --muted:       oklch(0.62 0.012 240);
}
}

/* ── Fonty ── */
:root {
    --sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

    /* Radii */
    --r-xs:   6px;
    --r-sm:   10px;
    --r-md:   14px;
    --r-lg:   20px;
    --r-pill: 999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 2px 4px rgba(15,23,42,0.03);
    --shadow-md: 0 1px 2px rgba(15,23,42,0.04), 0 8px 20px -6px rgba(15,23,42,0.08);
    --shadow-lg: 0 1px 2px rgba(15,23,42,0.04), 0 24px 48px -12px rgba(15,23,42,0.18);
}

/* ── Reset dla nowych sekcji ── */
.tb-reset, .tb-reset *, .tb-reset *::before, .tb-reset *::after { box-sizing: border-box; }
.tb-reset h1,.tb-reset h2,.tb-reset h3,.tb-reset h4,.tb-reset p { margin: 0; padding: 0; }
.tb-reset ul,.tb-reset ol { list-style: none; margin: 0; padding: 0; }

/* ── Typografia mono ── */
.mono {
    font-family: var(--mono);
    font-feature-settings: "tnum";
    letter-spacing: -0.01em;
}

/* ── App shell (sidebar layout) ── */
.app-shell {
    display: grid;
    grid-template-columns: 256px 1fr;
    min-height: 100vh;
    background: var(--bg);
}

/* ── SIDEBAR ── */
.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    background: var(--panel);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 16px 12px 12px;
    gap: 2px;
    flex-shrink: 0;
    z-index: 200;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}
.sb-mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(140deg, var(--brand, #0d9488) 0%, var(--brand-deep, #0f766e) 100%);
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-family: var(--mono);
    font-size: 13px; font-weight: 600;
    flex-shrink: 0;
}
.sb-name {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--ink);
}
.sb-name .tld { color: var(--muted); font-weight: 400; }
.sb-tagline { font-size: 11px; color: var(--muted); margin-top: 1px; }

.sb-section {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 12px 4px;
}
.sb-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--ink2);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.sb-link svg { color: var(--muted); flex-shrink: 0; }
.sb-link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.sb-link:hover svg { color: var(--ink2); }
.sb-link.active { background: var(--brand-tint, #f0fdfa); color: var(--brand-deep, #0f766e); font-weight: 600; }
.sb-link.active svg { color: var(--brand, #0d9488); }
.sb-link .sb-count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
    background: var(--bg);
    padding: 1px 7px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
}
.sb-link.active .sb-count { background: var(--panel); color: var(--brand-deep, #0f766e); border-color: var(--brand-soft, #ccfbf1); }

.sb-foot {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.sb-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
}
.sb-avatar {
    width: 30px; height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand, #0d9488), var(--brand-deep, #0f766e));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono);
    font-size: 10px; font-weight: 600;
    flex-shrink: 0;
}
.sb-user-meta { font-size: 12px; line-height: 1.3; }
.sb-user-meta .sb-user-name { font-weight: 600; color: var(--ink); }
.sb-user-meta .sb-user-role { color: var(--muted); font-size: 11px; }

/* Sidebar overlay + drawer na mobile */
.sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 199;
}
.sb-overlay.open { display: block; }
.sb-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
    color: var(--ink);
    flex-shrink: 0;
}

/* ── Content area ── */
.app-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* ── Topbar (nowy) ── */
.app-topbar {
    display: flex;
    align-items: center;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
    gap: 14px;
    background: var(--panel);
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-topbar .tb-crumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--muted);
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-topbar .tb-crumb a { color: var(--muted); text-decoration: none; }
.app-topbar .tb-crumb a:hover { color: var(--ink); }
.app-topbar .tb-crumb .sep { color: var(--line2); }
.app-topbar .tb-crumb .cur { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.app-topbar .tb-spacer { flex: 1; }

/* ── Karty (nowy system) ── */
.tb-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}

/* ── Chip / badge ── */
.tb-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 11.5px;
    font-weight: 600;
    background: var(--bg);
    color: var(--ink2);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.tb-chip.brand { background: var(--brand-tint, #f0fdfa); color: var(--brand-deep, #0f766e); border-color: var(--brand-soft, #99f6e4); }
.tb-chip.accent { background: var(--accent-soft, #fff7ed); color: var(--accent-deep, #9a3412); border-color: #fed7aa; }
.tb-chip.good  { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.tb-chip.muted { background: var(--bg); color: var(--muted); }
.tb-chip .dot  { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ── Stat label / num ── */
.tb-stat-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tb-stat-num {
    font-family: var(--mono);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--ink);
}
.tb-stat-num.mid { font-size: 22px; }
.tb-stat-num.sm  { font-size: 16px; }
.tb-stat-sub {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
}

/* ── Battery glyph (CSS-only) ── */
.bat-glyph {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
}
.bat-cap {
    width: 40%;
    height: 3px;
    background: var(--border-strong, #94a3b8);
    border-radius: 2px 2px 0 0;
    flex-shrink: 0;
}
.bat-body {
    border-radius: 7px;
    border: 1.5px solid var(--border-2, #cbd5e1);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-weight: 600;
    color: var(--ink2);
    line-height: 1;
}
/* Warianty chemii */
.bat-glyph.alkaline .bat-body { background: var(--brand-tint, #f0fdfa); border-color: var(--brand-soft, #99f6e4); color: var(--brand-deep, #0f766e); }
.bat-glyph.alkaline .bat-cap  { background: var(--brand, #0d9488); }
.bat-glyph.lithium  .bat-body { background: var(--accent-soft, #fff7ed); border-color: #fed7aa; color: var(--accent-deep, #9a3412); }
.bat-glyph.lithium  .bat-cap  { background: var(--accent-new, #ea580c); }
.bat-glyph.li-ion   .bat-body { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.bat-glyph.li-ion   .bat-cap  { background: #3b82f6; }
.bat-glyph.nimh     .bat-body { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.bat-glyph.nimh     .bat-cap  { background: #7c3aed; }
.bat-glyph.zinc     .bat-body { background: var(--bg); border-color: var(--line2); color: var(--muted); }
.bat-glyph.zinc     .bat-cap  { background: var(--border-strong, #94a3b8); }

/* ── Gauge (SVG circular) ── */
.tb-gauge {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.tb-gauge svg { transform: rotate(-90deg); display: block; }
.tb-gauge .ring-bg { fill: none; stroke: var(--line); stroke-width: 6; }
.tb-gauge .ring-fg { fill: none; stroke: var(--brand, #0d9488); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.tb-gauge .tb-gauge-val {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
}
.tb-gauge .tb-gauge-val .gauge-max {
    font-size: 0.38em;
    color: var(--muted);
    font-weight: 400;
    margin-top: 3px;
}

/* ── mAh progress bar ── */
.tb-mah { display: flex; align-items: center; gap: 8px; }
.tb-mah .track {
    flex: 1;
    height: 5px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.tb-mah .fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ink-ghost, #94a3b8);
}
.tb-mah.gold   .fill { background: var(--accent-new, #ea580c); }
.tb-mah.brand  .fill { background: var(--brand, #0d9488); }
.tb-mah.accent .fill { background: var(--accent-new, #ea580c); }

/* ── Buttons (nowe) ── */
.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--sans);
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    white-space: nowrap;
    text-decoration: none;
}
.tb-btn:hover { background: var(--bg); text-decoration: none; }
.tb-btn.brand { background: var(--brand, #0d9488); color: white; border-color: var(--brand, #0d9488); }
.tb-btn.brand:hover { background: var(--brand-2, #0b8276); }
.tb-btn.ghost { background: transparent; }

/* ── Sekcja content ── */
.tb-section { padding: 28px 28px 0; }
.tb-section-last { padding-bottom: 48px; }
.tb-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.tb-section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; margin: 0; color: var(--ink); }
.tb-section-head p  { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* ── Karty KPI ── */
.tb-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.tb-kpi-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.tb-kpi-card .accent-bar {
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--brand, #0d9488);
    border-radius: 0;
}

/* ── Bento metrics grid ── */
.tb-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.tb-metric-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px;
}

/* ── Verdict card ── */
.tb-verdict {
    background: linear-gradient(160deg, #fefce8 0%, #fffbeb 100%);
    border-color: #fde68a;
}
.tb-verdict.brand-verdict {
    background: linear-gradient(160deg, var(--brand-tint, #f0fdfa) 0%, var(--brand-soft, #ccfbf1) 100%);
    border-color: var(--brand-soft, #99f6e4);
}

/* ── Gdzie kupić — lista sklepów ── */
.tb-shop-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
}
.tb-shop-row:hover { border-color: var(--brand, #0d9488); box-shadow: var(--shadow-sm); text-decoration: none; }
.tb-shop-row.is-best { border-color: var(--ink); border-width: 1.5px; }
.tb-shop-best-badge {
    position: absolute;
    top: -9px; left: 12px;
    background: var(--ink);
    color: white;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
}
.tb-shop-name { font-size: 14px; font-weight: 600; }
.tb-shop-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tb-shop-price { font-family: var(--mono); font-size: 15px; font-weight: 600; text-align: right; }
.tb-shop-price-per { font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-align: right; }

/* ── Discharge placeholder ── */
.tb-discharge-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 200px;
    background: var(--bg);
    border-radius: 10px;
    border: 2px dashed var(--line2);
    color: var(--muted);
    text-align: center;
    padding: 24px;
}
.tb-discharge-placeholder strong { font-size: 15px; color: var(--ink2); }
.tb-discharge-placeholder p { font-size: 13px; margin: 0; }

/* ── Pros / Cons ── */
.tb-pros-cons-list { display: flex; flex-direction: column; gap: 8px; }
.tb-pros-cons-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.45;
}
.tb-pros-cons-icon { flex-shrink: 0; margin-top: 2px; font-size: 12px; font-weight: 800; }
.tb-pros-icon  { color: #047857; }
.tb-cons-icon  { color: var(--bad, #dc2626); }

/* ── Related products grid ── */
.tb-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.tb-related-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.tb-related-card:hover { border-color: var(--brand, #0d9488); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }

/* ── Tabela specyfikacji ── */
.tb-specs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb-specs-table th {
    text-align: left;
    padding: 9px 0;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line);
}
.tb-specs-table td {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.tb-specs-table tr:last-child td { border-bottom: none; }
.tb-specs-table .tb-diff-pos { color: #047857; font-weight: 600; }
.tb-specs-table .tb-diff-neg { color: var(--bad, #dc2626); font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        height: 100vh;
        z-index: 300;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sb-hamburger { display: inline-flex; }
    .app-topbar { padding: 10px 16px; }
    .tb-section { padding: 20px 16px 0; }
    .tb-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .tb-metrics-grid { grid-template-columns: repeat(3, 1fr); }
    .tb-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
    .tb-kpi-grid { grid-template-columns: 1fr 1fr; }
    .tb-metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .tb-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .tb-metrics-grid { grid-template-columns: 1fr 1fr; }
    .tb-related-grid { grid-template-columns: 1fr 1fr; }
}
