* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f6f9;
    color: #1a2330;
}

/* ---------- Topbar (AS-Soft style) ---------- */
.topbar-as-wrap { background: #f4f6f9; padding: 16px 20px 0; }
.topbar-as {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.08);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar-as-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar-as-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.topbar-as-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding-right: 14px;
    border-right: 1px solid #e2e7ed;
    margin-right: 2px;
}
.topbar-as-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.topbar-as-brand { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-as-brand-name { font-weight: 800; font-size: 15px; color: #16212f; }
.topbar-as-brand-sub { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: #2563eb; }

.ctx-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e7ed;
    border-bottom: 3px solid #2563eb;
    border-radius: 12px;
    padding: 7px 14px 6px;
    text-decoration: none;
    color: inherit;
    min-width: 140px;
    transition: background 0.12s ease;
}
a.ctx-pill:hover { background: #eff4ff; }
.ctx-pill-kasa, .ctx-pill-gotowka { border-bottom-color: #16a34a; }

.ctx-pill-select {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #16212f;
    cursor: pointer;
    max-width: 160px;
}
.ctx-pill-select:focus { outline: none; }

.ctx-pill-gotowka {
    background: #f0fdf4;
    padding: 10px 20px 9px;
    min-width: 220px;
}
.ctx-pill-gotowka .ctx-pill-icon { width: 40px; height: 40px; font-size: 19px; }
.ctx-pill-gotowka .ctx-pill-label { font-size: 11px; }
.ctx-pill-gotowka .ctx-pill-value-green { font-size: 24px; }
.ctx-pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 15px;
    flex-shrink: 0;
    background: #dbeafe;
}
.ctx-pill-kasa .ctx-pill-icon, .ctx-pill-gotowka .ctx-pill-icon { background: #dcfce7; }
.ctx-pill-body { display: flex; flex-direction: column; gap: 1px; }
.ctx-pill-label { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: #94a3b8; }
.ctx-pill-value { font-size: 14px; font-weight: 700; color: #16212f; }
.ctx-pill-value-green { color: #16a34a; font-size: 16px; }
.ctx-pill-sub { font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 4px; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot-online { background: #16a34a; }
.status-dot-offline { background: #dc2626; }

.topbar-clock-light { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; }

.topbar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #475569;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.12s ease;
}
.topbar-icon-btn:hover { background: #e2e8f0; }

.topbar-as-user { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid #e2e7ed; }
.topbar-as-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.topbar-as-user-body { display: flex; flex-direction: column; gap: 2px; }
.topbar-login { font-size: 12px; color: #475569; }
.topbar-badge {
    background: #2563eb;
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 1px 7px;
    border-radius: 999px;
    width: fit-content;
}

.topbar-recalc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #334155;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.05s ease;
}
.topbar-recalc-btn:hover { background: #e2e8f0; }
.topbar-recalc-btn:active { transform: translateY(1px); }

.content { padding: 20px 20px 60px; }

.kantor-page { max-width: 1100px; margin: 0 auto; }
.kantor-page h2 { color: #16212f; font-size: 22px; margin: 0 0 4px; }
.kantor-page h3 { color: #16212f; font-size: 15px; margin: 0 0 12px; }

/* ---------- Centrala pill ---------- */
.pill-badge-wrap { display: flex; justify-content: center; margin: 8px 0 28px; }
.pill-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 220px;
    height: 130px;
    border: 2px solid #2563eb;
    border-radius: 50%;
    background: white;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease, transform 0.08s ease;
}
.pill-badge:hover { background: #eff4ff; transform: translateY(-1px); }
.pill-badge-icon { width: 26px; height: 26px; color: #2563eb; }
.pill-badge-title { font-size: 14px; font-weight: 700; color: #16212f; letter-spacing: 0.02em; }
.pill-badge-sub { font-size: 12px; color: #64748b; }

/* ---------- Punkt (oddział) cards ---------- */
.punkt-grid { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 28px; }
.punkt-card {
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    padding: 20px;
    flex: 1 1 260px;
    min-width: 240px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
}
.punkt-card.card-blocked { opacity: 0.6; }
.punkt-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.punkt-card-title { font-size: 15px; font-weight: 700; color: #16212f; text-transform: uppercase; letter-spacing: 0.03em; text-decoration: none; }
.punkt-card-title:hover { color: #2563eb; }
.punkt-card-meta { font-size: 12px; color: #64748b; }
.punkt-card-kasa {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #eef2ff;
    color: #1e293b;
    border-radius: 8px;
    padding: 8px 10px 8px 14px;
    margin-bottom: 8px;
    font-size: 14px;
}
.punkt-card-kasa:last-child { margin-bottom: 0; }
.punkt-card-kasa.kasa-blocked { background: #fee2e2; color: #7f1d1d; }
.punkt-card-kasa-actions { display: flex; gap: 6px; flex-shrink: 0; }
.punkt-card-kasa-name { font-size: 18px; font-weight: 700; }
.punkt-card-empty { font-size: 13px; color: #94a3b8; }
.punkt-card-footer { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- Selectors ---------- */
.selector-bar {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.selector label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; font-weight: 600; }
.selector select {
    padding: 8px 12px;
    font-size: 14px;
    min-width: 200px;
    border: 1px solid #d3dae2;
    border-radius: 6px;
    background: white;
}
.selector select:focus { border-color: #2563eb; outline: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.12s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e7ecf2; color: #1f2d3d; margin-left: auto; }
.btn-secondary:hover { background: #d9e0e9; }

.pracownik-akcje { display: flex; gap: 8px; flex-wrap: wrap; }
.pracownik-akcje .btn { min-width: 140px; margin-left: 0; }
.btn-green { background: #16a34a; color: white; }
.btn-green:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-wroc { background: #dc2626; color: white; font-size: 15px; padding: 10px 22px; }
.btn-wroc:hover { background: #b91c1c; }
.btn-lg { font-size: 15px; padding: 10px 22px; }
.btn-xs { font-size: 12px; padding: 6px 10px; }

/* ---------- Section header ---------- */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.section-header h3 { margin: 0; }
.btn-add {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s ease, transform 0.05s ease;
}
.btn-add:hover { background: #1d4ed8; }
.btn-add:active { transform: translateY(1px); }

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #e7ecf2;
    color: #1f2d3d;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0;
    transition: background 0.12s ease, transform 0.05s ease;
}
.btn-icon:hover { background: #d9e0e9; }
.btn-icon:active { transform: translateY(1px); }

/* ---------- Panels ---------- */
.advanced-panel {
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
}
.advanced-panel h3 { font-size: 14px; margin: 0 0 12px; color: #1f2d3d; }
.advanced-subheading { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: #64748b; margin: 18px 0 10px; }
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: end;
}
.advanced-grid label { font-size: 12px; color: #64748b; font-weight: 600; }
.advanced-grid input {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid #d3dae2;
    border-radius: 6px;
}
.advanced-grid input:focus { border-color: #2563eb; outline: none; }
.advanced-grid select {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid #d3dae2;
    border-radius: 6px;
    background: white;
}
.advanced-grid select:focus { border-color: #2563eb; outline: none; }
.advanced-grid input[readonly] { background: #f4f6f9; color: #475569; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; font-weight: 600; }
.field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d3dae2;
    border-radius: 6px;
    font-size: 14px;
}
.field input:focus { border-color: #2563eb; outline: none; }

.info-zbiorowka {
    color: #475569;
    font-size: 13px;
    margin-bottom: 12px;
    background: #eef2f7;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
}

.kasy-config { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }

.kursy-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    padding: 10px;
    margin-top: 14px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
    width: fit-content;
}
.kursy-toolbar .btn-icon { width: 40px; height: 40px; border-radius: 10px; background: #f1f5f9; }
.kursy-toolbar .btn-icon:hover { background: #e2e8f0; }

.handel-layout { display: flex; gap: 20px; align-items: flex-start; }
.handel-layout .kursy-table { flex: 1 1 44%; min-width: 0; }
.handel-layout .kursy-table th { background: #f8fafc; color: #64748b; border-bottom: 1px solid #e2e7ed; }
.handel-layout .kursy-table td.symbol { color: #16212f; }
.handel-panel { flex: 1 1 56%; margin-bottom: 0; min-width: 0; }
.handel-panel h3 {
    text-transform: uppercase;
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.handel-panel .advanced-grid { grid-template-columns: 1fr; gap: 10px; }
.handel-panel .btn { margin-right: 8px; }

.handel-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.handel-header-row h3 { margin: 0; }
.voice-control-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #eef2f7;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}
.voice-control-mic { display: flex; color: #2563eb; flex-shrink: 0; }
.voice-control-info { display: flex; color: #94a3b8; margin-left: 2px; flex-shrink: 0; cursor: default; }

.typ-transakcji-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.typ-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.typ-btn:hover { transform: translateY(-1px); }
.typ-btn:active { transform: translateY(0); }
.typ-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.22);
}
.typ-btn-icon svg { width: 17px; height: 17px; }
.typ-btn-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.typ-btn-title { font-size: 14px; font-weight: 800; letter-spacing: 0.02em; }
.typ-btn-sub { font-size: 11px; font-weight: 600; }

.typ-btn-kupno {
    background: linear-gradient(135deg, #22a35a, #157a3d);
    color: #fff;
    box-shadow: 0 3px 10px rgba(21, 122, 61, 0.28);
}
.typ-btn-kupno:hover { box-shadow: 0 6px 16px rgba(21, 122, 61, 0.38); }
.typ-btn-kupno .typ-btn-sub { color: #dcfce7; }

.typ-btn-sprzedaz {
    background: linear-gradient(135deg, #ef4444, #c92424);
    color: #fff;
    box-shadow: 0 3px 10px rgba(201, 36, 36, 0.28);
}
.typ-btn-sprzedaz:hover { box-shadow: 0 6px 16px rgba(201, 36, 36, 0.38); }
.typ-btn-sprzedaz .typ-btn-sub { color: #fee2e2; }

.typ-btn-zasilenie {
    background: #f0fdf4;
    border-color: #bbf0cd;
    color: #15803d;
}
.typ-btn-zasilenie:hover { background: #dcfce7; border-color: #86efac; }
.typ-btn-zasilenie .typ-btn-icon { background: rgba(21, 128, 61, 0.1); color: #15803d; }
.typ-btn-zasilenie .typ-btn-sub { color: #2f8a57; }

.typ-btn-odprowadzenie {
    background: #fef2f2;
    border-color: #fbd0d0;
    color: #b91c1c;
}
.typ-btn-odprowadzenie:hover { background: #fee2e2; border-color: #fca5a5; }
.typ-btn-odprowadzenie .typ-btn-icon { background: rgba(185, 28, 28, 0.1); color: #b91c1c; }
.typ-btn-odprowadzenie .typ-btn-sub { color: #c14545; }

.typ-btn.aktywny { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45), 0 6px 16px rgba(37, 99, 235, 0.18); }

.waluta-picker { position: relative; margin-top: 4px; }
.waluta-picker-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d3dae2;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.waluta-picker-toggle:hover { border-color: #94a3b8; }
.waluta-picker-toggle-text { flex: 1; min-width: 0; }
.waluta-picker-arrow { color: #94a3b8; font-size: 11px; flex-shrink: 0; }
.waluta-picker-backdrop { position: fixed; inset: 0; z-index: 40; background: transparent; border: none; padding: 0; }
.waluta-picker-lista {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d3dae2;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.15);
    padding: 4px;
}
.waluta-picker-opcja {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.waluta-picker-opcja:hover { background: #f1f5f9; }
.waluta-picker-opcja.aktywna { background: #dbeafe; }
.handel-panel .waluta-picker-toggle,
.handel-panel .waluta-picker-opcja { font-size: 18px; }
.waluta-picker-toggle .flaga-img,
.waluta-picker-opcja .flaga-img { border-radius: 3px; width: 28px !important; height: 21px !important; object-fit: cover; flex-shrink: 0; }

.propozycja-zasilenia {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fef3c7;
    border: 1px solid #fde68a;
}
.propozycja-zasilenia p { margin: 0 0 10px; color: #92400e; font-weight: 600; }
.propozycja-zasilenia-przyciski { display: flex; gap: 10px; }

@keyframes handel-ilosc-puls {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
    50% { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0); }
}
#handel-ilosc:focus {
    animation: handel-ilosc-puls 1.1s ease-in-out 2;
    border-color: #2563eb;
    outline: none;
}

.typ-transakcji-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}
.typ-transakcji-badge .typ-btn-icon { flex-shrink: 0; }

.data-realizacji-field { font-size: 13px !important; font-weight: 700 !important; color: #0f172a !important; }
.data-realizacji-field input[type="date"] {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    padding: 12px 14px !important;
    border-radius: 10px !important;
}
.handel-row > .data-realizacji-narrow { flex: 0 0 170px; }
.handel-row > .handel-sposob-platnosci { flex: 1 1 auto; }
.kasa-toggle { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.kasa-toggle input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0 0; flex-shrink: 0; }
.kasa-toggle span { line-height: 1.3; }

.handel-panel .advanced-grid label,
.handel-panel .advanced-grid input,
.handel-panel .advanced-grid select { font-size: 18px; }

.handel-panel .handel-row { display: flex; gap: 14px; align-items: flex-end; }
.handel-panel .handel-row > label { flex: 1 1 0; min-width: 0; }
.handel-panel .input-sm input { max-width: 140px; }
.handel-panel .side-info {
    font-size: 18px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    padding-bottom: 8px;
}
.handel-panel .side-info strong { color: #1f2d3d; font-size: 18px; }
.handel-panel .lbl-bold { font-weight: 800; font-size: 18px; color: #0f172a; }

.handel-buttons-spacer { height: 4.5rem; }
.handel-buttons-row { display: flex; justify-content: center; gap: 10px; }
.handel-buttons-row .btn { margin-right: 0; }
.handel-buttons-footer { height: 3rem; }

.kasa-wskaznik { text-align: center; padding: 14px; border-radius: 12px; margin-top: 2px; margin-bottom: 16px; }
.kasa-wskaznik.wplata { background: #fdecec; }
.kasa-wskaznik.wyplata { background: #e7f8ec; }
.kasa-label { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.kasa-wskaznik.wplata .kasa-label { color: #b91c1c; }
.kasa-wskaznik.wyplata .kasa-label { color: #15803d; }
.kasa-kwota { font-size: 30px; font-weight: 800; color: #16212f; margin-top: 4px; }

.typ-transakcji-label { font-size: 13px; font-weight: 800; color: #0f172a; }
.typ-transakcji-select { width: 100%; font-size: 18px; font-weight: 700; padding: 10px 12px; }

.advanced-grid input[type="number"] { text-align: right; }
.cell-input { text-align: right; }

/* ---------- Tables ---------- */
.kursy-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16,24,40,0.06);
}
.kursy-table th {
    background: #16212f;
    color: white;
    text-align: left;
    padding: 11px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.kursy-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #eef1f4;
    font-size: 14px;
}
.kursy-table tbody tr:last-child td { border-bottom: none; }
.kursy-table tbody tr:hover { background: #f8fafc; }
.kursy-table td.symbol { font-weight: 700; color: #1e40af; white-space: nowrap; }
.kursy-table td.symbol .flaga-img { vertical-align: middle; margin-right: 6px; border-radius: 2px; width: 20px; height: 15px; object-fit: cover; }
.handel-layout .kursy-table td.symbol { font-size: 17px; }
.handel-layout .cell-input { width: 100%; max-width: 160px; border-radius: 8px; padding: 8px 10px; }
.handel-layout .kursy-table th:nth-child(2), .handel-layout .kursy-table td:nth-child(2),
.handel-layout .kursy-table th:nth-child(3), .handel-layout .kursy-table td:nth-child(3) {
    min-width: 148px;
}
.symbol-opis { line-height: 1.3; }
.symbol-linia { font-weight: 700; color: #1e40af; white-space: nowrap; }
.symbol-linia .flaga-img { vertical-align: middle; margin-right: 6px; border-radius: 2px; width: 20px; height: 15px; object-fit: cover; }
.handel-layout .symbol-linia { font-size: 17px; }
.handel-layout .symbol-linia .flaga-img { margin-right: 8px; border-radius: 3px; width: 28px !important; height: 21px !important; }
.opis-linia { font-size: 12px; color: #64748b; margin-top: 2px; }
.handel-layout .kursy-table td.symbol .flaga-img { margin-right: 8px; border-radius: 3px; width: 28px !important; height: 21px !important; }
.kursy-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.kursy-table td.kurs-sr { color: #b91c1c; font-weight: 600; }

.kursy-table tr.wiersz-wybieralny { cursor: pointer; }
.kursy-table tr.wiersz-przeciagany { opacity: 0.4; }
.kursy-table .uchwyt-przeciagania { cursor: grab; color: #94a3b8; margin-right: 4px; user-select: none; }
.kursy-table tr.wiersz-wybrany { background: #dbeafe; }
.kursy-table tr.wiersz-wybrany:hover { background: #bfdbfe; }
.kursy-table tr.wiersz-kupno { background: #dcfce7; cursor: pointer; }
.kursy-table tr.wiersz-kupno:hover { background: #bbf7d0; }
.kursy-table tr.wiersz-sprzedaz { background: #fee2e2; cursor: pointer; }
.kursy-table tr.wiersz-sprzedaz:hover { background: #fecaca; }
.kursy-table td.opis-klikalny { cursor: pointer; }
.kursy-table td.opis-klikalny:hover { text-decoration: underline; color: #2563eb; }

.cell-input {
    width: 130px;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
}
.cell-input:focus { border-color: #2563eb; outline: none; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.nazwa-kasy-input { width: 100%; min-width: 160px; text-align: left; }
.symbol-input { font-weight: 700; }
.naglowek-waluty { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.flaga-duza { width: 32px !important; height: 24px !important; object-fit: cover; }

.cell-select {
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: white;
    font-size: 14px;
}
.cell-select:focus { border-color: #2563eb; outline: none; }

.error { color: #b91c1c; font-weight: 600; font-size: 13px; }
.info { color: #15803d; font-weight: 600; font-size: 13px; }
.hint { color: #64748b; font-size: 13px; }

/* ---------- Tablica kursów (pełny ekran) ---------- */
/* Zmienne stylu tablicy - domyślne wartości odtwarzają dotychczasowy, jedyny wygląd 1:1.
   TablicaStrona.razor nadpisuje je inline (style="--tablica-bg:...") tylko gdy operator
   ustawił własne kolory w Ustawieniach kasy - w przeciwnym razie zostaje ta paleta. */
.tablica-viewport {
    --tablica-bg: #0b1220;
    --tablica-fg: #f8fafc;
    --tablica-accent: #94a3b8;
    --tablica-scale: 1;
    position: fixed;
    inset: 0;
    background: var(--tablica-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tablica-ekran {
    width: 1920px;
    background: var(--tablica-bg);
    color: var(--tablica-fg);
    padding: 24px 40px;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
    transform-origin: center center;
    font-size: calc(1em * var(--tablica-scale));
}
.tablica-brak { font-size: 28px; text-align: center; margin-top: 40px; }

/* Tablica systemowa - pasek akcentowy u góry + naprzemienne wiersze, żeby odróżniała się
   wizualnie od (bardziej neutralnej) Tablicy użytkownika. */
.tablica-akcent-pasek {
    height: 6px;
    margin: -24px -40px 22px -40px;
    background: linear-gradient(90deg, #2563eb 0%, #2563eb 33%, #dc2626 33%, #dc2626 66%, #f59e0b 66%, #f59e0b 100%);
}
.tablica-tabela-systemowa tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--tablica-fg) 4%, transparent);
}

.tablica-wlasny-naglowek, .tablica-wlasna-stopka {
    white-space: pre-line;
    text-align: center;
    color: var(--tablica-fg);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
}
.tablica-wlasny-naglowek { margin-bottom: 18px; }
.tablica-wlasna-stopka { margin-top: 22px; padding-top: 18px; border-top: 2px solid #1e293b; }

.tablica-naglowek {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #1e293b;
    flex-wrap: wrap;
}
.tablica-zegar { font-size: 24px; color: var(--tablica-accent); font-variant-numeric: tabular-nums; }
.tablica-strona { font-size: 18px; color: var(--tablica-accent); background: color-mix(in srgb, var(--tablica-fg) 10%, transparent); padding: 4px 12px; border-radius: 999px; }
.tablica-tabela { width: 100%; border-collapse: collapse; }
.tablica-tabela th {
    text-align: right;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--tablica-accent);
    padding: 10px 20px;
    border-bottom: 2px solid #1e293b;
}
.tablica-tabela th.tablica-kol-waluta { text-align: left; }
.tablica-tabela td {
    padding: 14px 20px;
    font-size: 40px;
    font-weight: 800;
    text-align: right;
    border-bottom: 1px solid #1e293b;
    font-variant-numeric: tabular-nums;
}
.tablica-tabela td.tablica-kol-waluta { text-align: left; color: var(--tablica-fg); }
.tablica-tabela td.tablica-kol-waluta .flaga-img { margin-right: 14px; vertical-align: middle; border-radius: 3px; width: 32px; height: 24px; object-fit: cover; }
.tablica-tabela td.tablica-kupno { color: #86efac; }
.tablica-tabela td.tablica-sprzedaz { color: #fca5a5; }
.tablica-tabela th.tablica-kol-opis, .tablica-tabela th.tablica-kol-jm { text-align: left; }
.tablica-tabela td.tablica-kol-opis { text-align: left; font-size: 20px; font-weight: 600; color: #cbd5e1; }
.tablica-tabela td.tablica-kol-jm { text-align: center; font-size: 20px; font-weight: 600; color: var(--tablica-accent); }

/* Szablon "Karty" - jedna waluta na kartę (kupno/sprzedaż dużą czcionką), wzorowany na starym
   xKantor/migracje/tablica/indexsmall.htm - do wąskich/pionowych ekranów. */
.tablica-karty {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}
.tablica-karta {
    background: color-mix(in srgb, var(--tablica-fg) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--tablica-fg) 15%, transparent);
    border-radius: 12px;
    padding: 18px 22px;
}
.tablica-karta-naglowek { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; color: var(--tablica-fg); }
.tablica-karta-naglowek .flaga-img { border-radius: 3px; width: 32px; height: 24px; object-fit: cover; }
.tablica-karta-jm { font-size: 16px; color: var(--tablica-accent); margin: 4px 0 10px; }
.tablica-karta-kursy { display: flex; justify-content: space-between; gap: 16px; }
.tablica-karta-kurs { flex: 1; text-align: center; }
.tablica-karta-kurs-etykieta { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--tablica-accent); }
.tablica-karta-kurs-wartosc { font-size: 38px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tablica-karta-kurs-wartosc.tablica-kupno { color: #86efac; }
.tablica-karta-kurs-wartosc.tablica-sprzedaz { color: #fca5a5; }

/* ---------- Modal transakcji ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-box {
    background: white;
    border-radius: 12px;
    padding: 26px 28px;
    width: 440px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal-box-szeroki { width: 780px; }
.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
}
.modal-close:hover { color: #1f2d3d; }
.modal-box h3 { margin: 0 0 16px; font-size: 18px; color: #16212f; }
.modal-info { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.modal-info > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid #eef1f4; padding-bottom: 6px; }
.modal-info > div span { color: #64748b; }
.modal-info > div strong { color: #1f2d3d; text-align: right; }
.modal-reszta { background: #f4f6f9; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.modal-reszta label { display: block; font-size: 12px; color: #64748b; font-weight: 600; margin-bottom: 4px; }
.modal-reszta input { width: 100%; padding: 8px 10px; border: 1px solid #d3dae2; border-radius: 6px; font-size: 16px; }
.reszta-wynik { margin-top: 10px; font-size: 18px; font-weight: 800; color: #16212f; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ---------- Hierarchia: Centrala -> Oddział -> Kasa (gradacja zieleni) ---------- */
.breadcrumb-hierarchy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.breadcrumb-sep { color: #94a3b8; font-size: 18px; font-weight: 700; }

.hierarchy-level {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.12s ease;
}
.hierarchy-label, .hierarchy-input {
    font-size: 20px;
    font-weight: 700;
    font-family: inherit;
    color: inherit;
}
.hierarchy-input {
    background: transparent;
    border: 1px solid transparent;
    padding: 2px 6px;
    border-radius: 6px;
    min-width: 160px;
}

.level-centrala { background: #15803d; color: #ffffff; }
a.level-centrala:hover { background: #166534; }
.level-centrala .hierarchy-input:hover { border-color: rgba(255,255,255,0.5); }
.level-centrala .hierarchy-input:focus { outline: none; border-color: #ffffff; background: rgba(255,255,255,0.15); }

.level-oddzial { background: #86efac; color: #052e16; }
.level-oddzial.row-blocked { background: #fecaca; color: #7f1d1d; }
.level-oddzial .hierarchy-input:hover { border-color: rgba(5,46,22,0.35); }
.level-oddzial .hierarchy-input:focus { outline: none; border-color: #052e16; background: rgba(255,255,255,0.4); }

.level-kasa { background: #dcfce7; color: #052e16; }

.hierarchy-select {
    font-size: 20px;
    font-weight: 700;
    font-family: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
}
.hierarchy-select:hover { border-color: rgba(5,46,22,0.35); }
.hierarchy-select:focus { outline: none; border-color: #052e16; background: rgba(255,255,255,0.4); }


.side-info-right { text-align: right; }

.hierarchy-list { margin-left: 28px; display: flex; flex-direction: column; gap: 10px; }
.hierarchy-row { gap: 16px; flex-wrap: wrap; }
.hierarchy-meta { font-size: 13px; font-weight: 600; opacity: 0.85; }

.kursy-table tbody tr.level-kasa { background: #dcfce7; }
.kursy-table tbody tr.level-kasa:hover { background: #bbf7d0; }

.row-blocked { background: #fdf2f2; color: #8a8a8a; }
.row-blocked td.symbol { color: #b45309; }
.kursy-table tbody tr.level-kasa.row-blocked { background: #fdf2f2; color: #8a8a8a; }

.status-aktywna { color: #15803d; font-weight: 800; }
.status-zablokowana { color: #b91c1c; font-weight: 700; }
.status-aktywna .status-dot { margin-right: 4px; }

/* ---------- Oddział - tabs, raporty, statystyki ---------- */
.oddzial-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.oddzial-tab {
    display: inline-flex;
    align-items: center;
    padding: 12px 22px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border-radius: 10px;
}
.tab-centrala { background: #15803d; color: white; }
a.tab-centrala:hover { background: #166534; }
.tab-oddzial { background: #86efac; color: #052e16; }
.tab-zbiorowka { background: transparent; color: #64748b; font-weight: 600; }
.tab-sep { margin: 0 6px; color: #94a3b8; }
.oddzial-tabs-actions { display: flex; gap: 10px; margin-left: auto; }
.btn-tab-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.05s ease;
}
.btn-tab-action:hover { background: #1d4ed8; }
.btn-tab-action:active { transform: translateY(1px); }
.btn-tab-action-outline { background: white; color: #2563eb; border: 1px solid #2563eb; }
.btn-tab-action-outline:hover { background: #eff4ff; }

.raporty-card {
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
}
.raporty-header { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: #64748b; margin-bottom: 12px; }
.raporty-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.raport-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 96px;
    background: #f8fafc;
    border: 1px solid #e2e7ed;
    border-radius: 10px;
    padding: 12px 6px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    text-align: center;
    cursor: pointer;
    transition: background 0.12s ease;
}
.raport-btn span { font-size: 20px; }
.raport-btn:hover { background: #eff4ff; border-color: #bfdbfe; }
.raporty-wiecej { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #eef1f4; }

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-tile {
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
}
.stat-tile-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 6px; }
.stat-tile-value { font-size: 22px; font-weight: 800; color: #16212f; font-variant-numeric: tabular-nums; }
.stat-tile-value-blue { color: #2563eb; }
.stat-tile-value-sm { font-size: 18px; }

/* ---------- Todo / Pomysły ---------- */
.todo-wiersz { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.todo-wiersz .kasa-toggle { flex: 1; }
.todo-wiersz.todo-wykonane .kasa-toggle span { text-decoration: line-through; color: #94a3b8; }
.todo-meta { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.btn-usun { background: none; border: none; color: #94a3b8; font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.btn-usun:hover { color: #dc2626; }

/* ---------- Historia operacji: filtr + paginacja ---------- */
.historia-pasek { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.historia-wynik { font-size: 13px; color: #64748b; font-weight: 600; }
.historia-filtr { margin-bottom: 12px; }
.historia-paginacja { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.historia-zakres { font-size: 13px; color: #64748b; }
.historia-strony { display: flex; align-items: center; gap: 4px; }
.historia-strony .btn { padding: 6px 12px; min-width: 36px; }
.historia-strony-kropki { padding: 0 4px; color: #94a3b8; }

/* ---------- Czas pracy ---------- */
.czas-taby { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.czas-tab { padding: 10px 18px; border-radius: 10px; border: 1px solid #e2e7ed; background: white; font-weight: 700; font-size: 14px; color: #64748b; cursor: pointer; }
.czas-tab:hover { background: #f8fafc; }
.czas-tab-aktywna { background: #15803d; border-color: #15803d; color: white; }
.tydzien-pasek { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.tydzien-nawigacja { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tydzien-etykieta { font-weight: 700; color: #16212f; margin-left: 4px; text-transform: capitalize; }
.grafik-scroll { overflow-x: auto; margin-top: 10px; }
.grafik-tabela { min-width: 720px; }
.grafik-tabela th.grafik-dzis { color: #2563eb; }
.grafik-data-mala { font-size: 11px; font-weight: 400; color: #94a3b8; }
.grafik-brak-obsady { font-size: 12px; }
.grafik-komorka { cursor: pointer; text-align: center; font-weight: 600; white-space: nowrap; }
.grafik-komorka:hover { background: #f1f5f9; }
.grafik-przeciagana { opacity: 0.4; }
.grafik-praca { background: #eff6ff; color: #1e40af; }
.grafik-urlop { background: #fef3c7; color: #92400e; }
.grafik-l4 { background: #fee2e2; color: #b91c1c; }
.grafik-wolne { background: #f1f5f9; color: #64748b; }
.grafik-inna { background: #f3e8ff; color: #6b21a8; }
.grafik-niezgodnosc { margin-left: 4px; }

.oddzial-kasy-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rola-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 9px;
    border-radius: 999px;
}

/* ---------- Ekran logowania (AS-Soft) ---------- */
.as-login-page {
    --as-bg: #f4f6f9;
    --as-card-bg: #ffffff;
    --as-header-bg: #ffffff;
    --as-text: #16212f;
    --as-text-muted: #64748b;
    --as-text-faint: #94a3b8;
    --as-border: #e2e7ed;
    --as-blue: #2563eb;
    --as-blue-dark: #1d4ed8;
    --as-blue-soft: #eff4ff;
    --as-red: #dc2626;
    --as-yellow: #f59e0b;
    --as-input-bg: #ffffff;
    --as-shadow-card: 0 12px 40px rgba(16,24,40,0.12);
    min-height: 100vh;
    background: var(--as-bg);
    color: var(--as-text);
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}
html[data-motyw="dark"] .as-login-page {
    --as-bg: #0a0e1a;
    --as-card-bg: #111827;
    --as-header-bg: #111827;
    --as-text: #f1f5f9;
    --as-text-muted: #94a3b8;
    --as-text-faint: #64748b;
    --as-border: #232c3d;
    --as-blue: #3b82f6;
    --as-blue-dark: #60a5fa;
    --as-blue-soft: rgba(59, 130, 246, 0.14);
    --as-red: #f87171;
    --as-yellow: #fbbf24;
    --as-input-bg: #0b1220;
    --as-shadow-card: 0 20px 60px rgba(0,0,0,0.55);
}

.as-login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 32px;
    background: var(--as-header-bg);
    border-bottom: 1px solid var(--as-border);
}
.as-login-header-left { display: flex; align-items: center; gap: 10px; }
.as-login-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--as-blue), var(--as-blue-dark));
    color: white;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.as-login-brand { font-weight: 800; font-size: 15px; color: var(--as-text); }
.as-login-product {
    font-size: 12px;
    font-weight: 600;
    color: var(--as-text-muted);
    padding-left: 10px;
    margin-left: 2px;
    border-left: 1px solid var(--as-border);
}
.as-login-header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.as-header-sep { width: 1px; height: 20px; background: var(--as-border); }
.as-header-clock, .as-header-date { font-size: 13px; color: var(--as-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.as-theme-toggle { display: flex; align-items: center; gap: 8px; }
.as-theme-label { font-size: 12px; font-weight: 600; color: var(--as-text-faint); transition: color 0.15s ease; }
.as-theme-label.is-active { color: var(--as-text); }
.as-theme-switch {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    border: none;
    background: var(--as-border);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.as-theme-switch.is-dark { background: var(--as-blue); }
.as-theme-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.15s ease;
}
.as-theme-switch.is-dark .as-theme-switch-knob { transform: translateX(18px); }

.as-login-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 48px;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 32px;
}
.as-login-left { flex: 0 0 55%; max-width: 55%; }
.as-login-right { flex: 1; display: flex; justify-content: center; }

.as-login-title { font-size: 30px; font-weight: 800; line-height: 1.28; margin: 0 0 12px; color: var(--as-text); }
.as-login-title-accent { color: var(--as-blue); }
.as-login-subtitle { font-size: 14px; color: var(--as-text-muted); margin: 0 0 28px; }

.as-login-features { list-style: none; margin: 0 0 36px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.as-login-feature { display: flex; align-items: flex-start; gap: 12px; }
.as-login-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--as-blue-soft);
    color: var(--as-blue);
    flex-shrink: 0;
}
.as-login-feature-icon svg { width: 20px; height: 20px; }
.as-login-feature-body { display: flex; flex-direction: column; }
.as-login-feature-title { font-size: 13.5px; font-weight: 700; color: var(--as-text); }
.as-login-feature-desc { font-size: 12.5px; color: var(--as-text-muted); }

.as-diagram { display: flex; flex-direction: column; align-items: center; color: var(--as-blue); }
.as-diagram-cloud { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 2px; }
.as-diagram-icon-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.6px solid var(--as-blue);
    color: var(--as-blue);
    flex-shrink: 0;
}
.as-diagram-icon-ring svg { width: 24px; height: 24px; }
.as-diagram-icon-ring-sm { width: 38px; height: 38px; }
.as-diagram-icon-ring-sm svg { width: 20px; height: 20px; }
.as-diagram-label { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: var(--as-blue); white-space: nowrap; }
.as-diagram-stem { width: 0; height: 22px; border-left: 2px dashed var(--as-blue); }
.as-diagram-fork { position: relative; display: flex; justify-content: center; gap: 56px; }
.as-diagram-fork::before {
    content: "";
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    border-top: 2px dashed var(--as-blue);
}
.as-diagram-branch { display: flex; flex-direction: column; align-items: center; }
.as-diagram-branch-stem { width: 0; height: 18px; border-left: 2px dashed var(--as-blue); }
.as-diagram-node { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.as-diagram-node-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.03em; color: var(--as-text); white-space: nowrap; }

.as-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--as-card-bg);
    border-radius: 16px;
    box-shadow: var(--as-shadow-card);
    overflow: hidden;
}
.as-login-card-bar { height: 6px; background: linear-gradient(90deg, var(--as-blue) 0 34%, var(--as-red) 34% 67%, var(--as-yellow) 67% 100%); }
.as-login-card-body { padding: 32px 32px 28px; }
.as-login-greeting { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--as-text); }
.as-login-greeting-sub { margin: 0 0 24px; font-size: 13.5px; color: var(--as-text-muted); }
.as-login-greeting-sub strong { color: var(--as-blue); }

.as-field { margin-bottom: 16px; }
.as-field label { display: block; font-size: 12px; font-weight: 700; color: var(--as-text-muted); margin-bottom: 6px; }
.as-field-input {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--as-border);
    background: var(--as-input-bg);
    border-radius: 8px;
    padding: 0 12px;
    transition: border-color 0.12s ease;
}
.as-field-input:focus-within { border-color: var(--as-blue); }
.as-field-input svg { width: 17px; height: 17px; color: var(--as-text-faint); flex-shrink: 0; }
.as-field-input input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--as-text);
    padding: 10px 0;
    font-size: 14px;
    outline: none;
}
.as-field-eye { border: none; background: transparent; padding: 2px; cursor: pointer; color: var(--as-text-faint); display: flex; }
.as-field-eye:hover { color: var(--as-text-muted); }
.as-field-eye svg { width: 17px; height: 17px; }

.as-login-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: 12.5px; gap: 12px; }
.as-login-remember { display: flex; align-items: center; gap: 6px; color: var(--as-text-muted); cursor: pointer; white-space: nowrap; }
.as-login-remember input { accent-color: var(--as-blue); }
.as-login-forgot { color: var(--as-blue); text-decoration: none; font-weight: 600; background: none; border: none; cursor: pointer; padding: 0; font-size: 12.5px; }
.as-login-forgot:hover { text-decoration: underline; }
.as-login-forgot-hint { font-size: 12px; color: var(--as-text-muted); margin: -10px 0 16px; }

.as-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 9px;
    background: var(--as-blue);
    color: white;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.05s ease;
}
.as-btn-primary:hover { background: var(--as-blue-dark); }
.as-btn-primary:active { transform: translateY(1px); }
.as-btn-primary:disabled { opacity: 0.65; cursor: default; }
.as-btn-primary svg { width: 16px; height: 16px; }

.as-login-sep { display: flex; align-items: center; gap: 10px; margin: 18px 0; font-size: 11.5px; color: var(--as-text-faint); }
.as-login-sep::before, .as-login-sep::after { content: ""; flex: 1; height: 1px; background: var(--as-border); }

.as-btn-outline {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border: 1.5px solid var(--as-border);
    border-radius: 9px;
    background: transparent;
    color: var(--as-text);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.as-btn-outline:hover { border-color: var(--as-blue); background: var(--as-blue-soft); }
.as-btn-outline svg { width: 16px; height: 16px; }

.as-login-footer { text-align: center; font-size: 12px; color: var(--as-text-faint); padding: 18px 20px; }

@media (max-width: 980px) {
    .as-login-body { flex-direction: column; padding: 32px 20px; gap: 32px; }
    .as-login-left { max-width: 100%; flex-basis: auto; order: 2; }
    .as-login-right { order: 1; width: 100%; }
    .as-login-title { font-size: 24px; }
    .as-diagram { display: none; }
}
@media (max-width: 560px) {
    .as-login-header { padding: 14px 16px; }
    .as-login-header-right { gap: 10px; }
    .as-login-product { display: none; }
    .as-login-card-body { padding: 26px 22px 22px; }
}

/* ---------- Dashboard (strona /centrale po zalogowaniu) ---------- */
.dash-shell { display: flex; align-items: flex-start; gap: 22px; max-width: 1320px; margin: 0 auto; padding: 4px 20px 40px; }
.dash-sidebar {
    flex: 0 0 208px;
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
    padding: 10px;
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.dash-nav-item:hover { background: #f1f5f9; }
.dash-nav-item.is-active { background: #2563eb; color: white; }
.dash-nav-item.is-active svg { color: white; }
.dash-nav-item.is-soon { color: #94a3b8; cursor: default; }
.dash-nav-item.is-soon:hover { background: transparent; }
.dash-nav-item svg { width: 17px; height: 17px; color: #64748b; flex-shrink: 0; }
.dash-nav-item.is-active svg { color: white; }
.dash-nav-soon {
    margin-left: auto;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 6px;
    flex-shrink: 0;
}

.dash-main { flex: 1; min-width: 0; }

.dash-greeting-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dash-greeting { margin: 0; font-size: 22px; font-weight: 800; color: #16212f; }
.dash-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.dash-status-pill.is-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.dash-status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.stat-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    margin-bottom: 10px;
}
.stat-tile-icon svg { width: 18px; height: 18px; }
.stat-tile-icon-blue { background: #eff4ff; color: #2563eb; }
.stat-tile-icon-purple { background: #f3e8ff; color: #7c3aed; }
.stat-tile-icon-green { background: #f0fdf4; color: #16a34a; }
.stat-tile-icon-amber { background: #fffbeb; color: #b45309; }
.stat-tile-delta { font-size: 11.5px; font-weight: 700; margin-top: 4px; }
.stat-tile-delta-up { color: #16a34a; }
.stat-tile-delta-down { color: #dc2626; }

.dash-body-grid { display: flex; align-items: flex-start; gap: 18px; margin-top: 4px; }
.dash-col-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.dash-col-right { flex: 0 0 300px; display: flex; flex-direction: column; gap: 18px; }

.dash-charts-grid { display: flex; gap: 18px; flex-wrap: wrap; }
.dash-chart-card {
    flex: 1;
    min-width: 260px;
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
}
.dash-chart-title { font-size: 12.5px; font-weight: 800; color: #334155; margin-bottom: 12px; }
.dash-linechart { width: 100%; height: 120px; overflow: visible; }
.dash-linechart-area { fill: rgba(37,99,235,0.10); stroke: none; }
.dash-linechart-line { fill: none; stroke: #2563eb; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dash-linechart-dot { fill: #2563eb; }
.dash-linechart-labels { display: flex; justify-content: space-between; font-size: 10px; color: #94a3b8; margin-top: 6px; }

.dash-donut-row { display: flex; align-items: center; gap: 18px; }
.dash-donut-svg { width: 108px; height: 108px; flex-shrink: 0; }
.dash-donut-total { font-size: 13px; font-weight: 800; fill: #16212f; }
.dash-donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.dash-donut-legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #334155; }
.dash-donut-swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.dash-donut-legend .val { margin-left: auto; font-weight: 700; color: #64748b; white-space: nowrap; }
.dash-chart-empty { font-size: 12.5px; color: #94a3b8; padding: 20px 0; text-align: center; }

.dash-table-card {
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
}

.dash-panel {
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
}
.dash-panel-title { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 800; color: #334155; margin-bottom: 12px; }
.dash-alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dash-alert-item { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; }
.dash-alert-icon { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fffbeb; color: #b45309; }
.dash-alert-icon.is-blocked { background: #fee2e2; color: #b91c1c; }
.dash-alert-icon svg { width: 14px; height: 14px; }
.dash-alert-text-title { display: block; font-weight: 700; color: #16212f; }
.dash-alert-text-sub { display: block; color: #94a3b8; font-size: 11px; }

.dash-quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #e2e7ed;
    background: #f8fafc;
    text-decoration: none;
    color: #16212f;
    margin-bottom: 8px;
}
.dash-quick-action:last-child { margin-bottom: 0; }
.dash-quick-action:hover { background: #eff4ff; border-color: #bfdbfe; }
.dash-quick-action-icon { width: 30px; height: 30px; border-radius: 8px; background: #eff4ff; color: #2563eb; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-quick-action-icon svg { width: 15px; height: 15px; }
.dash-quick-action-title { display: block; font-size: 12.5px; font-weight: 700; }
.dash-quick-action-sub { display: block; font-size: 11px; color: #94a3b8; }

.dash-centrale-section { margin-top: 22px; }

/* ---------- Centrale: karty (widok SuperAdmina) ---------- */
.centrale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}
.centrala-card {
    background: white;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(16,24,40,0.05);
    transition: box-shadow 0.15s ease;
}
.centrala-card:hover { box-shadow: 0 6px 20px rgba(16,24,40,0.08); }
.centrala-card.is-blocked { background: #fafafa; }
.centrala-card.is-expanded { grid-column: 1 / -1; }
.centrala-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.centrala-card-name { font-size: 17px; font-weight: 800; color: #16212f; }
.centrala-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.centrala-card-badge.is-active { background: #dcfce7; color: #15803d; }
.centrala-card-badge.is-blocked { background: #fee2e2; color: #b91c1c; }
.centrala-card-meta { font-size: 13px; color: #64748b; margin-bottom: 16px; }
.centrala-card-actions { display: flex; gap: 10px; }
.centrala-card-actions .btn { flex: 1; margin-left: 0; }

.centrala-konfiguracja {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef1f4;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.centrala-konfiguracja h4 {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}
.centrala-danger-zone { padding-top: 16px; border-top: 1px dashed #fca5a5; }
.centrala-danger-zone h4 { color: #b91c1c; }

@media (max-width: 1080px) {
    .dash-body-grid { flex-direction: column; }
    .dash-col-right { flex-basis: auto; width: 100%; }
}
@media (max-width: 860px) {
    .dash-shell { flex-direction: column; }
    .dash-sidebar { flex-direction: row; flex-wrap: wrap; width: 100%; position: static; }
    .dash-nav-item { width: auto; }
}

/* Zakładki - Pages/UstawieniaStrona.razor */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-top: 14px;
}
.settings-tab-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.settings-tab-btn:hover { background: #f1f5f9; }
.settings-tab-btn.is-active { background: #2563eb; border-color: #2563eb; color: white; }

/* Agent xKantor - patrz Shared/AgentPanel.razor */
.agent-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
    z-index: 950;
}
.agent-fab:hover { background: #1d4ed8; }
.agent-panel {
    position: fixed;
    right: 24px;
    bottom: 90px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16,24,40,0.22);
    display: flex;
    flex-direction: column;
    z-index: 951;
    overflow: hidden;
}
.agent-panel-header {
    background: #2563eb;
    color: white;
    padding: 12px 14px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.agent-panel-close { background: none; border: none; color: white; font-size: 18px; cursor: pointer; }
.agent-panel-body { flex: 1; overflow-y: auto; padding: 12px 14px; }
.agent-podpowiedzi { display: flex; flex-direction: column; gap: 6px; }
.agent-podpowiedzi button {
    text-align: left;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}
.agent-podpowiedzi button:hover { background: #e2e8f0; }
.agent-msg { margin-bottom: 10px; font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; max-width: 90%; }
.agent-msg-user { background: #2563eb; color: white; margin-left: auto; }
.agent-msg-bot { background: #f1f5f9; color: #1f2d3d; }
.agent-propozycja { margin-top: 8px; display: flex; gap: 8px; }
.agent-panel-input { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #e2e8f0; }
.agent-panel-input input { flex: 1; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; }
.agent-panel-input button { padding: 8px 14px; border-radius: 6px; border: none; background: #2563eb; color: white; font-weight: 600; cursor: pointer; }
.agent-panel-input button:disabled { opacity: 0.5; cursor: default; }
