/* ============================================
   WARSZTAT AUTOMOTO - System Zarządzania
   Motorcycle Workshop Dark Theme
   ============================================ */

:root {
    --sidebar-width: 240px;
    --primary: #111111;
    --primary-accent: #e67e22;
    --sidebar-bg: #0a0a0a;
    --sidebar-hover: #1a1a1a;
    --sidebar-text: #8a8a8a;
    --sidebar-active-text: #f0f0f0;
    --surface: #1e1e1e;
    --surface-secondary: #252525;
    --border: #333333;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --topbar-height: 52px;
    --radius: 8px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow: 0 2px 6px rgba(0,0,0,.4);
    --accent-orange: #e67e22;
    --accent-red: #8a5050;
    --accent-green: #5a7a5a;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #141414;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-size: .875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    transition: transform .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 0; }

.sidebar-brand {
    padding: 1.1rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #f0f0f0;
    letter-spacing: -.01em;
    border-bottom: 1px solid rgba(230,126,34,.2);
    display: flex;
    align-items: center;
    gap: .65rem;
    white-space: nowrap;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1008 100%);
}
.sidebar-brand i { font-size: 1.2rem; color: var(--accent-orange); }

.sidebar-nav { padding: .35rem 0; }

.sidebar-nav .nav-section {
    padding: .85rem 1.25rem .3rem;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #555;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    border-left: 2px solid transparent;
}
.sidebar-nav .nav-link:hover {
    color: #e2e8f0;
    background: var(--sidebar-hover);
}
.sidebar-nav .nav-link.active {
    color: var(--sidebar-active-text);
    background: rgba(230,126,34,.15);
    border-left-color: var(--accent-orange);
}
.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-nav .nav-divider {
    border-top: 1px solid rgba(255,255,255,.08);
    margin: .4rem 1rem;
}

/* ---- Layout ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .25s ease;
}
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main-content { margin-left: 0; }

/* ---- Topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar .sidebar-toggle { color: var(--text-secondary); flex-shrink: 0; }
.topbar .sidebar-toggle:hover { color: var(--accent-orange); }
.topbar-right { margin-left: auto; flex-shrink: 0; }

.topbar-search {
    flex: 1;
    max-width: 520px;
    position: relative;
    display: flex;
    align-items: center;
}
.topbar-search i {
    position: absolute;
    left: .75rem;
    color: var(--text-muted);
    font-size: .9rem;
    pointer-events: none;
}
.topbar-search input {
    width: 100%;
    background: #141414;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: .4rem .75rem .4rem 2.1rem;
    font-size: .825rem;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.topbar-search input:focus {
    outline: none;
    border-color: var(--accent-orange);
    background: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(230,126,34,.15);
}
.topbar-search input::placeholder { color: var(--text-muted); }

/* Live search dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    max-height: 480px;
    overflow-y: auto;
    z-index: 2000;
    display: none;
}
.search-dropdown.active { display: block; }
.search-dropdown-header {
    padding: .5rem .85rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #141414;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}
.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .85rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.04);
    cursor: pointer;
    transition: background .12s;
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover,
.search-dropdown-item.highlighted {
    background: #242424;
    color: var(--text-primary);
}
.search-dropdown-item i.type-icon {
    font-size: 1rem;
    color: var(--accent-orange);
    width: 22px;
    flex-shrink: 0;
    text-align: center;
}
.search-dropdown-item .sd-main { flex: 1; min-width: 0; }
.search-dropdown-item .sd-title {
    font-weight: 600;
    font-size: .825rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-dropdown-item .sd-desc {
    font-size: .72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-dropdown-item .sd-type {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: rgba(230,126,34,.1);
    color: var(--accent-orange);
    padding: .15rem .5rem;
    border-radius: 3px;
    flex-shrink: 0;
}
.search-dropdown-empty,
.search-dropdown-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .825rem;
}
.search-dropdown-footer {
    padding: .55rem .85rem;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: .75rem;
}
.search-dropdown-footer a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
}
.search-dropdown-footer a:hover { text-decoration: underline; }

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.page-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -.01em;
}

/* ---- Cards ---- */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -.02em;
    margin-top: .25rem;
}
.stat-card .stat-label {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.stat-card .stat-unit {
    font-size: .45em;
    font-weight: 500;
    color: var(--text-muted);
}
.stat-card .stat-bar {
    height: 3px;
    background: var(--surface-secondary);
    border-radius: 2px;
    margin-top: .85rem;
    overflow: hidden;
}
.stat-card .stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    opacity: .5;
    transition: width .4s ease;
}

.detail-card, .form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.detail-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: .15rem;
}
.detail-value {
    font-size: .875rem;
    color: var(--text-primary);
}

.form-card .form-label {
    font-weight: 600;
    font-size: .8rem;
    color: var(--text-secondary);
}

/* ---- Tables ---- */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.table-container .table { margin-bottom: 0; }
.table-container .table th {
    background: var(--surface-secondary);
    font-weight: 600;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding: .6rem 1rem;
}
.table-container .table td {
    padding: .6rem 1rem;
    vertical-align: middle;
    font-size: .8125rem;
}
.table-container .table tbody tr:hover { background: #2a2a2a; }
.table-container .table tbody tr { cursor: default; }

/* ---- Badges ---- */
.badge-status {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 3px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
    line-height: 1.4;
}

/* ---- Status badges (professional pill style with dot indicator) ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .25rem .7rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    border: 1px solid transparent;
    line-height: 1.3;
    white-space: nowrap;
    vertical-align: middle;
    text-transform: uppercase;
}
.status-badge::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: .9;
}
/* Clickable status (toggles) */
a.status-badge, button.status-badge {
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
    background-clip: padding-box;
}
a.status-badge:hover, button.status-badge:hover {
    filter: none;
    transform: none;
}
button.status-badge { background: transparent; }

.status-przyjety {
    background: rgba(180,190,205,.06);
    color: #9aa8b8;
    border-color: rgba(154,168,184,.28);
}
.status-w-trakcie {
    background: rgba(200,165,110,.07);
    color: #c4a474;
    border-color: rgba(196,164,116,.3);
}
.status-zakonczony {
    background: rgba(140,180,150,.07);
    color: #9bbfa6;
    border-color: rgba(155,191,166,.3);
}
.status-oczekuje {
    background: rgba(160,160,170,.06);
    color: #9d9da8;
    border-color: rgba(157,157,168,.26);
}
.status-oplacona {
    background: rgba(140,180,150,.07);
    color: #9bbfa6;
    border-color: rgba(155,191,166,.3);
}
.status-nieoplacona {
    background: rgba(190,130,130,.06);
    color: #c19090;
    border-color: rgba(193,144,144,.32);
}
.status-rozpatrzony {
    background: rgba(140,180,150,.07);
    color: #9bbfa6;
    border-color: rgba(155,191,166,.3);
}
.status-odrzucony {
    background: rgba(190,130,130,.06);
    color: #c19090;
    border-color: rgba(193,144,144,.32);
}

/* ---- Search ---- */
.search-bar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: .75rem;
}

