/* ==============================================================================================
   HexorOne — panel licencji. Wygląd korporacyjny, bez kroku budowania.

   Arkusz pisany ręcznie, a nie generowany z narzędzia klas użytkowych, i to jest świadome:
   panel wydawcy bywa stawiany w sieci bez wyjścia na zewnątrz, a wdrożenie nie może wymagać
   node'a ani pobierania czegokolwiek. Reguł jest kilkaset i tyle samo wyprodukowałby generator.

   Paleta: granat i indygo. Bez wesołych kolorów — to ekran, na którym zawiesza się komuś licencję.
   ============================================================================================== */

:root {
    --granat: #0b1220;
    --granat-2: #131c2e;
    --granat-3: #1c2740;
    --indygo: #4f46e5;
    --indygo-2: #6366f1;
    --indygo-ciemny: #4338ca;
    --tlo: #f4f6fb;
    --biel: #ffffff;
    --obwodka: #e4e8f0;
    --obwodka-2: #eef1f6;
    --tekst: #0f172a;
    --tekst-2: #475569;
    --tekst-slaby: #7c8798;
    --zielony: #047857;
    --zielony-2: #10b981;
    --zielony-tlo: #ecfdf5;
    --bursztyn: #b45309;
    --bursztyn-2: #f59e0b;
    --bursztyn-tlo: #fffbeb;
    --czerwony: #b91c1c;
    --czerwony-2: #ef4444;
    --czerwony-tlo: #fef2f2;
    --cien: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .05);
    --cien-2: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 28px rgba(15, 23, 42, .08);
    --promien: 12px;
}

/* Tryb ciemny podąża za ustawieniem systemu — bez przełącznika w interfejsie, bo to jedna
   dodatkowa decyzja dla użytkownika, której panel administracyjny nie musi wymuszać. */
