/* SPDX-License-Identifier: MIT
   Copyright (C) 2026 INE RP
   INE ADMIN — wspólny arkusz wszystkich paneli (Master / Admin / Report).
   Ciemny, czysty interfejs z akcentem INE (złoto/pomarańcz). */

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

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }

:root {
    --bg: #08080b;
    --bg-2: #0b0b11;
    --surface: #101017;
    --surface-2: #14141d;
    --surface-3: #191924;
    --line: rgba(255, 255, 255, .07);
    --line-2: rgba(255, 184, 76, .22);
    --text: #f4f0e8;
    --text-strong: #fffaf0;
    --muted: #9b97a8;
    --dim: #6f6b7c;
    --gold: #ffb020;
    --gold-2: #ff8a00;
    --gold-3: #ffd77a;
    --ok: #5fe0a0;
    --danger: #ff7a6b;
    --info: #7cc4ff;
    --radius: 16px;
    --ease: cubic-bezier(.22, .68, 0, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --font-display: "Plus Jakarta Sans", "Manrope", system-ui, sans-serif;
    --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    --shadow: 0 18px 44px rgba(0, 0, 0, .45);
    --shadow-lift: 0 22px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 184, 76, .12);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(60% 42% at 18% -8%, rgba(255, 138, 0, .13), transparent 62%),
        radial-gradient(50% 40% at 92% 0%, rgba(255, 176, 32, .08), transparent 60%),
        linear-gradient(180deg, var(--bg-2), var(--bg) 55%);
    background-attachment: fixed;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(80% 60% at 50% 0%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 20%, transparent 78%);
}

/* ============================================================ topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px max(18px, calc((100vw - 1240px) / 2));
    background: rgba(8, 8, 11, .82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.tb-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
}
.tb-logo-img {
    display: block;
    height: 34px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
    border-radius: 6px;
    filter: drop-shadow(0 3px 12px rgba(255, 138, 0, .28));
    transition: transform .25s var(--ease), filter .25s var(--ease);
}
.tb-brand:hover .tb-logo-img { transform: translateY(-1px); filter: drop-shadow(0 5px 16px rgba(255, 160, 60, .45)); }
.tb-panel {
    font-family: var(--font-display);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-3);
    padding: 4px 9px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(255, 176, 32, .07);
    white-space: nowrap;
}

.tb-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 13px 5px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    min-width: 0;
}
.tb-avatar, .tb-avatar-img {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line-2);
}
.tb-avatar {
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--gold-2), var(--gold));
    color: #1a1205;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
}
.tb-user { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tb-nick {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text-strong);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tb-role { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tb-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    transition: color .18s, border-color .18s, background .18s;
}
.tb-logout:hover { color: var(--danger); border-color: rgba(255, 122, 107, .35); background: rgba(255, 122, 107, .08); }

/* ============================================================ main */

.ine-main {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 22px 72px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 4px 0 22px;
}
.page-head .eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 7px;
}
.page-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(21px, 3vw, 27px);
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text-strong);
}
.page-head p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    max-width: 72ch;
}
.page-head .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; color: var(--dim); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-3); }

/* ============================================================ cards */

.ine-card {
    position: relative;
    background: linear-gradient(180deg, var(--surface), #0d0d13);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    animation: fadeUp .42s var(--ease-out) both;
}
.ine-card h2, .ine-card h3 {
    margin: 0 0 14px;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.005em;
    color: var(--text-strong);
}
.ine-card h2 { font-size: 18px; }
.ine-card h3 { font-size: 14.5px; }
.ine-card h3::after {
    content: "";
    display: block;
    width: 26px;
    height: 2px;
    margin-top: 8px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}
.ine-card > p { color: var(--muted); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.ine-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 920px) { .ine-grid-2 { grid-template-columns: 1fr; } }

/* ============================================================ kpi */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 12px;
}
.kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 15px 16px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.kpi::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-2), var(--gold), transparent);
    opacity: .75;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--line-2); background: var(--surface-3); }
.kpi-num {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--text-strong);
    letter-spacing: -.02em;
}
.kpi-lab {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ============================================================ tables */

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ine-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.ine-table th {
    text-align: left;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.ine-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .045);
    vertical-align: middle;
}
.ine-table tr:last-child td { border-bottom: 0; }
.ine-table tbody tr:hover td, .ine-table tr:hover td { background: rgba(255, 176, 32, .045); }
.ine-table td b, .ine-table td strong { color: var(--text-strong); }

/* ============================================================ forms */

form input, form textarea, form select, .sp-input, .inp {
    width: 100%;
    margin: 3px 0 9px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #0b0b10;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
form textarea { resize: vertical; min-height: 84px; }
form input::placeholder, form textarea::placeholder { color: var(--dim); }
form input:focus, form textarea:focus, form select:focus, .inp:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, .13);
    background: #0e0e14;
}
form label {
    display: block;
    margin: 10px 0 2px;
    font-size: 9.5px;
    letter-spacing: .13em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--dim);
}
form input[type="file"] { padding: 7px; font-size: 12px; }
form input[type="checkbox"] { width: auto; }
input[type="hidden"] { display: none; }

/* ============================================================ buttons */