/* ---- Buttons ---- */
.btn {
    font-size: .8125rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all .15s ease;
    letter-spacing: .01em;
}
.btn-sm {
    font-size: .75rem;
    padding: .3rem .65rem;
    border-radius: 3px;
}
.btn-primary {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
    box-shadow: none;
}
.btn-primary:hover {
    background: #cf6d17;
    border-color: #cf6d17;
    color: #fff;
}
.btn-outline-primary {
    color: var(--accent-orange);
    border-color: rgba(230,126,34,.4);
    background: transparent;
}
.btn-outline-primary:hover {
    background: rgba(230,126,34,.1);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

/* ---- Empty States ---- */
.empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}
.empty-state p { margin: .5rem 0; font-size: .8125rem; }

/* ---- Low Stock ---- */
.low-stock { color: #b07070; font-weight: 600; }

/* ---- Print ---- */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    body { background: #fff; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-header { flex-direction: column; align-items: flex-start; }
}

/* ---- Utilities ---- */
.section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: .75rem;
}
code { font-size: .8em; color: var(--text-secondary); background: var(--surface-secondary); padding: .1em .35em; border-radius: 3px; }
.table-container .p-3 { padding: .85rem 1rem !important; }
.table-container .p-3 h5 { font-size: .875rem; font-weight: 600; }