@media (prefers-color-scheme: dark) {
    :root {
        --tlo: #0a0e17;
        --biel: #10182a;
        --obwodka: #232f47;
        --obwodka-2: #1a2439;
        --tekst: #e7ecf7;
        --tekst-2: #a7b2c8;
        --tekst-slaby: #74839c;
        --zielony-tlo: rgba(16, 185, 129, .12);
        --bursztyn-tlo: rgba(245, 158, 11, .12);
        --czerwony-tlo: rgba(239, 68, 68, .12);
        --cien: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
        --cien-2: 0 2px 6px rgba(0, 0, 0, .35), 0 16px 32px rgba(0, 0, 0, .35);
    }
    .karta > header { background: linear-gradient(180deg, #131d33, var(--biel)); }
    table.lista th { background: #0d1524; }
    table.lista tbody tr:hover td { background: #131d33; }
    .pasek-gorny .szukaj input { background: #0a0e17; }
    .pasek-gorny .szukaj input:focus { background: var(--biel); }
    input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
        background: #0d1524; border-color: #2a3752; color: var(--tekst);
    }
    .przycisk.wtorny { background: var(--biel); border-color: #2a3752; color: var(--tekst-2); }
    .przycisk.wtorny:hover { background: #131d33; color: var(--tekst); }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tekst);
    background: var(--tlo);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--indygo); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.02em; }

.ikona { flex-shrink: 0; }

/* ── UKŁAD ────────────────────────────────────────────────────────────────────────────────── */

.powloka { display: flex; min-height: 100vh; }

.bok {
    width: 252px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--granat) 0%, var(--granat-2) 100%);
    color: #aab6c8;
    padding: 20px 0 18px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.bok .marka { padding: 0 20px 18px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.07); }
.bok .marka .znak {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--indygo-2), var(--indygo-ciemny));
    color: #fff; font-weight: 800; font-size: 15px; margin-bottom: 9px;
    box-shadow: 0 4px 14px rgba(79,70,229,.35);
}
.bok .marka strong { color: #fff; font-size: 15px; display: block; }
.bok .marka span { font-size: 10.5px; color: #61708a; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }

.bok .grupa { padding: 14px 20px 5px; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #55647d; font-weight: 700; }

.bok nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px; color: #aab6c8; font-weight: 500;
    border-left: 3px solid transparent; transition: background .12s, color .12s;
}
.bok nav a .ikona { opacity: .75; transition: opacity .12s; }
.bok nav a:hover { background: rgba(255,255,255,.04); color: #fff; text-decoration: none; }
.bok nav a:hover .ikona { opacity: 1; }
.bok nav a.aktywny { background: rgba(99,102,241,.14); border-left-color: var(--indygo-2); color: #fff; font-weight: 600; }
.bok nav a.aktywny .ikona { opacity: 1; }
.bok nav a .licznik {
    margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
    background: rgba(255,255,255,.09); color: #cbd5e1;
}
.bok nav a .licznik.alarm { background: rgba(239,68,68,.9); color: #fff; }

.bok .stopka { margin-top: auto; padding: 14px 20px 0; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #61708a; }
.bok .stopka strong { display: block; color: #cbd5e1; font-weight: 600; }
.bok .stopka form { margin: 6px 0 0; }
.bok .stopka button { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: #8493a8; cursor: pointer; padding: 0; font: inherit; font-size: 12px; }
.bok .stopka button:hover { color: #fff; text-decoration: underline; }

.tresc { flex: 1; min-width: 0; }

.pasek-gorny {
    background: var(--biel); border-bottom: 1px solid var(--obwodka);
    padding: 0 30px; height: 58px; display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 10;
}
.pasek-gorny .szukaj { flex: 1; max-width: 420px; position: relative; display: flex; align-items: center; }
.pasek-gorny .szukaj .ikona { position: absolute; left: 12px; color: var(--tekst-slaby); pointer-events: none; }
.pasek-gorny .szukaj input {
    width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--obwodka); border-radius: 9px;
    background: var(--tlo); font: inherit; color: inherit;
}
.pasek-gorny .szukaj input:focus { background: var(--biel); }
.pasek-gorny .data { margin-left: auto; font-size: 12.5px; color: var(--tekst-slaby); }

.strona { padding: 24px 30px 60px; animation: wjazd .25s ease-out; }

@keyframes wjazd {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .strona { animation: none; }
}

.naglowek { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.naglowek h1 { margin: 0; font-size: 23px; }
.naglowek p { margin: 4px 0 0; color: var(--tekst-2); max-width: 62ch; }

.okruszki { font-size: 12px; color: var(--tekst-slaby); margin-bottom: 8px; }
.okruszki a { color: var(--tekst-slaby); }

/* ── KARTY I SIATKI ───────────────────────────────────────────────────────────────────────── */

.karta { background: var(--biel); border: 1px solid var(--obwodka); border-radius: var(--promien); box-shadow: var(--cien); overflow: hidden; }
.karta + .karta { margin-top: 18px; }
.karta > header {
    padding: 14px 18px; border-bottom: 1px solid var(--obwodka-2);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: linear-gradient(180deg, #fcfdff, var(--biel));
}
.karta > header h2 { margin: 0; font-size: 13.5px; font-weight: 700; }
.karta > header .pod { margin: 2px 0 0; font-size: 12px; color: var(--tekst-slaby); font-weight: 400; }
.karta > .ciało { padding: 18px; }

.siatka { display: grid; gap: 16px; }
.siatka.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.siatka.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.siatka.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.siatka.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { .siatka.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .siatka.k4, .siatka.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) {
    .siatka.k2, .siatka.k3, .siatka.k4, .siatka.k6 { grid-template-columns: 1fr; }
    .bok { display: none; }
    .strona, .pasek-gorny { padding-left: 16px; padding-right: 16px; }
}

/* ── WSKAŹNIKI ────────────────────────────────────────────────────────────────────────────── */

.wskaznik {
    background: var(--biel); border: 1px solid var(--obwodka); border-radius: var(--promien);
    padding: 15px 17px; box-shadow: var(--cien); position: relative; overflow: hidden;
    display: block; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.wskaznik:hover { text-decoration: none; box-shadow: var(--cien-2); border-color: #d5dbe6; transform: translateY(-2px); }
.wskaznik::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--indygo-2); opacity: .85; }
.wskaznik.uwaga::before { background: var(--bursztyn-2); }
.wskaznik.alarm::before { background: var(--czerwony-2); }
.wskaznik.dobrze::before { background: var(--zielony-2); }
.wskaznik .ikona { position: absolute; top: 14px; right: 15px; color: var(--indygo-2); opacity: .5; }
.wskaznik.uwaga .ikona { color: var(--bursztyn-2); }
.wskaznik.alarm .ikona { color: var(--czerwony-2); }
.wskaznik.dobrze .ikona { color: var(--zielony-2); }
.wskaznik .etykieta { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--tekst-slaby); font-weight: 700; padding-right: 20px; }
.wskaznik .liczba { font-size: 27px; font-weight: 800; letter-spacing: -.035em; margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.wskaznik .opis { font-size: 11.5px; color: var(--tekst-slaby); margin-top: 2px; }
.wskaznik.uwaga .liczba { color: var(--bursztyn); }
.wskaznik.alarm .liczba { color: var(--czerwony); }
.wskaznik.dobrze .liczba { color: var(--zielony); }

/* ── TABELE ───────────────────────────────────────────────────────────────────────────────── */

table.lista { width: 100%; border-collapse: collapse; }
table.lista th {
    text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--tekst-slaby); padding: 10px 18px; border-bottom: 1px solid var(--obwodka);
    white-space: nowrap; background: #fbfcfe; font-weight: 700;
}
table.lista td { padding: 11px 18px; border-bottom: 1px solid var(--obwodka-2); vertical-align: middle; }
table.lista tr:last-child td { border-bottom: 0; }
table.lista tbody tr { transition: background .1s; }
table.lista tbody tr:hover td { background: #f9fbff; }
table.lista td.liczbowo, table.lista th.liczbowo { text-align: right; font-variant-numeric: tabular-nums; }
.klucz { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; letter-spacing: .01em; }

.pusto { padding: 44px 18px; text-align: center; color: var(--tekst-slaby); }
.pusto strong { display: block; color: var(--tekst-2); margin-bottom: 3px; }

/* ── ODZNAKI ──────────────────────────────────────────────────────────────────────────────── */

.odznaka {
    display: inline-block; padding: 2.5px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.odznaka.zielony { background: var(--zielony-tlo); color: var(--zielony); border-color: #a7f3d0; }
.odznaka.bursztyn { background: var(--bursztyn-tlo); color: var(--bursztyn); border-color: #fde68a; }
.odznaka.czerwony { background: var(--czerwony-tlo); color: var(--czerwony); border-color: #fecaca; }
.odznaka.szary { background: #f1f4f9; color: var(--tekst-2); border-color: var(--obwodka); }
.odznaka.indygo { background: #eef2ff; color: var(--indygo-ciemny); border-color: #c7d2fe; }

/* ── FORMULARZE ───────────────────────────────────────────────────────────────────────────── */

label.pole { display: block; margin-bottom: 14px; }
label.pole > span { display: block; font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 5px; }
label.pole > small { display: block; color: var(--tekst-slaby); font-size: 11.5px; margin-top: 4px; line-height: 1.45; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #ccd3e0; border-radius: 9px;
    font: inherit; color: inherit; background: var(--biel); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--indygo); box-shadow: 0 0 0 3px rgba(79,70,229,.11); }
textarea { min-height: 78px; resize: vertical; }
input[type=checkbox] { width: auto; }

.przycisk {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 9px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    background: var(--indygo); color: #fff; transition: background .12s, transform .1s;
}
.przycisk:hover { background: var(--indygo-ciemny); text-decoration: none; color: #fff; }
.przycisk:active { transform: translateY(1px); }
.przycisk.wtorny { background: var(--biel); color: #334155; border-color: #ccd3e0; }
.przycisk.wtorny:hover { background: #f7f9fc; color: #1e293b; }
.przycisk.grozny { background: var(--czerwony-2); }
.przycisk.grozny:hover { background: var(--czerwony); }
.przycisk.maly { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

/* ── KOMUNIKATY ───────────────────────────────────────────────────────────────────────────── */

.komunikat { padding: 12px 16px; border-radius: var(--promien); margin-bottom: 18px; border: 1px solid; }
.komunikat.sukces { background: var(--zielony-tlo); border-color: #a7f3d0; color: #065f46; }
.komunikat.blad { background: var(--czerwony-tlo); border-color: #fecaca; color: #991b1b; }
.komunikat.uwaga { background: var(--bursztyn-tlo); border-color: #fde68a; color: #92400e; }
.komunikat ul { margin: 6px 0 0; padding-left: 18px; }

/* ── WYKRESY (SVG rysowane po stronie serwera) ────────────────────────────────────────────── */

.wykres { width: 100%; display: block; }
.wykres .slupek { fill: var(--indygo-2); }
.wykres .slupek.uwaga { fill: var(--bursztyn-2); }
.wykres .slupek.alarm { fill: var(--czerwony-2); }
.wykres .os { stroke: var(--obwodka); stroke-width: 1; }
.wykres text { font-size: 9.5px; fill: var(--tekst-slaby); font-family: inherit; }

.legenda { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; font-size: 12px; }
.legenda span.kropka { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.pasek-udzialu { height: 8px; border-radius: 999px; background: var(--obwodka-2); overflow: hidden; display: flex; }
.pasek-udzialu i { display: block; height: 100%; }

/* ── LOGOWANIE ────────────────────────────────────────────────────────────────────────────── */

.ekran-logowania {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background:
        radial-gradient(1200px 600px at 50% -10%, #1e2b47 0%, var(--granat) 60%),
        linear-gradient(var(--granat) 0%, var(--granat) 100%);
    background-blend-mode: normal;
    position: relative;
}
.ekran-logowania::before {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(700px 500px at 50% 20%, #000 0%, transparent 75%);
    mask-image: radial-gradient(700px 500px at 50% 20%, #000 0%, transparent 75%);
}
.ekran-logowania .panel { position: relative; width: 100%; max-width: 388px; background: var(--biel); border-radius: 16px; padding: 32px; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.ekran-logowania .znak { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, var(--indygo-2), var(--indygo-ciemny)); color: #fff; font-weight: 800; margin-bottom: 14px; box-shadow: 0 4px 14px rgba(79,70,229,.35); }
.ekran-logowania h1 { margin: 0 0 4px; font-size: 19px; }
.ekran-logowania p.pod { margin: 0 0 22px; color: var(--tekst-slaby); font-size: 13px; }

/* ── DROBIAZGI ────────────────────────────────────────────────────────────────────────────── */

.slaby { color: var(--tekst-slaby); }
.male { font-size: 12px; }
.prawo { text-align: right; }
.rzad { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rozdziel { margin-left: auto; }
.mono { font-family: ui-monospace, Consolas, monospace; }
hr.cienka { border: 0; border-top: 1px solid var(--obwodka-2); margin: 18px 0; }
.kwota { font-variant-numeric: tabular-nums; font-weight: 700; }