.btn-ine, .btn-ghost, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    padding: 9px 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: .01em;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform .18s var(--ease), filter .18s, background .18s, border-color .18s;
    white-space: nowrap;
}
.btn-ine {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #1d1305;
    box-shadow: 0 8px 20px rgba(255, 138, 0, .18);
}
.btn-ine:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-ine:active { transform: translateY(0); }
.btn-ghost {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--line-2); background: var(--surface-3); }
.btn-danger {
    background: rgba(255, 122, 107, .1);
    border-color: rgba(255, 122, 107, .3);
    color: #ffa89e;
}
.btn-danger:hover { background: rgba(255, 122, 107, .18); border-color: rgba(255, 122, 107, .5); }
.btn-ine.big { font-size: 14px; padding: 13px 22px; border-radius: 12px; }
.btn-ine.wide, .btn-ghost.wide { width: 100%; }
.btn-ine:disabled, .btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================ alerts */

.alert {
    padding: 11px 15px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--surface-2);
}
.alert.ok-n { border-color: rgba(95, 224, 160, .28); background: rgba(95, 224, 160, .08); color: #b8f5d6; }
.alert.warn-n { border-color: rgba(255, 176, 32, .3); background: rgba(255, 176, 32, .08); color: #ffe0a3; }
.alert.bad-n { border-color: rgba(255, 122, 107, .3); background: rgba(255, 122, 107, .08); color: #ffb7ad; }

/* ============================================================ side menu */

.side-menu {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 5px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    width: fit-content;
    max-width: 100%;
}
.side-menu a {
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: color .18s, background .18s, border-color .18s;
}
.side-menu a:hover { color: var(--text); background: var(--surface-3); }
.side-menu a.is-active, .side-menu a:hover.is-active {
    color: var(--gold-3);
    background: rgba(255, 176, 32, .1);
    border-color: var(--line-2);
}

/* ============================================================ links grid */

.ine-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 12px;
}
.ine-card-link {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 42px 16px 17px;
    transition: transform .28s var(--ease), border-color .25s, background .25s;
    animation: fadeUp .42s var(--ease-out) both;
}
.ine-card-link::after {
    content: "→";
    position: absolute;
    top: 15px;
    right: 16px;
    font-size: 14px;
    color: var(--dim);
    transition: color .2s, transform .25s var(--ease);
}
.ine-card-link b {
    display: block;
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 3px;
}
.ine-card-link span { display: block; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.ine-card-link:hover {
    transform: translateY(-3px);
    border-color: var(--line-2);
    background: var(--surface-3);
}
.ine-card-link:hover::after { color: var(--gold); transform: translateX(3px); }

/* ============================================================ chat */

.chat-msg {
    position: relative;
    margin-bottom: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 2px solid var(--line);
}
.chat-msg.admin { border-left-color: var(--gold); background: rgba(255, 176, 32, .05); }
.chat-msg b { font-size: 12px; }
.chat-msg pre, .chat-msg p {
    margin: 5px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-body);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text);
}
.chat-msg .hud-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 7px;
    font-size: 10px;
    color: var(--dim);
}
.chat-upload { margin-top: 8px; }
.chat-upload img { max-width: 320px; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); }

/* ============================================================ badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    background: var(--surface-3);
    color: var(--muted);
}
.badge.new { background: rgba(255, 176, 32, .1); color: var(--gold-3); border-color: rgba(255, 176, 32, .28); }
.badge.assigned { background: rgba(124, 196, 255, .1); color: #a6d8ff; border-color: rgba(124, 196, 255, .28); }
.badge.hold { background: rgba(255, 215, 122, .09); color: #ffe2a3; border-color: rgba(255, 215, 122, .25); }
.badge.closed, .badge.passed { background: rgba(95, 224, 160, .1); color: #b8f5d6; border-color: rgba(95, 224, 160, .28); }
.badge.rejected, .badge.failed, .badge.blacklist { background: rgba(255, 122, 107, .1); color: #ffb7ad; border-color: rgba(255, 122, 107, .28); }
.badge.queue, .badge.pending, .badge.in_progress { background: rgba(255, 255, 255, .05); color: var(--muted); }

/* ============================================================ misc */

.mono { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.empty { padding: 22px; text-align: center; color: var(--dim); font-size: 12.5px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ============================================================ footer */

.footer {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 24px 16px 30px;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(155, 151, 168, .55);
    border-top: 1px solid var(--line);
}

/* ============================================================ login */

.login-shell {
    position: relative;
    z-index: 5;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}
.login-card {
    width: 100%;
    max-width: 460px;
    padding: 34px 34px 30px;
    border-radius: 22px;
    border: 1px solid var(--line-2);
    background: linear-gradient(180deg, var(--surface-2), #0b0b11);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .02) inset;
    text-align: center;
    animation: fadeUp .5s var(--ease-out) both;
}
.login-card img.login-logo {
    height: 52px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 20px;
    display: block;
    filter: drop-shadow(0 6px 20px rgba(255, 138, 0, .3));
}
.login-card h1 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-strong);
}
.login-card p {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}
.login-badge {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
    padding: 4px 10px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(255, 176, 32, .06);
}
.login-foot { margin-top: 22px; font-size: 10.5px; color: var(--dim); letter-spacing: .06em; }

/* ============================================================ responsive */

@media (max-width: 760px) {
    .topbar { padding: 9px 14px; gap: 10px; }
    .tb-logo-img { height: 28px; max-width: 150px; }
    .tb-panel { display: none; }
    .tb-role { display: none; }
    .tb-profile { padding: 4px; }
    .tb-user { display: none; }
    .tb-logout { padding: 7px 10px; font-size: 11px; }
    .ine-main { padding: 20px 13px 60px; }
    .ine-card { padding: 17px 15px; border-radius: 14px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .ine-links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