/* Detail card override for dark theme */
.detail-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.detail-card .detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-card .detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Low stock warning */
.low-stock {
    color: var(--accent-red);
    font-weight: 600;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ---- Dark theme overrides for Bootstrap ---- */
.form-control, .form-select {
    background-color: #252525;
    border-color: #444;
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    background-color: #2a2a2a;
    border-color: var(--accent-orange);
    color: var(--text-primary);
    box-shadow: 0 0 0 .2rem rgba(230,126,34,.25);
}
.form-control::placeholder { color: #666; }
.modal-content { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
/* (style alertów przeniesione do sekcji FLASH / ALERT poniżej) */

/* ============================================================
   FLASH / ALERT - premium banner z paskiem po lewej
   ============================================================ */
.alert {
    position: relative;
    border-radius: 12px;
    border: 1px solid;
    padding: 16px 56px 16px 62px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .1px;
    backdrop-filter: blur(10px);
    box-shadow:
        0 10px 32px rgba(0,0,0,.35),
        inset 0 1px 0 rgba(255,255,255,.05);
    animation: alertSlideIn .38s cubic-bezier(.2,.9,.25,1.15);
    overflow: hidden;
}
/* Pionowy pasek po lewej (4px) */
.alert::after {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
}
/* Ikona w kwadraciku z gradientem */
.alert::before {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
    line-height: 32px;
    text-align: center;
    border: 1px solid;
}
.alert-success::before {
    content: "\2713";
    background: linear-gradient(135deg, rgba(127,191,127,.2), rgba(127,191,127,.08));
    border-color: rgba(127,191,127,.35);
    color: #a0e0a0;
    text-shadow: 0 0 8px rgba(127,191,127,.4);
}
.alert-danger::before {
    content: "\00D7";
    font-size: 22px;
    background: linear-gradient(135deg, rgba(212,114,114,.22), rgba(212,114,114,.08));
    border-color: rgba(212,114,114,.4);
    color: #f0a0a0;
    text-shadow: 0 0 8px rgba(212,114,114,.5);
}
.alert-warning::before {
    content: "!";
    background: linear-gradient(135deg, rgba(226,183,86,.22), rgba(226,183,86,.08));
    border-color: rgba(226,183,86,.4);
    color: #f5d880;
    text-shadow: 0 0 8px rgba(226,183,86,.45);
}
.alert-info::before {
    content: "i";
    font-style: italic;
    background: linear-gradient(135deg, rgba(125,166,199,.22), rgba(125,166,199,.08));
    border-color: rgba(125,166,199,.35);
    color: #b8d4ea;
}

.alert-success {
    background: linear-gradient(135deg, rgba(127,191,127,.1) 0%, rgba(20,28,22,.95) 60%);
    border-color: rgba(127,191,127,.28);
    color: #dbebdb;
}
.alert-success::after { background: linear-gradient(180deg, #7fbf7f, #5a9b5a); box-shadow: 0 0 14px rgba(127,191,127,.5); }

.alert-danger {
    background: linear-gradient(135deg, rgba(212,114,114,.12) 0%, rgba(28,20,20,.95) 60%);
    border-color: rgba(212,114,114,.32);
    color: #f0d3d3;
}
.alert-danger::after { background: linear-gradient(180deg, #d47272, #a94848); box-shadow: 0 0 14px rgba(212,114,114,.55); }

.alert-warning {
    background: linear-gradient(135deg, rgba(226,183,86,.11) 0%, rgba(28,24,16,.95) 60%);
    border-color: rgba(226,183,86,.32);
    color: #f2e4b8;
}
.alert-warning::after { background: linear-gradient(180deg, #e2b756, #b8912d); box-shadow: 0 0 14px rgba(226,183,86,.55); }

.alert-info {
    background: linear-gradient(135deg, rgba(125,166,199,.11) 0%, rgba(18,22,28,.95) 60%);
    border-color: rgba(125,166,199,.28);
    color: #d8e4ef;
}
.alert-info::after { background: linear-gradient(180deg, #7da6c7, #5a84a5); box-shadow: 0 0 14px rgba(125,166,199,.5); }

.alert .btn-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .45;
    padding: 10px;
    filter: invert(1) brightness(1.5);
    transition: opacity .15s;
}
.alert .btn-close:hover { opacity: .95; }

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-10px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   LICENSE CARD - profesjonalny panel statusu licencji
   ============================================================ */
.license-card {
    background: linear-gradient(180deg, #1e1e20 0%, #18181a 100%);
    border: 1px solid #2e2e32;
    border-radius: 14px;
    padding: 24px 26px;
    box-shadow: 0 4px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.03);
}
.license-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.license-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(230,126,34,.2), rgba(230,126,34,.08));
    border: 1px solid rgba(230,126,34,.3);
    display: flex; align-items: center; justify-content: center;
    color: #e67e22;
    flex-shrink: 0;
}
.license-title {
    font-size: 17px;
    font-weight: 600;
    color: #e8e8ea;
    letter-spacing: .2px;
}
.license-subtitle {
    font-size: 12.5px;
    color: #7a7a80;
    margin-top: 2px;
}

.license-status {
    position: relative;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 22px;
    border: 1px solid;
    overflow: hidden;
    animation: licenseFade .4s ease-out;
}
.license-status::before {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
}
.license-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    padding: 5px 11px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.license-status-badge .status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(0,0,0,.2);
}
.license-status-title {
    font-size: 17px;
    font-weight: 600;
    color: #f0f0f2;
    margin-bottom: 4px;
}
.license-status-desc {
    font-size: 13px;
    color: #a8a8ae;
    line-height: 1.55;
    margin-top: 6px;
}
.license-status-rows {
    margin-top: 12px;
    display: grid;
    gap: 6px;
}
.license-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px dashed rgba(255,255,255,.04);
}
.license-row:last-child { border-bottom: 0; }
.license-row-label {
    color: #7a7a80;
    text-transform: none;
    font-weight: 500;
}
.license-row-value {
    color: #d8d8dc;
    font-weight: 600;
    text-align: right;
}

/* Variants */
.license-status--active {
    background:
        radial-gradient(circle at top right, rgba(224,180,76,.12), transparent 60%),
        linear-gradient(135deg, #1f1f22 0%, #16161a 100%);
    border-color: rgba(224,180,76,.35);
    box-shadow:
        0 2px 20px rgba(0,0,0,.3),
        inset 0 1px 0 rgba(255,255,255,.04),
        inset 0 0 0 1px rgba(224,180,76,.08);
}
.license-status--active::before {
    background: linear-gradient(180deg, #e0b44c 0%, #c9952a 100%);
    box-shadow: 0 0 12px rgba(224,180,76,.4);
}
.license-status--active::after {
    content: "";
    position: absolute;
    top: 16px;
    right: 18px;
    width: 44px;
    height: 44px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0b44c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2 4 6v6c0 5 3.5 9 8 10 4.5-1 8-5 8-10V6l-8-4z'/><path d='m9 12 2 2 4-4'/></svg>") center/contain no-repeat;
    opacity: .9;
}
.license-status--active .license-status-badge {
    background: linear-gradient(135deg, rgba(224,180,76,.18), rgba(201,149,42,.08));
    color: #e0b44c;
    border: 1px solid rgba(224,180,76,.35);
    text-shadow: 0 0 12px rgba(224,180,76,.3);
}
.license-status--active .license-status-badge .status-dot {
    background: #e0b44c;
    box-shadow: 0 0 8px rgba(224,180,76,.7);
    animation: pulseDot 2s ease-in-out infinite;
}
.license-status--active .license-status-title {
    color: #f0d88a;
    background: linear-gradient(90deg, #f0d88a, #e0b44c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.license-status--active .license-status-body { padding-right: 56px; }

.license-status--trial {
    background: linear-gradient(135deg, rgba(230,126,34,.14) 0%, rgba(230,126,34,.04) 100%);
    border-color: rgba(230,126,34,.35);
}
.license-status--trial::before { background: #e67e22; }
.license-status--trial .license-status-badge {
    background: rgba(230,126,34,.15);
    color: #f0a050;
    border: 1px solid rgba(230,126,34,.3);
}
.license-status--trial .license-status-badge .status-dot {
    background: #e67e22;
    animation: pulseDot 2s ease-in-out infinite;
}

.license-status--expired {
    background: linear-gradient(135deg, rgba(196,84,84,.14) 0%, rgba(196,84,84,.04) 100%);
    border-color: rgba(212,114,114,.4);
}
.license-status--expired::before { background: #d47272; }
.license-status--expired .license-status-badge {
    background: rgba(212,114,114,.15);
    color: #e58a8a;
    border: 1px solid rgba(212,114,114,.3);
}
.license-status--expired .license-status-badge .status-dot { background: #d47272; }

.license-progress {
    margin-top: 14px;
    height: 4px;
    background: rgba(255,255,255,.06);
    border-radius: 10px;
    overflow: hidden;
}
.license-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e67e22, #f0a050);
    border-radius: 10px;
    transition: width .8s cubic-bezier(.2,.9,.25,1);
}

.license-form { margin-top: 6px; }
.license-form .form-label {
    font-size: 12px;
    font-weight: 500;
    color: #9a9aa0;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

@keyframes licenseFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseDot {
    0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 3px rgba(0,0,0,.2), 0 0 0 0 currentColor; }
    50%     { opacity: .7; transform: scale(1.15); }
}

.badge.bg-success { background: rgba(140,170,140,.25) !important; color: #8aaa8a !important; }
.badge.bg-warning { background: rgba(190,160,100,.2) !important; color: #b8983f !important; }
.badge.bg-danger { background: rgba(180,120,120,.2) !important; color: #b07070 !important; }
.badge.bg-info { background: rgba(120,160,190,.2) !important; color: #7899ab !important; }
.badge.bg-secondary { background: rgba(160,160,170,.15) !important; color: #888890 !important; }
.text-muted { color: var(--text-muted) !important; }
a { color: var(--accent-orange); }
a:hover { color: #cf6d17; }
.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-hover-bg: rgba(255,255,255,.035);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-striped-bg: rgba(255,255,255,.025);
    --bs-table-striped-color: var(--text-primary);
}
.table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text-primary);
    border-bottom-color: var(--border);
}
.table thead th,
.table thead td {
    background: #191919 !important;
    color: #f0f0f0 !important;
    border-bottom: 1px solid var(--border) !important;
    font-weight: 700;
}
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--border) !important; }
.btn-close { filter: invert(1); }
hr { border-color: var(--border); }
.card { background: var(--surface); border-color: var(--border); color: var(--text-primary); }
.card-header { background: var(--surface-secondary); border-bottom-color: var(--border); color: var(--text-primary); }
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 { color: var(--text-primary); }
.card-body { background: var(--surface); }
.list-group-item { background: var(--surface); border-color: var(--border); color: var(--text-primary); }
.breadcrumb-item a { color: var(--accent-orange); }
.breadcrumb-item.active { color: var(--text-muted); }
.dropdown-menu { background: var(--surface); border-color: var(--border); }
.dropdown-item { color: var(--text-primary); }
.dropdown-item:hover { background: var(--surface-secondary); color: var(--accent-orange); }
.page-link { background: var(--surface); border-color: var(--border); color: var(--text-primary); }
.page-link:hover { background: var(--surface-secondary); color: var(--accent-orange); }
.btn-outline-secondary { color: var(--text-secondary); border-color: rgba(85,85,85,.6); }
.btn-outline-secondary:hover { background: rgba(51,51,51,.6); color: var(--text-primary); border-color: #666; }
.btn-outline-danger { color: #b07070; border-color: rgba(176,112,112,.35); }
.btn-outline-danger:hover { background: rgba(176,112,112,.1); color: #b07070; border-color: rgba(176,112,112,.5); }
.btn-secondary { background: #2a2a2a; border-color: #3a3a3a; color: var(--text-primary); }
.btn-secondary:hover { background: #3a3a3a; border-color: #4a4a4a; }
.btn-success { background: #5a7a5a; border-color: #5a7a5a; }
.btn-success:hover { background: #4d6b4d; border-color: #4d6b4d; }
.btn-danger { background: #8a5050; border-color: #8a5050; }
.btn-danger:hover { background: #764444; border-color: #764444; }
.btn-outline-info { color: #7899ab; border-color: rgba(120,153,171,.35); }
.btn-outline-info:hover { background: rgba(120,153,171,.1); color: #7899ab; border-color: rgba(120,153,171,.5); }
.btn-outline-success { color: #8aaa8a; border-color: rgba(138,170,138,.35); }
.btn-outline-success:hover { background: rgba(138,170,138,.1); color: #8aaa8a; border-color: rgba(138,170,138,.5); }
input[type="number"], input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
select, textarea { color-scheme: dark; }

/* Support ticket conversation */
.support-message {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #181818;
}
.support-message--admin {
    border-color: rgba(230,126,34,.35);
    background: linear-gradient(135deg, rgba(230,126,34,.12), rgba(230,126,34,.03));
}
.support-message__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: .75rem;
    margin-bottom: 6px;
}
.support-message__author {
    color: var(--text-primary);
    font-weight: 700;
}
.support-message__body {
    white-space: pre-wrap;
    color: var(--text-primary);
    line-height: 1.55;
}
/* === TRIAL / LICENSE BADGE (topbar) ============================= */
.trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 12px;
    margin-right: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.78rem;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #f4e6c8;
    background: linear-gradient(135deg, rgba(224,180,76,0.16) 0%, rgba(201,149,42,0.10) 55%, rgba(30,30,35,0.9) 100%);
    border: 1px solid rgba(224,180,76,0.35);
    box-shadow:
        0 2px 6px rgba(0,0,0,0.35),
        0 0 0 1px rgba(224,180,76,0.06) inset,
        0 1px 0 rgba(255,220,150,0.08) inset;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.trial-badge::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,220,150,0.08) 50%, transparent 100%);
    transform: translateX(-110%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.trial-badge:hover {
    color: #fff4dc;
    border-color: rgba(224,180,76,0.6);
    transform: translateY(-1px);
    box-shadow:
        0 6px 18px rgba(224,180,76,0.25),
        0 0 0 1px rgba(224,180,76,0.15) inset;
}

.trial-badge:hover::before { transform: translateX(110%); }

.trial-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0b44c;
    box-shadow: 0 0 8px rgba(224,180,76,0.8), 0 0 14px rgba(224,180,76,0.4);
    animation: trialPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes trialPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(224,180,76,0.6), 0 0 12px rgba(224,180,76,0.3); opacity: 0.9; }
    50%      { box-shadow: 0 0 12px rgba(224,180,76,1),   0 0 22px rgba(224,180,76,0.55); opacity: 1; }
}

.trial-badge__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #e0b44c, #c9952a);
    color: #1a1a1c;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,220,150,0.3) inset;
    flex-shrink: 0;
}

.trial-badge__text {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
}

.trial-badge__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(224,180,76,0.9);
    font-weight: 700;
}

.trial-badge__days {
    font-size: 0.80rem;
    color: #f4e6c8;
    font-weight: 600;
}

.trial-badge__arrow {
    font-size: 1.1rem;
    color: rgba(224,180,76,0.7);
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.trial-badge:hover .trial-badge__arrow {
    transform: translateX(3px);
    color: #f4e6c8;
}

/* Urgent variant - last 2 days */
.trial-badge--urgent {
    background: linear-gradient(135deg, rgba(230,126,34,0.20) 0%, rgba(192,88,20,0.12) 55%, rgba(30,25,25,0.9) 100%);
    border-color: rgba(230,126,34,0.45);
    color: #ffd9a8;
}
.trial-badge--urgent .trial-badge__icon {
    background: linear-gradient(135deg, #e67e22, #c05814);
    color: #fff;
}
.trial-badge--urgent .trial-badge__dot {
    background: #e67e22;
    box-shadow: 0 0 8px rgba(230,126,34,0.9), 0 0 14px rgba(230,126,34,0.5);
    animation: trialPulseUrgent 1.1s ease-in-out infinite;
}
.trial-badge--urgent .trial-badge__label { color: rgba(255,180,120,0.95); }
.trial-badge--urgent .trial-badge__days { color: #ffe4c4; }
.trial-badge--urgent .trial-badge__arrow { color: rgba(255,180,120,0.8); }
.trial-badge--urgent:hover {
    border-color: rgba(230,126,34,0.75);
    box-shadow: 0 6px 18px rgba(230,126,34,0.35), 0 0 0 1px rgba(230,126,34,0.2) inset;
}

@keyframes trialPulseUrgent {
    0%, 100% { box-shadow: 0 0 6px rgba(230,126,34,0.7), 0 0 12px rgba(230,126,34,0.4); }
    50%      { box-shadow: 0 0 14px rgba(230,126,34,1),   0 0 26px rgba(230,126,34,0.7); }
}

/* Expired variant */
.trial-badge--expired {
    background: linear-gradient(135deg, rgba(200,70,70,0.22) 0%, rgba(150,40,40,0.14) 55%, rgba(30,20,20,0.9) 100%);
    border-color: rgba(200,70,70,0.5);
    color: #ffc8c8;
}
.trial-badge--expired .trial-badge__icon {
    background: linear-gradient(135deg, #c84646, #8a2e2e);
    color: #fff;
}
.trial-badge--expired .trial-badge__label { color: rgba(255,170,170,0.95); }
.trial-badge--expired .trial-badge__days { color: #ffd4d4; }
.trial-badge--expired .trial-badge__arrow { color: rgba(255,170,170,0.8); }
.trial-badge--expired:hover {
    border-color: rgba(200,70,70,0.8);
    box-shadow: 0 6px 18px rgba(200,70,70,0.35), 0 0 0 1px rgba(200,70,70,0.2) inset;
}

/* === RĘCZNA FAKTURA - tabela pozycji ============================== */
.reczna-form .card {
    background: var(--bs-card-bg, #1e1e22);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.reczna-form .card-header {
    background: linear-gradient(180deg, rgba(230,126,34,0.08), transparent);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #e8e8ea;
    padding: 0.75rem 1rem;
}
.reczna-form .card-header i { color: #e67e22; }
.reczna-form .form-label {
    font-size: 0.78rem;
    color: #9aa0a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.reczna-pozycje-table {
    margin-bottom: 0;
    font-size: 0.88rem;
}
.reczna-pozycje-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #9aa0a6;
    font-weight: 600;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0.6rem 0.5rem;
}
.reczna-pozycje-table tbody td {
    padding: 0.5rem 0.5rem;
    vertical-align: middle;
}
.reczna-pozycje-table tbody tr:hover {
    background: rgba(230,126,34,0.04);
}
.reczna-pozycje-table .lp-cell {
    text-align: center;
    font-weight: 600;
    color: #e67e22;
}
.reczna-pozycje-table input.form-control-sm,
.reczna-pozycje-table select.form-select-sm {
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
}
.reczna-pozycje-table .reczna-wartosc-brutto {
    font-weight: 600;
    color: #e0b44c;
    font-variant-numeric: tabular-nums;
}
.reczna-suma-row td {
    background: rgba(224,180,76,0.06);
    border-top: 2px solid rgba(224,180,76,0.2);
    padding: 0.75rem 0.5rem !important;
    font-size: 1rem;
}
.reczna-suma-row td strong { color: #f4e6c8; }
#sumaBrutto {
    font-size: 1.1rem;
    color: #e0b44c;
    font-variant-numeric: tabular-nums;
}
.reczna-pozycje-table .usun-pozycje {
    padding: 0.25rem 0.45rem;
    line-height: 1;
}


/* =============================================================
   AI MECHANIK - chat UI
   ============================================================= */
.ai-chat-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
}
.ai-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.ai-mode-btn {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    color: #cfd3da;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: .88rem;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ai-mode-btn:hover {
    background: rgba(230,126,34,.12);
    border-color: rgba(230,126,34,.35);
    color: #fff;
}
.ai-mode-btn.active {
    background: linear-gradient(135deg, #e67e22, #d35400);
    border-color: #e67e22;
    color: #fff;
    box-shadow: 0 2px 8px rgba(230,126,34,.3);
}
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: rgba(0,0,0,.15);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    margin-bottom: 12px;
}
.ai-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #cfd3da;
}
.ai-welcome-icon {
    font-size: 3.5rem;
    color: #e67e22;
    margin-bottom: 16px;
}
.ai-welcome h3 {
    margin-bottom: 8px;
    color: #fff;
}
.ai-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 24px;
    text-align: left;
}
.ai-example {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ai-example:hover {
    background: rgba(230,126,34,.1);
    border-color: rgba(230,126,34,.35);
    transform: translateY(-1px);
}
.ai-example i {
    color: #e67e22;
    font-size: 1.1rem;
}
.ai-example strong {
    color: #fff;
    font-size: .92rem;
}
.ai-example small {
    color: #8b919a;
    font-size: .78rem;
}
.ai-msg {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: aiMsgIn .25s ease-out;
}
@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-msg-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.ai-msg--user .ai-msg-avatar {
    background: rgba(64,156,255,.15);
    color: #6fb7ff;
}
.ai-msg--assistant .ai-msg-avatar {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
}
.ai-msg-body {
    flex: 1;
    min-width: 0;
}
.ai-msg-content {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    padding: 12px 14px;
    color: #e8ebef;
    line-height: 1.55;
    font-size: .94rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-msg--user .ai-msg-content {
    background: rgba(64,156,255,.06);
    border-color: rgba(64,156,255,.2);
}
.ai-msg-content strong {
    color: #fff;
}
.ai-msg-content code {
    background: rgba(0,0,0,.3);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: .88em;
    color: #e0b44c;
}
.ai-msg-content .md-li {
    margin: 2px 0;
    padding-left: 4px;
}
.ai-msg-content .md-li-bullet {
    color: #cfd3da;
}
.ai-chat-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.ai-chat-form textarea {
    flex: 1;
    resize: none;
    min-height: 50px;
    max-height: 150px;
    background: rgba(0,0,0,.2);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: .95rem;
}
.ai-chat-form textarea:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230,126,34,.15);
    background: rgba(0,0,0,.3);
}
.ai-send-btn {
    height: 50px;
    width: 50px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .ai-chat-wrapper {
        height: calc(100vh - 180px);
    }
}

/* === AI Mechanik - multi-provider settings === */
.ai-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin: 8px 0 18px;
}
.ai-provider-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(255,255,255,.10);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    margin: 0;
}
.ai-provider-card:hover {
    background: rgba(230,126,34,.08);
    border-color: rgba(230,126,34,.4);
}
.ai-provider-card.active {
    background: rgba(230,126,34,.15);
    border-color: #e67e22;
    box-shadow: 0 0 0 2px rgba(230,126,34,.2);
}
.ai-provider-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}
.ai-provider-card strong { color: #fff; font-size: .95rem; }
.ai-provider-card small { color: #9ba0a8; font-size: .78rem; line-height: 1.35; }
.ai-provider-card.active strong { color: #e67e22; }

/* Session info badge */
.ai-session-info {
    color: #8b919a;
    font-size: .8rem;
    padding: 4px 10px;
    background: rgba(255,255,255,.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
}
.ai-session-info span {
    color: #e0b44c;
    font-family: monospace;
    font-weight: 600;
}

/* Meta info pod wiadomością */
.ai-msg-meta {
    font-size: .72rem !important;
    opacity: .65;
    letter-spacing: .02em;
}

/* Sugerowane pytania kontynuujące (chips pod odpowiedzią asystenta) */
.ai-suggestions {
    margin-top: .8rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}
.ai-suggestions-label {
    width: 100%;
    color: var(--text-muted);
    opacity: .8;
    font-size: .78rem;
    margin-bottom: .15rem;
}
.ai-suggestion-chip {
    background: rgba(230, 126, 34, 0.08);
    border: 1px solid rgba(230, 126, 34, 0.3);
    color: #e67e22;
    padding: .4rem .8rem;
    border-radius: 999px;
    font-size: .82rem;
    cursor: pointer;
    transition: all .15s ease;
    text-align: left;
    max-width: 100%;
    line-height: 1.3;
}
.ai-suggestion-chip:hover {
    background: rgba(230, 126, 34, 0.18);
    border-color: rgba(230, 126, 34, 0.6);
    transform: translateY(-1px);
}
.ai-suggestion-chip:active {
    transform: translateY(0);
}

/* Linki w odpowiedzi (lista zakupowa) */
.ai-msg-content a {
    color: #6fb7ff;
    text-decoration: none;
    border-bottom: 1px dotted rgba(111,183,255,.4);
}
.ai-msg-content a:hover {
    color: #9ccfff;
    border-bottom-style: solid;
}
.ai-msg-content h4, .ai-msg-content h5 {
    margin: 12px 0 6px;
    color: #fff;
}

/* === AI Mechanik - tryb "Zapisz naprawę" + panel akcji === */
.ai-mode-btn.ai-mode-action {
    background: rgba(110,150,120,.08);
    border-color: rgba(110,150,120,.3);
    color: #9bbfa6;
}
.ai-mode-btn.ai-mode-action:hover {
    background: rgba(110,150,120,.15);
}
.ai-mode-btn.ai-mode-action.active {
    background: #6e9678;
    color: #fff;
    border-color: #6e9678;
}
.ai-example.ai-example-action {
    border-color: rgba(110,150,120,.35);
    background: rgba(110,150,120,.05);
}
.ai-example.ai-example-action:hover {
    background: rgba(110,150,120,.12);
}

.ai-action-panel {
    margin-top: 12px;
    padding: 16px 18px;
    background: rgba(110,150,120,.05);
    border: 1px solid rgba(110,150,120,.25);
    border-left: 3px solid #6e9678;
    border-radius: 8px;
}
.ai-action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #9bbfa6;
    font-size: .95rem;
    letter-spacing: .01em;
}
.ai-action-badge {
    margin-left: auto;
    background: rgba(110,150,120,.15);
    color: #9bbfa6;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    border: 1px solid rgba(110,150,120,.25);
}
.ai-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 6px 14px;
    margin-bottom: 8px;
}
.ai-action-grid .lbl,
.ai-action-row .lbl {
    color: #8b919a;
    font-size: .82rem;
    margin-right: 4px;
}
.ai-action-row {
    margin: 6px 0;
    padding: 6px 10px;
    background: rgba(255,255,255,.03);
    border-radius: 6px;
    font-size: .9rem;
}
table.ai-action-parts {
    width: 100%;
    margin: 8px 0;
    font-size: .85rem;
    border-collapse: collapse;
}
table.ai-action-parts th,
table.ai-action-parts td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
table.ai-action-parts th {
    background: rgba(255,255,255,.04);
    color: #cfd3da;
    font-weight: 600;
    text-align: left;
}
table.ai-action-parts td.num,
table.ai-action-parts th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
table.ai-action-parts code {
    color: #6fb7ff;
    font-size: .78rem;
}
.ai-action-totals {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: rgba(0,0,0,.18);
    border-radius: 6px;
    margin-top: 6px;
    font-size: .9rem;
}
.ai-action-totals .grand {
    margin-left: auto;
    color: #ffd870;
    font-size: 1rem;
}
.ai-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.ai-action-result a.btn {
    margin-top: 6px;
}

/* === AI Mechanik - UNIFIED LAYOUT (sidebar + chat) === */
.ai-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    height: calc(100vh - 120px);
    min-height: 500px;
}
.ai-sidebar {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    overflow: hidden;
}
.ai-sidebar-head {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.ai-sidebar-status {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ai-sidebar-status .bi-circle-fill { font-size: .55rem; }
.ai-sidebar-status span { font-weight: 600; color: #cfd3da; }
.ai-sidebar-status small { color: #8b919a; width: 100%; padding-left: 16px; }
.ai-sidebar-status small a { color: #6fb7ff; }
.ai-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}
.ai-sidebar-loading,
.ai-sidebar-empty {
    padding: 20px 12px;
    color: #8b919a;
    font-size: .85rem;
    text-align: center;
}
.ai-sidebar-item {
    position: relative;
    padding: 9px 30px 9px 11px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s;
}
.ai-sidebar-item:hover { background: rgba(255,255,255,.06); }
.ai-sidebar-item.active {
    background: rgba(230,126,34,.16);
    border-left: 3px solid #e67e22;
    padding-left: 8px;
}
.ai-sidebar-item-title {
    font-size: .85rem;
    color: #e8eaed;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.ai-sidebar-item-meta {
    margin-top: 3px;
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: #8b919a;
}
.ai-sidebar-item-count { font-variant-numeric: tabular-nums; }
.ai-sidebar-item-del {
    position: absolute;
    right: 4px;
    top: 6px;
    background: transparent;
    border: 0;
    color: #8b919a;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .12s, background .12s;
    cursor: pointer;
}
.ai-sidebar-item:hover .ai-sidebar-item-del { opacity: 1; }
.ai-sidebar-item-del:hover { background: rgba(220,53,69,.25); color: #ff8b95; }
.ai-sidebar-foot {
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    text-align: center;
}
.ai-sidebar-foot a { text-decoration: none; }

.ai-main {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
}
.ai-main .ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
}
.ai-main .ai-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.18);
}
.ai-main .ai-chat-form textarea {
    resize: none;
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.10);
    color: #e8eaed;
}
.ai-main .ai-send-btn {
    align-self: stretch;
    min-width: 52px;
}
.ai-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8b919a;
}
.ai-empty-icon {
    font-size: 3rem;
    opacity: .35;
    margin-bottom: 10px;
}
.ai-empty h3 { color: #e8eaed; margin-bottom: 8px; font-weight: 600; }
.ai-empty p { max-width: 460px; margin: 0 auto; font-size: .92rem; line-height: 1.5; }
.ai-empty-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 22px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.ai-empty-chip {
    background: rgba(230,126,34,.08);
    border: 1px solid rgba(230,126,34,.25);
    color: #e8eaed;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
}

/* Nagłówek czatu (pasek nad wiadomościami) */
.ai-chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(230,126,34,.08), rgba(230,126,34,0));
}
.ai-chat-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(230,126,34,.25), rgba(230,126,34,.08));
    border: 1px solid rgba(230,126,34,.35);
    color: #e67e22;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex: 0 0 auto;
}
.ai-chat-header-text h2 {
    font-size: 1.08rem;
    font-weight: 700;
    color: #e8eaed;
    margin: 0 0 2px 0;
    letter-spacing: -.2px;
}
.ai-chat-header-text small {
    color: #8b919a;
    font-size: .8rem;
    line-height: 1.3;
}

/* Zakładki trybu (Asystent AI / Auto-naprawa) */
.ai-mode-tabs {
    display: flex;
    gap: 0;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.15);
}
.ai-mode-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #8b919a;
    padding: 10px 16px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
    margin-bottom: -1px;
}
.ai-mode-tab i { font-size: .95rem; }
.ai-mode-tab:hover {
    color: #cfd3da;
    background: rgba(255,255,255,.03);
}
.ai-mode-tab.active {
    color: #e8eaed;
    border-bottom-color: #c4a474;
    background: rgba(255,255,255,.02);
}
.ai-mode-tab-hint {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c7079;
    background: rgba(255,255,255,.05);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,.06);
}
.ai-mode-tab.active .ai-mode-tab-hint {
    color: #c4a474;
    border-color: rgba(196,164,116,.35);
    background: rgba(196,164,116,.08);
}

@media (max-width: 900px) {
    .ai-layout { grid-template-columns: 1fr; height: auto; }
    .ai-sidebar { max-height: 220px; }
}

/* Chat: pozwól zaznaczać i kopiować tekst */
.ai-msg, .ai-msg *, .ai-chat-messages, .ai-chat-messages * {
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text;
}
.ai-msg-avatar, .ai-msg-avatar * {
    cursor: default;
    user-select: none !important;
}
.ai-action-buttons button, .ai-sidebar-item, .ai-sidebar-item *,
.btn, .ai-send-btn, .ai-sidebar-item-del {
    cursor: pointer;
    user-select: none !important;
}
.ai-msg-content code {
    user-select: all;
}

/* ============================================================
   DASHBOARD - REDESIGN (asymmetric tiles, hero, panels)
   ============================================================ */
.dash-hero {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 1.5rem;
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 1.75rem;
}
.dash-hero-eyebrow {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .18em;
    color: #8a92a0; font-weight: 600; opacity: .85;
}
.dash-hero-title {
    font-size: 1.85rem; font-weight: 600; margin: .3rem 0 .4rem;
    color: var(--text-primary, #fff); letter-spacing: -.01em;
}
.dash-hero-sub { color: var(--text-muted); margin: 0; font-size: .9rem; }
.dash-hero-link { color: var(--accent-orange); text-decoration: none; border-bottom: 1px dashed rgba(230,126,34,.4); }
.dash-hero-link:hover { color: #ff9744; border-bottom-color: rgba(255,151,68,.6); }
.dash-hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.kpi-card {
    position: relative;
    display: flex; flex-direction: column; gap: .5rem;
    padding: 1.4rem 1.4rem 1.3rem;
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.kpi-card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(255,255,255,.08);
    transition: background .18s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.035);
}
.kpi-card-icon {
    position: absolute; top: 1.05rem; right: 1.05rem;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    font-size: .95rem;
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.5);
    border: 1px solid rgba(255,255,255,.05);
}
.kpi-card-label {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .14em;
    color: var(--text-muted); font-weight: 600;
}
.kpi-card-value {
    font-size: 1.95rem; font-weight: 600; line-height: 1.1;
    color: var(--text-primary, #fff);
    display: flex; align-items: baseline; gap: .35rem;
    letter-spacing: -.02em;
}
.kpi-card-unit { font-size: .85rem; opacity: .55; font-weight: 500; margin-left: .15rem; }
.kpi-card-trend {
    font-size: .75rem; opacity: .7; margin-top: .15rem;
    display: flex; align-items: center; gap: .3rem;
    color: var(--text-muted);
}
.kpi-card-trend.up { color: #7ab788; opacity: .95; }
.kpi-card-trend.down { color: #c47272; opacity: .95; }

/* Tonacje kafelków - cienki pasek na g\u00f3rze + delikatna ikona w akcencie.
   Reszta kafelka jednolita - kolor jest WSKAZ\u00d3WK\u0104, nie t\u0142em. */
.kpi-card--primary::before { background: linear-gradient(90deg, #e67e22, rgba(230,126,34,.2)); }
.kpi-card--primary .kpi-card-icon { background: rgba(230,126,34,.1); color: #e67e22; border-color: rgba(230,126,34,.25); }
.kpi-card--primary:hover { border-color: rgba(230,126,34,.25); }

.kpi-card--orange::before { background: linear-gradient(90deg, #c4a474, rgba(196,164,116,.15)); }
.kpi-card--orange .kpi-card-icon { background: rgba(196,164,116,.08); color: #c4a474; border-color: rgba(196,164,116,.2); }

.kpi-card--red::before { background: linear-gradient(90deg, #c47272, rgba(196,114,114,.15)); }
.kpi-card--red .kpi-card-icon { background: rgba(196,114,114,.08); color: #c47272; border-color: rgba(196,114,114,.22); }
.kpi-card--red:hover { border-color: rgba(196,114,114,.22); }

.kpi-card--neutral::before { background: rgba(255,255,255,.05); }

.kpi-card--ghost::before { background: linear-gradient(90deg, #8a9bb8, rgba(138,155,184,.15)); }
.kpi-card--ghost .kpi-card-icon { background: rgba(138,155,184,.08); color: #a8b4c8; border-color: rgba(138,155,184,.2); }

/* Layout: lewa szeroka kolumna + prawy sidebar */
.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 1.25rem;
}
@media (max-width: 980px) {
    .dash-grid { grid-template-columns: 1fr; }
}
.dash-grid-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.dash-grid-side { display: flex; flex-direction: column; gap: 1.25rem; }

.dash-panel {
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    overflow: hidden;
}
.dash-panel--accent {
    background: linear-gradient(135deg, rgba(230,126,34,.08), rgba(230,126,34,.02));
    border-color: rgba(230,126,34,.18);
}
.dash-panel--warn {
    background: linear-gradient(135deg, rgba(220,170,80,.06), rgba(220,170,80,.01));
    border-color: rgba(220,170,80,.2);
}
.dash-panel-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
    gap: .8rem;
}
.dash-panel-title {
    margin: 0; font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; gap: .5rem;
}
.dash-panel-title i { color: var(--accent-orange); }

.dash-list { display: flex; flex-direction: column; }
.dash-list-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .85rem;
    align-items: center;
    padding: .85rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.04);
    text-decoration: none !important;
    color: inherit;
    transition: background .15s ease;
}
.dash-list-item:first-child { border-top: 0; }
.dash-list-item:hover { background: rgba(255,255,255,.03); }
.dash-list-item--compact { padding: .6rem 1.25rem; }
.dash-list-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.dash-list-main { min-width: 0; }
.dash-list-title {
    font-weight: 600; font-size: .92rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-list-rej {
    font-size: .78rem; color: var(--text-muted); font-weight: 500;
    margin-left: .35rem;
}
.dash-list-sub { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.dash-list-side { display: flex; flex-direction: column; gap: .25rem; align-items: flex-end; text-align: right; }
.dash-list-amount { font-size: .9rem; }
.dash-list-date { font-size: .72rem; color: var(--text-muted); }

.dash-empty {
    padding: 2.2rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
}
.dash-empty i { font-size: 2rem; opacity: .4; display: block; margin-bottom: .5rem; }
.dash-empty p { margin: 0; font-size: .9rem; }

/* Quick action buttons */
.dash-quick {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .55rem;
    padding: 1rem 1.25rem;
}
.dash-quick-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .35rem;
    padding: .9rem .6rem;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    color: inherit;
    text-decoration: none !important;
    font-size: .8rem;
    transition: all .15s ease;
}
.dash-quick-btn i { font-size: 1.3rem; color: var(--accent-orange); opacity: .85; }
.dash-quick-btn:hover {
    background: rgba(230,126,34,.1);
    border-color: rgba(230,126,34,.4);
    transform: translateY(-1px);
}

/* Mini-bar dla niskiego stanu magazynu */
.kpi-mini { width: 70px; }
.kpi-mini-bar {
    width: 100%; height: 6px;
    background: rgba(255,255,255,.07);
    border-radius: 999px; overflow: hidden;
}
.kpi-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #d96a4a, #d9a44a);
    border-radius: 999px;
    transition: width .4s ease;
}

