/* ============================================================
   Navicom Theme 3.1.0 – theme.css
   Dodaje: layout aplikacji, login page, topbar, sidebar.
   Design system (zmienne, badge, tabele) – z plugin navicom.css.
   ============================================================ */

/* ── Zmienne własne theme'u ─────────────────────────────────── */
:root {
    --topbar-h: 56px;
    --footer-h: 40px;
    --sidebar-w: 220px;
    --brand-color: #3b82f6;
    /* Theme tokens – overridden in [data-theme="dark"] */
    --th-bg:           #eef3fb;
    --th-surface:      #f6f9ff;
    --th-surface-2:    #f0f5ff;
    --th-border:       #cddaee;
    --th-border-light: #dce8f7;
    --th-text:         #111827;
    --th-text-muted:   #5b6e88;
    --th-text-faint:   #8fa3bc;
    --th-primary:      #2563eb;
    --th-hover:        #e3edfa;
}

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1f2937;
    background: #eef3fb;
    min-height: 100vh;
}

a { color: var(--brand-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout aplikacji ───────────────────────────────────────── */
.navicom-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #eef3fb;
}

.main-content {
    flex: 1;
    padding: 24px 0;
    min-height: calc(100vh - var(--topbar-h) - var(--footer-h));
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Strony z wieloma kolumnami danych – pełna szerokość jak wp-admin */
.page-dashboard.container,
.page-tenders.container {
    max-width: none;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: #f6f9ff;
    border-bottom: 1px solid #cddaee;
    box-shadow: 0 1px 3px rgba(37,99,235,.06);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

/* Brand */
.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #111827;
    text-decoration: none;
}
.brand-link:hover { text-decoration: none; color: #111827; }
.brand-name { letter-spacing: -.3px; }

/* Nav */
.topbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active {
    background: #eff6ff;
    color: var(--brand-color);
    text-decoration: none;
}

/* Actions */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* Notifications */
.notif-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 6px;
    border-radius: 6px;
    line-height: 1;
    transition: background .15s, color .15s;
}
.notif-btn:hover { background: #e8eef8; color: #374151; }

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.notif-panel {
    position: absolute;
    top: calc(var(--topbar-h) + 4px);
    right: 60px;
    width: 340px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    z-index: 200;
    overflow: hidden;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.notif-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e8eef8;
    cursor: pointer;
    transition: background .15s;
}
.notif-item:hover { background: #f0f5fc; }
.notif-item.unread { background: #eff6ff; }
.notif-item.unread:hover { background: #dbeafe; }

.notif-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-body  { color: #6b7280; font-size: 12px; margin-bottom: 4px; }
.notif-time  { color: #9ca3af; font-size: 11px; }
.notif-empty { padding: 20px 16px; color: #9ca3af; font-size: 13px; margin: 0; }

/* User avatar */
.user-menu { position: relative; }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-color);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: opacity .15s;
}
.user-avatar:hover { opacity: .85; }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    z-index: 200;
    overflow: hidden;
}

.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e8eef8;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-dropdown-header strong { font-size: 14px; }
.user-dropdown-header small { color: #6b7280; font-size: 12px; }

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #374151;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background .15s;
}
.dropdown-item:hover { background: #e8eef8; text-decoration: none; }
.dropdown-logout { color: #ef4444; }
.dropdown-logout:hover { background: #fef2f2; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    height: var(--footer-h);
    display: flex;
    align-items: center;
    border-top: 1px solid #cddaee;
    background: #f6f9ff;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 8px;
    color: #9ca3af;
    font-size: 12px;
}
.footer-sep { color: #d1d5db; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: #f8fbff;
    border: 1px solid #cddaee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e8eef8;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
}
.btn-primary:hover { background: #2563eb; border-color: #2563eb; text-decoration: none; color: #fff; }

.btn-outline {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.btn-outline:hover { background: #f0f5fc; text-decoration: none; color: #374151; }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* Spinner */
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forms ──────────────────────────────────────────────────── */
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #374151;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon--blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon--green  { background: #f0fdf4; color: #22c55e; }
.stat-icon--orange { background: #fff7ed; color: #f97316; }
.stat-icon--red    { background: #fef2f2; color: #ef4444; }
.stat-icon--purple { background: #f5f3ff; color: #8b5cf6; }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* ── Page headers ───────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.page-count {
    font-size: 13px;
    color: #6b7280;
}

/* ── Filters bar ────────────────────────────────────────────── */
.filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}
.filter-search .form-control { padding-left: 34px; }

.filter-select { width: 160px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid #e5e7eb;
    background: #f0f5fc;
    white-space: nowrap;
}

.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e8eef8;
    vertical-align: middle;
}

.data-table tbody tr:hover td { background: #eff6ff; transition: background .1s; }
.table-row-link:hover td { background: #eff6ff !important; }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-row-link { cursor: pointer; }

.td-title {
    min-width: 180px;
    max-width: 300px;
}
.td-title a { font-weight: 500; color: #111827; }
.td-title a:hover { color: var(--brand-color); }

.td-date   { white-space: nowrap; }
.td-budget { white-space: nowrap; }

.td-empty {
    text-align: center;
    color: #9ca3af;
    padding: 32px !important;
}

.sort-link { color: #6b7280; text-decoration: none; }
.sort-link:hover { color: var(--brand-color); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}
.badge-lg { padding: 4px 10px; font-size: 12px; }

.badge-success   { background: #dcfce7; color: #166534; }
.badge-secondary { background: #e8eef8; color: #6b7280; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-warning   { background: #fef9c3; color: #92400e; }

.cat-sn       { background: #dbeafe; color: #1e40af; }
.cat-nn       { background: #dcfce7; color: #166534; }
.cat-mixed    { background: #fef3c7; color: #92400e; }
.cat-lighting { background: #ede9fe; color: #4c1d95; }
.cat-other    { background: #e8eef8; color: #6b7280; }

/* ── Score ──────────────────────────────────────────────────── */
.score-badge {
    display: inline-block;
    min-width: 34px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.score-high { background: #dcfce7; color: #166534; }
.score-mid  { background: #fef9c3; color: #92400e; }
.score-low  { background: #fee2e2; color: #991b1b; }

.score-bar-wrap { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.score-bar { width: 60px; flex-shrink: 0; height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 2px; }
.score-fill.score-high { background: #22c55e; }
.score-fill.score-mid  { background: #f59e0b; }
.score-fill.score-low  { background: #ef4444; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 13px;
    text-decoration: none;
    transition: background .15s;
}
.page-btn:hover { background: #e8eef8; text-decoration: none; }
.page-btn.active { background: var(--brand-color); color: #fff; border-color: var(--brand-color); }

.page-info { margin-left: auto; color: #6b7280; font-size: 12px; }

/* ── Chart ──────────────────────────────────────────────────── */
.chart-section { }
.chart-wrapper { padding: 20px; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    animation: toastIn .2s ease;
    min-width: 260px;
    max-width: 380px;
}

.toast-success { background: #166534; }
.toast-error   { background: #991b1b; }
.toast-warning { background: #92400e; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #6b7280;
}
.breadcrumb a { color: var(--brand-color); }
.breadcrumb-sep { color: #d1d5db; }

/* ── Tender detail ──────────────────────────────────────────── */
.tender-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .tender-layout { grid-template-columns: 1fr; }
}

.tender-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 0;
    gap: 10px;
}

.tender-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    padding: 12px 20px 0;
    margin: 0;
}

.tender-meta {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px 0;
    padding: 16px 20px;
    margin: 0;
}

.tender-meta dt {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    padding: 2px 0;
}

.tender-meta dd {
    font-size: 14px;
    color: #111827;
    margin: 0;
    padding: 2px 0;
}

.tender-description, .tender-requirements {
    padding: 0 20px 20px;
    border-top: 1px solid #e8eef8;
    margin-top: 8px;
}

.tender-description h3, .tender-requirements h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 8px;
}

.description-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.65;
}

/* AI Scores */
.ai-scores-card { padding: 20px; }
.scores-row { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }

.score-circle { position: relative; width: 100px; height: 100px; }
.score-circle svg { position: absolute; top: 0; left: 0; }

.circle-track    { fill: none; stroke: #e5e7eb; stroke-width: 8; }
.circle-progress { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }

.circle-high .circle-progress { stroke: #22c55e; }
.circle-mid  .circle-progress { stroke: #f59e0b; }
.circle-low  .circle-progress { stroke: #ef4444; }

.circle-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.circle-value { font-size: 22px; font-weight: 700; color: #111827; line-height: 1; }
.circle-name  { font-size: 10px; color: #6b7280; text-transform: uppercase; margin-top: 2px; }

.ai-summary { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e8eef8; }
.ai-summary h4 { font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 6px; }
.ai-summary p  { font-size: 13px; color: #4b5563; line-height: 1.55; margin: 0; }

/* Risk card */
.risk-card { padding: 16px 20px; }
.risk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.risk-item { display: flex; align-items: center; gap: 10px; }
.risk-factor-name { font-size: 12px; color: #6b7280; width: 110px; flex-shrink: 0; }
.risk-factor-bar  { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.risk-fill        { height: 100%; background: #ef4444; border-radius: 3px; }
.risk-factor-val  { font-size: 12px; font-weight: 600; color: #374151; width: 26px; text-align: right; }

/* Priority */
.priority-card { padding: 16px 20px; }
.priority-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
}
.priority-high   { background: #dcfce7; color: #166534; }
.priority-medium { background: #fef9c3; color: #92400e; }
.priority-low    { background: #fee2e2; color: #991b1b; }

/* Similar */
.similar-list { list-style: none; padding: 16px 20px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.similar-list li { display: flex; justify-content: space-between; align-items: center; }
.similar-list a { font-size: 13px; color: #374151; }
.similar-list a:hover { color: var(--brand-color); }
.similarity-score { font-size: 11px; color: #9ca3af; white-space: nowrap; }

/* ── Reports ────────────────────────────────────────────────── */
.report-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.category-breakdown { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.cat-row { display: flex; align-items: center; gap: 10px; }
.cat-bar { flex: 1; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 4px; }
.cat-fill.cat-sn       { background: #3b82f6; }
.cat-fill.cat-nn       { background: #22c55e; }
.cat-fill.cat-mixed    { background: #f59e0b; }
.cat-fill.cat-lighting { background: #8b5cf6; }
.cat-fill.cat-other    { background: #9ca3af; }
.cat-count, .cat-pct   { font-size: 12px; color: #6b7280; width: 30px; text-align: right; }

/* ── Login page – split layout ──────────────────────────────── */
.navicom-login-page {
    margin: 0;
    padding: 0;
    background: #fff;
    min-height: 100vh;
}

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

/* ── Lewa: panel marki ──────────────────────────────────────── */
.login-brand {
    flex: 0 0 42%;
    background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 45%, #1e40af 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 52px;
    position: relative;
    overflow: hidden;
}
.login-brand::before {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}
.login-brand::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -100px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}

.login-brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 56px;
    position: relative;
    z-index: 1;
}
.login-brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.2px;
}

.login-brand-tagline {
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin: 0 0 16px;
    position: relative;
    z-index: 1;
}
.login-brand-desc {
    font-size: 14px;
    color: rgba(255,255,255,.6);
    line-height: 1.65;
    margin: 0 0 44px;
    position: relative;
    z-index: 1;
}

.login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    z-index: 1;
}
.login-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,.85);
    font-size: 13.5px;
    line-height: 1.4;
}
.login-feature-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-brand-footer {
    margin-top: 56px;
    font-size: 12px;
    color: rgba(255,255,255,.3);
    position: relative;
    z-index: 1;
}

/* ── Prawa: panel formularza ────────────────────────────────── */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 64px;
    background: #fff;
}
.login-form-wrap {
    width: 100%;
    max-width: 360px;
}

.login-form-header { margin-bottom: 36px; }
.login-form-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}
.login-form-sub {
    font-size: 13.5px;
    color: #6b7280;
    margin: 0;
}

/* Alert */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    font-size: 13px;
    margin-bottom: 22px;
    line-height: 1.5;
}

/* Pola formularza */
.login-field { margin-bottom: 22px; }
.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    letter-spacing: .01em;
}
.login-input-wrap { position: relative; }
.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    display: flex;
    align-items: center;
}
.login-input {
    width: 100%;
    padding: 11px 14px 11px 44px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    background: #f0f5fc;
    transition: border-color .15s, box-shadow .15s, background .15s;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.login-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.login-input::placeholder { color: #d1d5db; }

/* Przycisk */
.login-submit-btn {
    width: 100%;
    padding: 13px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s, transform .1s, box-shadow .15s;
    margin-top: 6px;
    letter-spacing: .01em;
    box-shadow: 0 1px 3px rgba(59,130,246,.35);
}
.login-submit-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59,130,246,.4);
}
.login-submit-btn:active { transform: scale(.99); }
.login-submit-btn:disabled { background: #93c5fd; cursor: not-allowed; box-shadow: none; }

.login-form-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 900px) {
    .login-brand { flex: 0 0 38%; padding: 48px 36px; }
    .login-form-panel { padding: 32px 40px; }
    .login-brand-tagline { font-size: 24px; }
}
@media (max-width: 640px) {
    .login-brand { display: none; }
    .login-form-panel { padding: 40px 24px; }
    .login-form-wrap { max-width: 100%; }
}

/* ── Karty kategorii (dashboard rząd 2) ─────────────────────── */
.stats-grid-categories {
    margin-top: 12px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.stat-card-sn      { border-left: 3px solid #2271b1; background: #f0f6fc; }
.stat-card-nn      { border-left: 3px solid #00ba37; background: #f0fbf4; }
.stat-card-mixed   { border-left: 3px solid #9b59b6; background: #f9f0fd; }
.stat-card-lighting { border-left: 3px solid #f0b429; background: #fefdf0; }

/* ── Badge numeru postępowania ──────────────────────────────── */
.td-code {
    display: inline-block;
    font-size: 10px;
    color: #0073aa;
    background: #e8f3fb;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: monospace;
    letter-spacing: .02em;
    margin-top: 2px;
}

/* tender detail – badge numeru w nagłówku */
.tender-id-badge {
    display: inline-block;
    font-size: 11px;
    color: #0073aa;
    background: #e8f3fb;
    border: 1px solid #b3d4e8;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: monospace;
    vertical-align: middle;
}

.tender-card-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* ── Tabela kompaktowa (kody, dokumenty) ────────────────────── */
.data-table-compact th,
.data-table-compact td {
    padding: 6px 10px;
    font-size: 13px;
}

/* ── Helpers ────────────────────────────────────────────────── */
.text-danger  { color: #ef4444; }
.text-warning { color: #f59e0b; }
.text-success { color: #22c55e; }
.text-muted   { color: #9ca3af; }

/* ── MIXED kategoria badge ──────────────────────────────────── */
.cat-mixed { background: #fef3c7; color: #92400e; }

/* ── Scraper badges (PGE / eZamowienia) ─────────────────────── */
.scraper-badge-pge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 9px;
    white-space: nowrap;
    letter-spacing: .3px;
}
.scraper-badge-ez {
    background: #dcfce7;
    color: #166534;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 9px;
    white-space: nowrap;
    letter-spacing: .3px;
}

/* ── Stat card – wariant z border-left (platformy) ──────────── */
.stat-card-platform {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
}

/* ── Analiza AI – priority badge (rozszerzony) ──────────────── */
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-sm   { font-size: 10px; padding: 1px 6px; }

/* ── Stat card hover efekt ───────────────────────────────────── */
.stat-card {
    transition: box-shadow .15s;
}
.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ── Tabela analysis – progress bar inline ──────────────────── */
.analysis-bar-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
}
.analysis-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}
.analysis-bar-fill-high   { height: 100%; background: #22c55e; border-radius: 2px; }
.analysis-bar-fill-medium { height: 100%; background: #f59e0b; border-radius: 2px; }
.analysis-bar-fill-low    { height: 100%; background: #ef4444; border-radius: 2px; }

/* ── Scraper info card ───────────────────────────────────────── */
.scraper-info-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 20px;
}
.scraper-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #374151;
}

/* ── Monitor pracy (page-monitor.php) ──────────────────────── */

.page-monitor { padding: 1.5rem; }

.monitor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.monitor-toolbar .page-title { margin: 0; font-size: 1.4rem; }
.page-subtitle { margin: 4px 0 0; color: #6b7280; font-size: 0.85rem; }

.monitor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.monitor-card {
    background: var(--card-bg, #1e2433);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border, #2a3045);
    color: var(--text, #e0e6f0);
}
.monitor-card h3 {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #8892a4);
}
.monitor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.monitor-card-header h3 { margin: 0; }

.monitor-run-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.dot-ok      { background: #22c55e; box-shadow: 0 0 6px #22c55e80; }
.dot-warn    { background: #f59e0b; box-shadow: 0 0 6px #f59e0b80; }
.dot-error   { background: #ef4444; box-shadow: 0 0 6px #ef444480; }
.dot-idle    { background: #6b7280; }

/* Queue table */
.queue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: var(--text, #e0e6f0);
}
.queue-table th,
.queue-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border, #2a3045);
    text-align: left;
}
.queue-table th { color: var(--text-muted, #8892a4); font-weight: 500; }
.queue-summary  { margin-bottom: 0.75rem; font-size: 0.85rem; }
.td-monitor-event { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sources list */
.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #2a3045);
    font-size: 0.85rem;
    color: var(--text, #e0e6f0);
}
.source-item:last-child { border-bottom: none; }
.source-meta { color: var(--text-muted, #8892a4); font-size: 0.78rem; }

/* Live log */
.live-log {
    background: #0d1117;
    border: 1px solid #2a3045;
    border-radius: 6px;
    padding: 0.75rem;
    height: 280px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}
.log-info    { color: #22c55e; }
.log-warning { color: #f59e0b; }
.log-error   { color: #ef4444; }
.log-debug   { color: #6b7280; }

/* Run buttons */
.run-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border, #2a3045);
    background: var(--card-bg, #1e2433);
    color: var(--text, #e0e6f0);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.run-btn svg { width: 14px; height: 14px; }
.run-btn:hover:not(:disabled) {
    background: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
}
.run-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Run output */
.run-output { display: none; margin-top: 0.75rem; padding: 0.75rem; background: #0d1117; border-radius: 6px; font-family: monospace; font-size: 0.78rem; color: #e0e6f0; }
.run-output--visible { display: block; }

/* Refresh indicator */
.refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #6b7280;
}
.refresh-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: monitor-blink 2s infinite;
}
@keyframes monitor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Monitor badge overrides (dark bg) */
.monitor-card .badge-pending    { background: #3b4a6b; color: #93b4ff; }
.monitor-card .badge-processing { background: #3b4620; color: #86efac; }
.monitor-card .badge-done       { background: #1f3b28; color: #6ee7b7; }
.monitor-card .badge-failed     { background: #3b1f1f; color: #fca5a5; }
.monitor-card .badge-running    { background: #3b3420; color: #fde68a; }
.monitor-card .badge-success    { background: #1e3a2b; color: #6ee7b7; }
.monitor-card .badge-error      { background: #3b1f1f; color: #fca5a5; }

/* ── Hamburger button ───────────────────────────────────────── */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    margin-left: 4px;
    flex-shrink: 0;
    transition: background .15s;
}
.mobile-nav-toggle:hover { background: #e3edfa; }
.mobile-nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: transform .25s, opacity .2s;
    transform-origin: center;
}
.mobile-nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav overlay ─────────────────────────────────────── */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 99;
    background: rgba(0,0,0,.3);
    backdrop-filter: blur(2px);
}
.mobile-nav-overlay.open { display: block; }

.mobile-nav-drawer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #f6f9ff;
    border-bottom: 1px solid #cddaee;
    box-shadow: 0 4px 16px rgba(37,99,235,.10);
    padding: 8px 0 12px;
    display: flex;
    flex-direction: column;
}
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border: none;
    transition: background .12s, color .12s;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: #eff6ff;
    color: var(--brand-color);
    text-decoration: none;
}
.mobile-nav-link svg { flex-shrink: 0; color: currentColor; }
.mobile-nav-divider { height: 1px; background: #cddaee; margin: 8px 20px; }
.mobile-nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 6px;
}
.mobile-nav-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--brand-color);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.mobile-nav-username { font-size: 13px; font-weight: 600; color: #111827; }
.mobile-nav-role    { font-size: 11px; color: #6b7280; text-transform: capitalize; }
.mobile-nav-logout  { color: #dc2626 !important; }
.mobile-nav-logout:hover { background: #fef2f2 !important; color: #991b1b !important; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topbar-nav { display: none; }
    .mobile-nav-toggle { display: flex; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-select { width: 100%; }
    .monitor-grid { grid-template-columns: 1fr; }
    .monitor-toolbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    /* Tender detail na mobile */
    .nv-layout { grid-template-columns: 1fr !important; }
    .tender-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .scores-row { flex-direction: column; align-items: center; }
    /* Tabele przetargów - poziomy scroll */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    /* Ukryj mniej ważne kolumny */
    .data-table .col-hide-xs { display: none; }
    /* Karty scraperów - jedna kolumna */
    .page-tenders .stat-card-grid { grid-template-columns: 1fr !important; }
}

/* ── WP .button klasy na froncie (brak admin CSS) ───────────── */
.navicom-app .button,
.navicom-app a.button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
    transition: background .12s, border-color .12s;
}
.navicom-app .button:hover,
.navicom-app a.button:hover {
    background: #f0f5fc;
    border-color: #93c5fd;
    color: #1d4ed8;
    text-decoration: none;
}
.navicom-app .button-primary,
.navicom-app a.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}
.navicom-app .button-primary:hover,
.navicom-app a.button-primary:hover {
    background: #1a5a99;
    border-color: #1a5a99;
    color: #fff;
}
.navicom-app .button-small,
.navicom-app a.button-small {
    padding: 3px 8px;
    font-size: 11px;
}

/* ============================================================
   DARK MODE  [data-theme="dark"]
   Palette: Light Slate-Blue 65%  ·  Navicom
   ============================================================ */

[data-theme="dark"] {
    --th-bg:           #b4bac1;
    --th-surface:      #bfc8d1;
    --th-surface-2:    #b2b9c9;
    --th-border:       #8698a8;
    --th-border-light: #9aaab8;
    --th-text:         #1c2b3a;
    --th-text-muted:   #4a6278;
    --th-text-faint:   #6a8a9a;
    --th-primary:      #1a68b0;
    --th-hover:        #a8b4be;
}

[data-theme="dark"] body,
[data-theme="dark"] .navicom-app {
    background: linear-gradient(150deg, #b4bac1 0%, #b8c4d0 50%, #bcc8d6 100%);
    background-attachment: fixed;
    color: #1c2b3a;
}

/* Topbar */
[data-theme="dark"] .topbar {
    background: #bfc8d1;
    border-bottom-color: #8698a8;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
[data-theme="dark"] .brand-link,
[data-theme="dark"] .brand-link:hover { color: #162030; }
[data-theme="dark"] .nav-link { color: #4a6278; }
[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active { background: #a8b4be; color: #1c2b3a; text-decoration: none; }
[data-theme="dark"] .mobile-nav-toggle span { background: #4a6278; }
[data-theme="dark"] .mobile-nav-drawer { background: #bfc8d1; border-bottom-color: #8698a8; }
[data-theme="dark"] .mobile-nav-link { color: #4a6278; }
[data-theme="dark"] .mobile-nav-link:hover,
[data-theme="dark"] .mobile-nav-link.active { background: #a8b4be; color: #1c2b3a; }
[data-theme="dark"] .mobile-nav-divider { background: #8698a8; }
[data-theme="dark"] .mobile-nav-username { color: #162030; }
[data-theme="dark"] .notif-btn { color: #4a6278; }
[data-theme="dark"] .notif-btn:hover { background: #a8b4be; color: #1c2b3a; }

/* Notification panel */
[data-theme="dark"] .notif-panel {
    background: #bfc8d1;
    border-color: #8698a8;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
[data-theme="dark"] .notif-panel-header { border-bottom-color: #8698a8; }
[data-theme="dark"] .notif-panel-header strong { color: #162030; }
[data-theme="dark"] .notif-panel-close { color: #4a6278; }
[data-theme="dark"] .notif-item { border-bottom-color: #9aaab8; }
[data-theme="dark"] .notif-item:hover { background: #a8b4be; }
[data-theme="dark"] .notif-item.unread { background: #b0bcc8; }
[data-theme="dark"] .notif-item.unread:hover { background: #a4b0bc; }
[data-theme="dark"] .notif-title { color: #162030; }
[data-theme="dark"] .notif-body { color: #4a6278; }
[data-theme="dark"] .notif-time { color: #6a8a9a; }
[data-theme="dark"] .notif-empty { color: #6a8a9a; }

/* User dropdown */
[data-theme="dark"] .user-dropdown {
    background: #bfc8d1;
    border-color: #8698a8;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
[data-theme="dark"] .user-dropdown-header { border-bottom-color: #9aaab8; }
[data-theme="dark"] .user-dropdown-header strong { color: #162030; }
[data-theme="dark"] .user-dropdown-header small { color: #4a6278; }
[data-theme="dark"] .dropdown-item { color: #2a3e52; background: none; border: none; }
[data-theme="dark"] .dropdown-item:hover { background: #a8b4be; color: #162030; text-decoration: none; }
[data-theme="dark"] .dropdown-logout { color: #c52828; }
[data-theme="dark"] .dropdown-logout:hover { background: #f0cece; color: #a01e1e; }

/* Footer */
[data-theme="dark"] .site-footer { background: #bfc8d1; border-top-color: #8698a8; }
[data-theme="dark"] .footer-inner { color: #6a8a9a; }
[data-theme="dark"] .footer-sep { color: #8698a8; }

/* Main content – transparent so body gradient shows through */
[data-theme="dark"] .main-content { background: transparent; }

/* Cards */
[data-theme="dark"] .card { background: #bfc8d1; border-color: #8698a8; }
[data-theme="dark"] .card-header { border-bottom-color: #9aaab8; }
[data-theme="dark"] .card-title { color: #162030; }

/* Forms */
[data-theme="dark"] .form-control {
    background: #b4bac1;
    border-color: #8698a8;
    color: #1c2b3a;
}
[data-theme="dark"] .form-control:focus {
    border-color: #1a68b0;
    box-shadow: 0 0 0 3px rgba(26,104,176,.15);
}
[data-theme="dark"] .form-control::placeholder { color: #6a8a9a; }
[data-theme="dark"] .form-group label { color: #2a3e52; }

/* Buttons */
[data-theme="dark"] .btn-outline {
    background: transparent;
    color: #2a3e52;
    border-color: #8698a8;
}
[data-theme="dark"] .btn-outline:hover { background: #a8b4be; color: #162030; text-decoration: none; }

/* Stat cards */
[data-theme="dark"] .stat-card { background: #bfc8d1; border-color: #8698a8; }
[data-theme="dark"] .stat-value { color: #162030; }
[data-theme="dark"] .stat-label { color: #4a6278; }
[data-theme="dark"] .stat-icon--blue   { background: #d0e0f0; color: #1a5090; }
[data-theme="dark"] .stat-icon--green  { background: #d0eedc; color: #1a7848; }
[data-theme="dark"] .stat-icon--orange { background: #f0e0c8; color: #8a5000; }
[data-theme="dark"] .stat-icon--red    { background: #f0d0c8; color: #c52828; }
[data-theme="dark"] .stat-icon--purple { background: #ddd0ee; color: #5a30a0; }

/* Page headers */
[data-theme="dark"] .page-title { color: #162030; }
[data-theme="dark"] .page-count { color: #4a6278; }

/* Filters */
[data-theme="dark"] .filter-search-icon { color: #6a8a9a; }

/* Tables */
[data-theme="dark"] .data-table th {
    background: #b0bac4;
    color: #4a6278;
    border-bottom-color: #8698a8;
}
[data-theme="dark"] .data-table td { border-bottom-color: #9aaab8; }
[data-theme="dark"] .data-table tbody tr:hover td,
[data-theme="dark"] .table-row-link:hover td { background: #a8b4be; }
[data-theme="dark"] .data-table tbody tr:last-child td { border-bottom: none; }
[data-theme="dark"] .td-title a { color: #162030; }
[data-theme="dark"] .td-empty { color: #6a8a9a; }
[data-theme="dark"] .sort-link { color: #4a6278; }
[data-theme="dark"] .sort-link:hover { color: #1a68b0; }

/* Badges */
[data-theme="dark"] .badge-success   { background: #d4eed8; color: #1a7848; }
[data-theme="dark"] .badge-secondary { background: #c8d4e0; color: #4a6278; }
[data-theme="dark"] .badge-danger    { background: #f0cece; color: #c52828; }
[data-theme="dark"] .badge-warning   { background: #f0e4b8; color: #8a5e00; }
[data-theme="dark"] .cat-sn          { background: #d0e0f0; color: #1a5090; }
[data-theme="dark"] .cat-nn          { background: #d4eed8; color: #1a7848; }
[data-theme="dark"] .cat-mixed       { background: #f0e4b8; color: #8a5e00; }
[data-theme="dark"] .cat-lighting    { background: #ddd0f0; color: #5030a0; }
[data-theme="dark"] .cat-other       { background: #c8d4e0; color: #4a6278; }

/* Score */
[data-theme="dark"] .score-high { background: #d4eed8; color: #1a7848; }
[data-theme="dark"] .score-mid  { background: #f0e4b8; color: #8a5e00; }
[data-theme="dark"] .score-low  { background: #f0cece; color: #c52828; }
[data-theme="dark"] .score-bar { background: #c0cdd8; }

/* Pagination */
[data-theme="dark"] .page-btn { background: #bfc8d1; border-color: #8698a8; color: #2a3e52; }
[data-theme="dark"] .page-btn:hover:not(.active) { background: #a8b4be; text-decoration: none; }
[data-theme="dark"] .page-btn.active { background: #1a68b0; border-color: #1a68b0; color: #fff; }
[data-theme="dark"] .page-info { color: #4a6278; }

/* Breadcrumb */
[data-theme="dark"] .breadcrumb { color: #4a6278; }
[data-theme="dark"] .breadcrumb a { color: #1a68b0; }
[data-theme="dark"] .breadcrumb-sep { color: #8698a8; }

/* Tender detail */
[data-theme="dark"] .tender-title { color: #162030; }
[data-theme="dark"] .tender-meta dt { color: #4a6278; }
[data-theme="dark"] .tender-meta dd { color: #1c2b3a; }
[data-theme="dark"] .tender-description,
[data-theme="dark"] .tender-requirements { border-top-color: #9aaab8; }
[data-theme="dark"] .tender-description h3,
[data-theme="dark"] .tender-requirements h3 { color: #2a3e52; }
[data-theme="dark"] .description-text { color: #3a5468; }
[data-theme="dark"] .ai-summary { border-top-color: #9aaab8; }
[data-theme="dark"] .ai-summary h4 { color: #2a3e52; }
[data-theme="dark"] .ai-summary p  { color: #3a5468; }
[data-theme="dark"] .circle-track  { stroke: #c0cdd8; }
[data-theme="dark"] .circle-value  { color: #162030; }
[data-theme="dark"] .circle-name   { color: #4a6278; }
[data-theme="dark"] .risk-factor-name { color: #4a6278; }
[data-theme="dark"] .risk-factor-bar  { background: #c0cdd8; }
[data-theme="dark"] .risk-factor-val  { color: #2a3e52; }
[data-theme="dark"] .similar-list a   { color: #2a3e52; }
[data-theme="dark"] .similar-list a:hover { color: #1a68b0; }
[data-theme="dark"] .similarity-score { color: #6a8a9a; }
[data-theme="dark"] .priority-high   { background: #d4eed8; color: #1a7848; }
[data-theme="dark"] .priority-medium { background: #f0e4b8; color: #8a5e00; }
[data-theme="dark"] .priority-low    { background: #f0cece; color: #c52828; }

/* Chart */
[data-theme="dark"] .cat-bar { background: #c0cdd8; }
[data-theme="dark"] .chart-wrapper { background: transparent; }

/* Toast */
[data-theme="dark"] .toast         { background: #bfc8d1; border: 1px solid #8698a8; }
[data-theme="dark"] .toast-success { background: #d4eed8; }
[data-theme="dark"] .toast-error   { background: #f0cece; }
[data-theme="dark"] .toast-warning { background: #f0e4b8; }

/* Login – form side lightened to match palette */
[data-theme="dark"] .login-form-side { background: #b4bac1; }

/* General links in dark mode */
[data-theme="dark"] a { color: #1a68b0; }
[data-theme="dark"] a:hover { color: #1258a0; }

/* ── Theme toggle button ───────────────────────────────────── */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 6px;
    border-radius: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.theme-toggle:hover { background: #e8eef8; color: #374151; }
[data-theme="dark"] .theme-toggle { color: #4a6278; }
[data-theme="dark"] .theme-toggle:hover { background: #a8b4be; color: #1c2b3a; }

/* Icon visibility: moon shown in light, sun shown in dark */
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── LLM card (frontend sidebar) ──────────────────────────────────────── */
.nv-llm-fe-card .card-header { padding: 12px 16px 10px; border-bottom: 1px solid #f0f2f5; }
.nv-btn-llm-analyze {
    background: #8e44ad;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
}
.nv-btn-llm-analyze:hover { background: #7d3c98; }
.nv-btn-llm-analyze:disabled { background: #b8a2cc; cursor: default; }
[data-theme="dark"] .nv-btn-llm-analyze { background: #6c3483; }
[data-theme="dark"] .nv-btn-llm-analyze:hover { background: #7d3c98; }

/* ── Chat widget (floating, position:fixed) ───────────────────────────── */
.nv-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: inherit;
}
.nv-chat-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #8e44ad;
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
}
.nv-chat-toggle:hover { background: #7d3c98; transform: scale(1.06); }
.nv-chat-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 340px;
    max-height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.nv-chat-header {
    background: #8e44ad;
    color: #fff;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nv-chat-header span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-chat-recent-btn, .nv-chat-close {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.nv-chat-recent-btn:hover, .nv-chat-close:hover { background: rgba(255,255,255,.32); }
.nv-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 120px;
    max-height: 280px;
}
.nv-chat-msg {
    max-width: 85%;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}
.nv-chat-user {
    align-self: flex-end;
    background: #8e44ad;
    color: #fff;
    border-bottom-right-radius: 3px;
}
.nv-chat-assistant {
    align-self: flex-start;
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 3px;
}
.nv-chat-recent-panel {
    padding: 6px 10px;
    font-size: 12px;
    border-top: 1px solid #e5e7eb;
    max-height: 150px;
    overflow-y: auto;
    background: #fafafa;
}
.nv-chat-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
}
.nv-chat-input-row input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
}
.nv-chat-input-row input:focus { border-color: #8e44ad; }
.nv-chat-input-row button {
    background: #8e44ad;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.nv-chat-input-row button:hover { background: #7d3c98; }

/* Dark mode – chat widget */
[data-theme="dark"] .nv-chat-panel { background: #c0c9d2; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
[data-theme="dark"] .nv-chat-assistant { background: #a8b8c8; color: #1c2b3a; }
[data-theme="dark"] .nv-chat-recent-panel { background: #b8c4cc; border-color: #8698a8; }
[data-theme="dark"] .nv-chat-input-row { border-color: #8698a8; }
[data-theme="dark"] .nv-chat-input-row input { background: #b4bac1; border-color: #8698a8; color: #1c2b3a; }
[data-theme="dark"] .nv-chat-input-row input:focus { border-color: #8e44ad; }
