/* app.css — wygląd nowych stron: logowanie, panel główny, administracja, konto */

:root {
    --bg: #f4f4f5;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #18181b;
    --text-2: #3f3f46;
    --muted: #71717a;
    --faint: #a1a1aa;

    --brand: #18181b;
    --accent: #e30613;
    --brand-600: #18181b;
    --brand-50: #f4f4f5;
    --brand-100: #e4e4e7;
    --ink: #18181b;

    --success: #059669;
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 8px 24px -6px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .22);
    --ring: 0 0 0 4px rgba(24, 24, 27, .10);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   Przyciski i pola
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; font-size: 14px; white-space: nowrap;
    cursor: pointer; user-select: none;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .15s, color .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(24, 24, 27, .25), inset 0 1px 0 rgba(255, 255, 255, .10); }
.btn-primary:hover { background: #3f3f46; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { height: 46px; font-size: 15px; border-radius: 11px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .icon { position: absolute; left: 13px; color: var(--faint); pointer-events: none; transition: color .15s; }
.input {
    width: 100%; height: 44px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input-wrap > .icon + .input { padding-left: 40px; }
.input-wrap:focus-within > .icon { color: var(--brand); }
.input-action {
    position: absolute; right: 6px; height: 32px; min-width: 32px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; background: transparent; color: var(--muted); border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.input-action:hover { background: #eef2f7; color: var(--text); }
.input-wrap.has-action .input { padding-right: 44px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.check small { display: block; color: var(--muted); font-size: 12.5px; }

/* Przełącznik */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-text strong { display: block; font-size: 14px; font-weight: 600; }
.switch-text small { display: block; font-size: 12.5px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
    position: relative; width: 40px; height: 23px; border-radius: 999px; background: #cbd5e1; flex-shrink: 0;
    transition: background .2s var(--ease);
}
.switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }

/* Komunikaty */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
    border: 1px solid; margin-bottom: 16px;
    animation: alertIn .35s var(--ease);
}
.alert .icon { margin-top: 1px; }
.alert-error { background: var(--danger-bg); border-color: #fecaca; color: #991b1b; }
.alert-success { background: var(--success-bg); border-color: #a7f3d0; color: #065f46; }
.alert-info { background: #f4f4f5; border-color: var(--border); color: var(--text-2); }
.alert-warning { background: var(--warning-bg); border-color: #fde68a; color: #92400e; }
@keyframes alertIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Znaczki */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: #f1f5f9; color: var(--text-2);
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-blue { background: var(--brand-50); color: var(--brand-600); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-dark { background: var(--ink); color: #fff; }

/* Awatar */
.avatar {
    --hue: 220;
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: hsl(var(--hue) 70% 94%); color: hsl(var(--hue) 55% 32%);
    font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px hsl(var(--hue) 60% 86%);
}
.avatar-lg { width: 42px; height: 42px; font-size: 14.5px; }

/* ============================================================
   EKRAN LOGOWANIA
   ============================================================ */
.login-body { background: #f4f4f5; position: relative; overflow-x: hidden; }

/* Tło: motyw linii i litery „Q” z logo */
.login-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.login-bg::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(#d4d4d8 1px, transparent 1px);
    background-size: 22px 22px; opacity: .55;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}
.login-line { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, #ff0000 20%, #ff0000 80%, transparent); opacity: .85; }
.login-line.l1 { top: 9vh; transform-origin: left; animation: lineIn 1.1s var(--ease) both; }
.login-line.l2 { bottom: 9vh; transform-origin: right; animation: lineIn 1.1s .15s var(--ease) both; }
@keyframes lineIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.login-q {
    position: absolute; width: min(62vh, 560px); right: -9vh; bottom: -14vh;
    color: #e4e4e7; opacity: .7;
    animation: qFloat 18s ease-in-out infinite alternate;
}
@keyframes qFloat { from { transform: rotate(0deg) translateY(0); } to { transform: rotate(-6deg) translateY(-14px); } }

.login-wrap {
    position: relative; z-index: 1; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    padding: 40px 16px;
}
.login-card {
    position: relative; width: 100%; max-width: 400px;
    background: #fff;
    border: 1px solid #e4e4e7; border-radius: 20px;
    padding: 40px 36px 34px;
    box-shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 24px 60px -20px rgba(24, 24, 27, .22);
    animation: cardIn .7s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.login-logo { display: flex; justify-content: center; margin-bottom: 30px; }
.login-logo .logo { width: 230px; height: auto; display: block; }
.login-form { display: grid; gap: 18px; }
.login-form .alert { margin: 0; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-row label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.login-form .btn-primary { margin-top: 6px; }
.login-copy { font-size: 12.5px; color: var(--faint); letter-spacing: .04em; }

.caps-warning { display: none; align-items: center; gap: 5px; font-size: 12px; color: var(--warning); font-weight: 600; }
.caps-warning.show { display: flex; }
.caps-warning .icon { width: 13px; height: 13px; }

.btn .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); transition: background .2s; }
.strength[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] span:nth-child(-n+2) { background: var(--warning); }
.strength[data-score="3"] span:nth-child(-n+3) { background: #65a30d; }
.strength[data-score="4"] span { background: var(--success); }

@media (max-width: 480px) {
    .login-card { padding: 32px 22px 26px; border-radius: 18px; }
    .login-logo .logo { width: 200px; }
    .login-q { width: 46vh; right: -14vh; bottom: -10vh; }
}

/* ============================================================
   UKŁAD APLIKACJI
   ============================================================ */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 26px; width: auto; display: block; }

.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 9px;
    font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s;
}
.topnav a .icon { width: 16px; height: 16px; }
.topnav a:hover { background: #eef2f7; color: var(--text); }
.topnav a.is-active { background: #f4f4f5; color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 9px 9px 4px 4px; }

.usermenu { position: relative; margin-left: auto; }
.usermenu summary {
    list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 4px 8px 4px 4px; border-radius: 999px; transition: background .15s;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: #eef2f7; }
.usermenu-name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; font-size: 13.5px; }
.usermenu-name small { font-weight: 500; color: var(--muted); font-size: 12px; }
.usermenu-chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.usermenu[open] .usermenu-chevron { transform: rotate(180deg); }
.usermenu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    animation: menuIn .18s var(--ease);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.usermenu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.usermenu-head strong { display: block; font-size: 14px; }
.usermenu-head span { font-size: 12.5px; color: var(--muted); }
.usermenu-panel a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.usermenu-panel a .icon { width: 16px; height: 16px; color: var(--muted); }
.usermenu-panel a:hover { background: var(--surface-2); color: var(--text); }
.usermenu-panel a.danger, .usermenu-panel a.danger .icon { color: var(--danger); }
.usermenu-panel a.danger:hover { background: var(--danger-bg); }
.usermenu-sep { height: 1px; background: var(--border); margin: 6px 0; }

.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 24px 48px; flex: 1; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a:hover { color: var(--brand); }
.crumbs .icon { width: 14px; height: 14px; transform: rotate(-90deg); }

.app-footer { text-align: center; padding: 22px; font-size: 12.5px; color: var(--faint); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 15.5px; font-weight: 700; }
.card-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 22px; }
.stack { display: grid; gap: 18px; }

/* ============================================================
   PANEL GŁÓWNY
   ============================================================ */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: 20px; padding: 30px 32px; margin-bottom: 28px;
    background: linear-gradient(135deg, #18181b 0%, #27272a 60%, #3f3f46 130%);
    color: #fff; box-shadow: var(--shadow-md);
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(90deg, transparent, #000 60%);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.hero::after {
    content: ""; position: absolute; z-index: -1; width: 360px; height: 360px; right: -80px; top: -160px;
    background: radial-gradient(circle, rgba(255, 255, 255, .10), transparent 65%);
}
.hero-date { font-size: 13px; color: #a1a1aa; font-weight: 600; }
.hero-date::first-letter { text-transform: uppercase; }
.hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.hero p { color: #d4d4d8; margin-top: 6px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stat {
    min-width: 128px; padding: 12px 16px; border-radius: 14px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(6px);
}
.hero-stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.hero-stat span { font-size: 12.5px; color: #d4d4d8; }
.hero-stat.warn b { color: #fcd34d; }
.hero-stat.bad b { color: #fca5a5; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.section-title h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.module {
    position: relative; display: flex; flex-direction: column; gap: 14px;
    padding: 22px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
    animation: modIn .5s var(--ease) both;
}
.module:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-100); }
.module:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-md); }
@keyframes modIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.module-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.module-ico {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
    background: #f4f4f5; color: var(--text-2);
    transition: background .25s, color .25s, transform .25s var(--ease);
}
.module-ico .icon { width: 22px; height: 22px; }
.module:hover .module-ico { background: var(--brand); color: #fff; transform: scale(1.04) rotate(-3deg); }
.module h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.module p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.module-foot { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.module-foot .metric b { color: var(--text); font-weight: 700; }
.module-foot .metric.warn b { color: var(--warning); }
.module-foot .metric.bad b:first-child { color: var(--danger); }
.module-go { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: background .2s, color .2s, transform .25s var(--ease); }
.module-go .icon { width: 15px; height: 15px; }
.module:hover .module-go { background: var(--brand-50); color: var(--brand); transform: translateX(3px); }

.empty-state { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-state .empty-ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: #eef2f7; color: var(--faint); }
.empty-state .empty-ico .icon { width: 26px; height: 26px; }
.empty-state h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ============================================================
   ADMINISTRACJA
   ============================================================ */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: #eaeef4; border-radius: 11px; margin-bottom: 18px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.tabs a .icon { width: 15px; height: 15px; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .count { font-size: 11.5px; background: #dfe5ee; color: var(--text-2); padding: 1px 7px; border-radius: 999px; }
.tabs a.is-active .count { background: var(--brand-50); color: var(--brand-600); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.stat-ico.green { background: var(--success-bg); color: var(--success); }
.stat-ico.amber { background: var(--warning-bg); color: var(--warning); }
.stat-ico.red { background: var(--danger-bg); color: var(--danger); }
.stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .input-wrap { flex: 1; min-width: 220px; max-width: 360px; }
.toolbar .input { height: 38px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .muted { color: var(--muted); font-size: 12.5px; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user strong { display: block; font-weight: 600; }
.cell-user span { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: var(--text-2); white-space: nowrap; }
.chip.view { background: #f1f5f9; color: var(--muted); }
.chip.edit { background: var(--brand-50); color: var(--brand-600); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions form { display: inline; margin: 0; }
.row-actions .btn-icon { color: var(--muted); background: transparent; border: 0; }
.row-actions .btn-icon:hover { background: #eef2f7; color: var(--text); }
.row-actions .btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); }
.row-actions .btn-icon .icon { width: 16px; height: 16px; }
.is-hidden { display: none !important; }

/* Formularz użytkownika */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }

.perm-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.perm-list { display: block; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.perm-row:last-child { border-bottom: 0; }
.perm-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.perm-info .module-ico { width: 36px; height: 36px; border-radius: 10px; }
.perm-info .module-ico .icon { width: 18px; height: 18px; }
.perm-info strong { display: block; font-size: 14px; font-weight: 600; }
.perm-info small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segmented { display: inline-flex; padding: 3px; background: #eef2f7; border-radius: 9px; flex-shrink: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input[value="edit"]:checked + label { color: var(--brand-600); }
.segmented input:focus-visible + label { box-shadow: var(--ring); }
.perm-card.is-disabled .perm-list { opacity: .45; pointer-events: none; }
.perm-admin-note { display: none; }
.perm-card.is-disabled .perm-admin-note { display: flex; margin: 16px 22px 0; }

/* Okno potwierdzenia */
.modal { border: 0; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(420px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
.modal[open] { animation: modalIn .22s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-body { padding: 24px; display: flex; gap: 16px; }
.modal-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger); flex-shrink: 0; }
.modal h3 { font-size: 16.5px; font-weight: 700; }
.modal p { color: var(--muted); margin-top: 6px; font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }

@media (max-width: 1080px) {
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .topbar-inner { padding: 0 16px; gap: 12px; }
    .topnav a span, .usermenu-name { display: none; }
    .brand-logo { height: 22px; }
    .page { padding: 22px 16px 40px; }
    .hero { padding: 24px 22px; }
    .hero h1 { font-size: 23px; }
    .hero-stat { min-width: calc(50% - 5px); flex: 1; }
    .form-row-2 { grid-template-columns: 1fr; }
    .perm-row { flex-direction: column; align-items: stretch; }
    .segmented { align-self: flex-start; }
    .table .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.badge .icon { width: 12px; height: 12px; }

/* ============================================================
   MODUŁY — wspólne elementy
   ============================================================ */
.page-wide { max-width: 1680px; }
.page-title { display: flex; align-items: center; gap: 14px; }
.page-ico {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0;
    background: #fff; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-xs);
}
.page-ico .icon { width: 22px; height: 22px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { flex-wrap: wrap; }

/* Menu „Moduły” w pasku */
.navmenu { position: relative; }
.navmenu summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px;
    border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; white-space: nowrap;
}
.navmenu summary::-webkit-details-marker { display: none; }
.navmenu summary .icon { width: 16px; height: 16px; }
.navmenu summary:hover, .navmenu[open] summary { background: #eef0f3; color: var(--text); }
.navmenu summary.is-active { background: #f4f4f5; color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 9px 9px 4px 4px; }
.navmenu-chevron { width: 14px !important; height: 14px !important; transition: transform .2s; }
.navmenu[open] .navmenu-chevron { transform: rotate(180deg); }
.navmenu-panel {
    position: absolute; left: 0; top: calc(100% + 8px); width: 280px; padding: 6px; z-index: 60;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    animation: menuIn .18s var(--ease);
}
.navmenu-panel a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.navmenu-panel a:hover { background: var(--surface-2); color: var(--text); }
.navmenu-panel a.is-active { background: var(--brand-50); color: var(--brand-600); }
.navmenu-panel small { margin-left: 6px; font-size: 11px; color: var(--faint); font-weight: 600; }
.navmenu-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #f4f4f5; color: var(--text-2); flex-shrink: 0; }
.navmenu-ico .icon { width: 16px; height: 16px; }
.navmenu-panel a.is-active .navmenu-ico { background: var(--brand); color: #fff; }

/* Pole wyboru i pole tekstowe w stylu .input */
select.input {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
textarea.input { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.input-sm { height: 38px; font-size: 14px; }
.input[type="date"], .input[type="month"] { min-width: 0; }
.input[type="file"] { padding: 9px 12px; height: auto; }

/* Pasek filtrów */
.filterbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filterbar .field { min-width: 150px; }
.filterbar .field > label { font-size: 12px; color: var(--muted); }
.filterbar .grow { flex: 1; min-width: 220px; }
.filterbar .input { height: 38px; font-size: 14px; }
.filterbar .btn { height: 38px; }
.filterbar .spacer { flex: 1; }

/* Tabele danych */
.card-table { overflow: hidden; }
.table-scroll { overflow: auto; max-height: calc(100vh - 92px); max-height: calc(100dvh - 92px); min-height: 160px; }
.card-table { scroll-margin-top: 76px; }
.table-scroll .table th { position: sticky; top: 0; z-index: 2; }
.table.data td { white-space: nowrap; }
.table.data td.wrap { white-space: normal; min-width: 160px; max-width: 360px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; color: var(--text); }
.table th a.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.table th a.sort:hover { color: var(--text); }
.table th a.sort.is-active { color: var(--brand); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.row-actions .btn-icon.text { width: auto; padding: 0 10px; font-size: 12.5px; font-weight: 600; gap: 6px; }

/* Kolorowe daty (terminy) */
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill-red { background: #fee2e2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.pill-yellow { background: #fef3c7; color: #a16207; box-shadow: inset 0 0 0 1px #fde68a; }
.pill-green { background: #dcfce7; color: #15803d; box-shadow: inset 0 0 0 1px #bbf7d0; }
.pill-empty { background: transparent; color: var(--faint); font-weight: 500; padding: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .l-red { background: #f87171; } .legend .l-yellow { background: #fbbf24; } .legend .l-green { background: #4ade80; }

/* Formularze modułów */
.form-card { max-width: 980px; }
.form-section { padding: 22px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 16px; }
.form-section-title .icon { width: 16px; height: 16px; color: var(--faint); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px 18px; }
.fields .span-all { grid-column: 1 / -1; }
.field .req { color: var(--accent); }
.subfields { padding: 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 12px; }
.subfields-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--text-2);
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.choice span:hover { border-color: var(--faint); }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); box-shadow: 0 0 0 3px rgba(24, 24, 27, .06); }
.choice input:focus-visible + span { box-shadow: var(--ring); }
.choice-card span { height: auto; padding: 14px 16px; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 220px; }
.choice-card span small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.file-current { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; }
.file-current a { color: var(--text); font-weight: 600; text-decoration: underline; }

/* Kafelki podkategorii (terminarz, faktury) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile {
    display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-100); }
.tile .module-ico { width: 44px; height: 44px; }
.tile:hover .module-ico { background: var(--brand); color: #fff; }
.tile h3 { font-size: 15px; font-weight: 700; }
.tile p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tile-meta { margin-left: auto; text-align: right; }
.tile-meta b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.tile-meta span { font-size: 11.5px; color: var(--muted); }
.tile-meta .bad { color: var(--danger); }

/* Statystyki w modułach */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi span { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi.is-alert { border-color: #fecaca; background: #fff7f7; }
.kpi.is-alert b { color: var(--danger); }
a.kpi { transition: box-shadow .2s, transform .2s var(--ease); }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Panel główny — klikalne statystyki */
a.hero-stat { transition: background .2s, transform .2s var(--ease), border-color .2s; display: block; }
a.hero-stat:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); transform: translateY(-2px); }
.hero-stat .go { display: flex; width: fit-content; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; font-weight: 600; color: #d4d4d8; }
.hero-stat .go .icon { width: 13px; height: 13px; }
.hero-stat.ok b { color: #86efac; }

/* Awizacje — karty kierowców */
.toolbar-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; }
.toolbar-card .input-wrap { flex: 1; min-width: 220px; }
.date-nav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-strong); }
.date-nav input { border: 0; height: 32px; padding: 0 8px; font-weight: 600; background: transparent; }
.date-nav input:focus { outline: none; }
.date-nav .btn-icon { width: 32px; height: 32px; }
.avz-list { display: grid; gap: 10px; }
.avz {
    display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) minmax(120px, .8fr) minmax(170px, 1fr) minmax(120px, .7fr) auto;
    gap: 16px; align-items: center; padding: 16px 18px;
}
.avz-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 3px; }
.avz-name { font-size: 15px; font-weight: 700; }
.avz-val { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.avz-sent { font-weight: 800; font-size: 15px; letter-spacing: .02em; color: var(--brand-600); }
.avz-actions { display: flex; gap: 4px; justify-content: flex-end; }
.btn.is-copied { background: var(--success-bg); color: var(--success); border-color: #a7f3d0; }

/* Urlopy — kalendarz */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-month { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.cal-dow { background: var(--surface-2); padding: 8px 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cal-dow.we { color: var(--faint); }
.cal-day { background: var(--surface); min-height: 104px; padding: 8px; display: flex; flex-direction: column; gap: 4px; position: relative; min-width: 0; }
.cal-day.empty { background: #fafafa; }
.cal-day.we { background: #fcfcfd; }
.cal-day.clickable { cursor: pointer; transition: background .15s; }
.cal-day.clickable:hover { background: #fafafa; }
.cal-num { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text-2); }
.cal-day.today .cal-num span:first-child { background: var(--brand); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-plus { opacity: 0; color: var(--muted); font-size: 16px; line-height: 1; transition: opacity .15s; }
.cal-day.clickable:hover .cal-plus { opacity: 1; }
.cal-ev { display: block; font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.na_zyczenie { background: #e0f2fe; color: #075985; }
.cal-ev.logiqa { background: #fee2e2; color: #991b1b; }
a.cal-ev:hover { filter: brightness(.95); }
.legend .l-nz { background: #7dd3fc; } .legend .l-lq { background: #fca5a5; }
.badge-nz { background: #e0f2fe; color: #075985; }
.badge-lq { background: #fee2e2; color: #991b1b; }

/* Kalkulator */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.calc-result { position: sticky; top: 84px; }
.res-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.res-row span:first-child { color: var(--text-2); }
.res-row .result-value, .res-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.res-total { margin-top: 10px; padding: 14px 16px; border-radius: 12px; background: #18181b; color: #fff; display: flex; justify-content: space-between; align-items: flex-start; }
.res-total small { display: block; color: #a1a1aa; font-size: 12px; }
.res-total .big { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.res-profit { margin-top: 10px; padding: 14px 16px; border-radius: 12px; display: flex; justify-content: space-between; align-items: flex-start; font-weight: 800; }
.res-profit.profit-row { background: var(--success-bg); color: var(--success); }
.res-profit.loss-row { background: var(--danger-bg); color: var(--danger); }
.calc-input { width: 100%; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.calc-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.calc-note { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
#toll_rows_container label { color: var(--muted); font-weight: 600; }
#toll_rows_container button { height: 40px; }

/* Leasingi */
.cell-sub { font-size: 12px; color: var(--muted); }
.money-pos { color: var(--success); font-weight: 700; }
.money-neg { color: var(--danger); font-weight: 700; }
.row-decision td { background: #fffbeb; }
.row-ended td { color: var(--muted); }
.col-draggable { cursor: grab; user-select: none; }
.col-draggable.is-dragging { opacity: .4; }
.col-draggable.drag-over-left { box-shadow: inset 3px 0 0 var(--brand); }
.col-draggable.drag-over-right { box-shadow: inset -3px 0 0 var(--brand); }
.decision-actions { display: flex; gap: 6px; justify-content: flex-end; }
.decision-actions form { margin: 0; }

@media (max-width: 1100px) {
    .avz { grid-template-columns: 1fr 1fr; }
    .avz-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .calc-grid { grid-template-columns: 1fr; }
    .calc-result { position: static; }
}
@media (max-width: 640px) {
    .avz { grid-template-columns: 1fr; }
    .cal-day { min-height: 64px; padding: 4px; }
    .cal-ev { font-size: 10px; padding: 2px 4px; }
    .filterbar .field { min-width: calc(50% - 6px); flex: 1; }
    .page-title h1 { font-size: 21px; }
    .page-ico { width: 40px; height: 40px; }
    .table-scroll { max-height: none; }
}

/* Wydruk */
.print-only { display: none; }
@media print {
    body { background: #fff; font-size: 12px; }
    .topbar, .app-footer, .no-print, .crumbs, .page-actions, .filterbar, .row-actions, .modal, .toolbar-card { display: none !important; }
    .page { padding: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #d4d4d8; }
    .table-scroll { max-height: none; overflow: visible; }
    .table th { position: static; background: #f4f4f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .pill, .badge, .cal-ev, .res-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-only { display: block; }
    .avz { break-inside: avoid; }
    .page-ico { display: none; }
}

/* Kalkulator — wynik zysku/straty (klasy ustawiane przez skrypt kalkulatora) */
#res_profit_container { margin-top: 10px; padding: 14px 16px; border-radius: 12px; justify-content: space-between; align-items: flex-start; gap: 12px; font-weight: 800; background: #f4f4f5; }
#res_profit_container.profit-row { background: var(--success-bg); color: var(--success) !important; }
#res_profit_container.loss-row { background: var(--danger-bg); color: var(--danger) !important; }
#toll_rows_container > div { gap: 10px !important; }
.hero-stat { max-width: 240px; }
@media (max-width: 640px) { .navmenu summary span { display: none; } .navmenu-panel { left: auto; right: -60px; } }

/* Logowanie — czerwony akcent zgodny z logo */
.login-body { --brand: #e30613; --brand-600: #bf0510; --ring: 0 0 0 4px rgba(227, 6, 19, .14); }
.login-body .btn-primary { box-shadow: 0 1px 2px rgba(191, 5, 16, .35), 0 6px 16px -6px rgba(227, 6, 19, .45), inset 0 1px 0 rgba(255, 255, 255, .15); }
.login-body .btn-primary:hover { background: #bf0510; }

/* Gęstsze tabele danych — więcej wierszy na ekranie */
.table.data th { padding: 9px 14px; }
.table.data td { padding: 8px 14px; }
.table.data .cell-sub { line-height: 1.3; }
.table.data .pill { height: 24px; }
.table.data .row-actions .btn-icon { width: 30px; height: 30px; }

/* ============================================================
   Tabele danych — ujednolicenie we wszystkich modułach
   ============================================================ */
.page-wide { max-width: none; }
.table.data tbody tr td { background: var(--surface); transition: background .12s; }
.table.data tbody tr:nth-child(even) td { background: #fbfbfc; }
.table.data tbody tr:hover td { background: #f4f4f5; }
.table.data tbody tr.row-decision td { background: #fffbeb; }
.table.data tbody tr.row-decision:hover td { background: #fef3c7; }
.table.data tbody tr.row-ended td { color: var(--muted); }
.table.data th { background: #f7f7f8; }

/* Przyklejona pierwsza kolumna (identyfikator wiersza) */
.table.sticky-first th:first-child,
.table.sticky-first td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--border); }
.table.sticky-first th:first-child { z-index: 3; }

/* Przyklejona kolumna akcji po prawej */
.table.sticky-actions th:last-child,
.table.sticky-actions td:last-child { position: sticky; right: 0; z-index: 1; box-shadow: inset 1px 0 0 var(--border); }
.table.sticky-actions th:last-child { z-index: 3; }
.table.sticky-actions td:last-child .row-actions,
.table.sticky-actions td:last-child .decision-actions { justify-content: flex-end; }

/* Nagłówki przyklejone u góry przewijanej tabeli */
.table-scroll .table th { position: sticky; top: 0; z-index: 2; }
.table-scroll .table.sticky-first th:first-child,
.table-scroll .table.sticky-actions th:last-child { z-index: 4; }

/* Puste stany pod tabelą bez dużych pustych pól */
.table-scroll:has(.empty-state:not(.is-hidden)) { min-height: 0; }

.table.data td .chips { white-space: normal; }

/* Historia zmian */
.hist-table td { vertical-align: top; }
.hist-changes { min-width: 340px; max-width: 640px !important; }
.hist-note { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.hist-change { font-size: 13px; line-height: 1.5; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.hist-field { color: var(--muted); }
.hist-old { color: var(--muted); text-decoration: line-through; text-decoration-color: #d4d4d8; }
.hist-new { color: var(--text); font-weight: 600; }
.hist-arrow { color: var(--faint); }
.hist-more { margin-top: 4px; height: 26px; padding: 0 8px; font-size: 12px; }
a.cell-user:hover strong { text-decoration: underline; }

/* Ikona folderu z dokumentami (dodatek Logiqa-foldery) */
.folder-link { display: none; }
.has-folders .folder-link {
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
    width: 24px; height: 24px; margin-left: 6px; border-radius: 6px; color: var(--faint);
    transition: background .15s, color .15s;
}
.has-folders .folder-link:hover { background: #fef3c7; color: #b45309; }
.has-folders .folder-link .icon { width: 15px; height: 15px; }
@media (hover: none) and (pointer: coarse) { .has-folders .folder-link { display: none; } }
@media print { .folder-link { display: none !important; } }

/* Wiersz sum w tabeli (przyklejony na dole przewijanej tabeli) */
.table tfoot td { background: #f4f4f5; font-weight: 700; color: var(--text); border-top: 2px solid var(--border-strong); white-space: nowrap; padding-top: 10px; padding-bottom: 10px; font-variant-numeric: tabular-nums; }
.table-scroll .table tfoot td { position: sticky; bottom: 0; z-index: 2; }
.table-scroll .table.sticky-first tfoot td:first-child,
.table-scroll .table.sticky-actions tfoot td:last-child { z-index: 4; }
.month-bar { padding-top: 10px; padding-bottom: 10px; }
.month-bar .date-nav input { min-width: 150px; }

/* Kontrakt serwisowy: data ważności */
.pill-sm { height: 20px; padding: 0 7px; font-size: 11.5px; margin-top: 3px; }
.kontrakt-wygasl { color: var(--faint); text-decoration: line-through; text-decoration-color: #d4d4d8; }
