/*
 * apple-minimal.css - styl Apple-like dla Wyszukaj Naukowca v0.4 (Excel-style)
 * Standard weSEQ.IT (feedback_apple_minimal_theme.md)
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* FIX v20: lapka na linkach (browser default czasem nie dziala w iframe BX24) */
a[href] {
    cursor: pointer;
}
a[href]:hover {
    text-decoration: underline !important;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #e8ecf2;
    --bg-tertiary: #fafafa;
    --bg-row: #f4f7fb;
    --bg-row-hover: #f0f0f3;
    --bg-row-sub: #f5f8fc;
    --text-primary: #1b2532;
    --text-secondary: #515154;
    --text-tertiary: #788596;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #e8f1ff;
    --success: #157f50;
    --warning: #b97700;
    --error: #d23b34;
    --border: #c4cedb;
    --border-light: #e5e5e7;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 20px;
    min-height: 100vh;
}

.app-shell {
    max-width: 1400px;
    margin: 0 auto;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.app-header h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.4px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-count {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* === Polecajacy === */

.recommender-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.meta-row {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.inst-row {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
}

.meta-label {
    min-width: 200px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.meta-row span:not(.meta-label) {
    color: var(--text-primary);
    font-family: "SF Mono", Menlo, monospace;
    font-size: 12px;
}

.recommender-grid select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    background: white;
    font-family: inherit;
}

/* === Header tabeli polecen === */

.rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rec-header h2 {
    margin: 0;
}

/* === Excel-style tabela polecen === */

.rec-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    table-layout: fixed;
}

.rec-table thead th {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border);
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-tertiary);
    text-align: center;       /* wsrodkowanie naglowkow */
    white-space: normal;       /* zeby <br> dzialalo */
    line-height: 1.2;
    vertical-align: middle;
}

/* Zebra - co drugi wiersz lekko szary */
.rec-row.row-even td {
    background: #f9f9fb;
}

.rec-row.row-even:hover td {
    background: var(--bg-row-hover);
}

.rec-table tbody td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    vertical-align: middle;
    background: white;
}

.rec-table tbody td:last-child {
    border-right: none;
}

.rec-table .rec-row:hover td {
    background: var(--bg-row-hover);
}

/* Wymiary kolumn (jak w Excelu - stale) */
.col-num      { width: 36px;  text-align: center; }
.col-tytul    { width: 90px; }
.col-imie     { width: 120px; }
.col-pewien   { width: 60px;  text-align: center; }
.col-nazwisko { width: 140px; position: relative; }
.col-email    { width: 180px; }
.col-telefon  { width: 110px; }
.col-internal { width: 70px; }
.col-same     { width: 70px;  text-align: center; }
.col-akcja    { width: 160px; text-align: center; white-space: nowrap; }

.row-number {
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 12px;
}

/* === Pola formularza w komorce tabeli === */

.rec-table input[type="text"],
.rec-table input[type="email"],
.rec-table input[type="tel"],
.rec-table input[type="number"],
.rec-table select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 13px;
    background: transparent;
    transition: all 0.1s;
    font-family: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.rec-table input[type="text"]:hover,
.rec-table input[type="email"]:hover,
.rec-table input[type="tel"]:hover,
.rec-table select:hover {
    background: white;
    border-color: var(--border-light);
}

.rec-table input[type="text"]:focus,
.rec-table input[type="email"]:focus,
.rec-table input[type="tel"]:focus,
.rec-table select:focus {
    outline: none;
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Email zasugerowany - wizualnie inny kolor zeby user wiedzial */
.rec-table input.email-suggested {
    color: var(--text-tertiary);
    font-style: italic;
}

.rec-table input.email-suggested:focus {
    color: var(--text-primary);
    font-style: normal;
}

.rec-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

/* === Autocomplete dropdown w komorce === */

.autocomplete-wrap {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: -2px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 2px;
    min-width: 420px;
    max-width: 640px;
    width: max-content;
}

/* Dropdown w top-layer nie jest przycinany przez tabele z overflow-x:auto/hidden. */
.autocomplete-dropdown.autocomplete-top-layer,
.autocomplete-dropdown:popover-open {
    z-index: 2147483000 !important;
    box-sizing: border-box;
}

.autocomplete-item {
    padding: 8px 14px 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-right: 60px;
}

.autocomplete-item .ac-count {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-tertiary);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--accent-light);
}

.autocomplete-item small {
    color: var(--text-tertiary);
}

.autocomplete-empty {
    padding: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* === Buttons === */

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-link {
    background: transparent;
    color: var(--accent);
    border: none;
    font-size: 13px;
    padding: 0;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 3px;
    transition: background 0.1s;
}

.btn-icon:hover {
    background: var(--accent-light);
}

.btn-icon.btn-delete:hover {
    background: rgba(210, 59, 52, 0.15);
}

/* Przycisk "Wyszukaj" z widocznym napisem (2026-06-08): glowna akcja wiersza, ma sie
   wyraznie wyrozniac wsrod ikon (user nie widzial samej lupy - incydent Anna Pawlik). */
.btn-icon.btn-search {
    color: var(--accent, #2563eb);
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 6px;
    padding: 4px 10px;
    margin-right: 4px;
}

.btn-icon.btn-search:hover {
    background: rgba(37, 99, 235, 0.15);
}

.btn-icon.btn-comment.active {
    background: var(--accent-light);
}

.btn-icon:disabled {
    opacity: 0.4;
    cursor: wait;
}

.btn-add-row {
    margin-top: 12px;
    width: 100%;
    text-align: center;
}

/* === Sub-rows (komentarz, wyniki) === */

.rec-sub-row td {
    background: var(--bg-row-sub) !important;
    padding: 16px 20px !important;
    border-right: none !important;
}

/* Grid komentarz (2/3) + szczegoly (1/3) - pelna szerokosc tabeli */
.rec-comment-row .comment-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;   /* 2/3 + 1/3 */
    gap: 16px;
}

.rec-comment-row .form-field {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rec-comment-row label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rec-comment-row .char-counter {
    margin-left: auto;
    font-size: 10px;
    font-weight: normal;
    color: var(--text-tertiary);
    text-transform: none;
    letter-spacing: 0;
}

.rec-comment-row .hint-important {
    font-size: 11px;
    font-weight: normal;
    color: var(--accent);
    text-transform: none;
    letter-spacing: 0;
    font-style: italic;
}

.rec-comment-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    line-height: 1.5;
    min-height: 70px;
}

.rec-comment-row .comment-field-details textarea {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.05);
    background: linear-gradient(180deg, #f5faff 0%, white 30%);
    /* Ta sama wysokosc co komentarz */
}

.rec-comment-row textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.4;
    font-style: italic;
}

.row-attribution {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* === Warnings === */

.warnings-box {
    background: #fff8e1;
    border: 1px solid #ffd60a;
    border-radius: 4px;
    padding: 8px 10px;
    margin: 4px 0;
}

.warning {
    font-size: 12px;
    color: #856404;
    padding: 2px 0;
}

/* === Wyniki search === */

.results-summary {
    padding: 6px 10px;
    background: var(--accent-light);
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.results-table th {
    text-align: left;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.results-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.results-table tr:hover {
    background: var(--bg-tertiary);
}

.score {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 11px;
}

.score-high {
    background: #d4edda;
    color: #155724;
}

.score-mid {
    background: #fff3cd;
    color: #856404;
}

.score-low {
    background: #f8d7da;
    color: #721c24;
}

/* Status badge w wynikach - 'czy juz w Twoim B24' */

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: help;
}

.status-in-crm {
    background: #d1f4dd;
    color: #155724;
    border: 1px solid #157f50;
}

.status-radon {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #2563eb;
}

.status-manual {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #b97700;
}

.status-seed {
    background: #e8ecf2;
    color: #515154;
    border: 1px solid #c4cedb;
}

.status-other {
    background: #e8ecf2;
    color: #515154;
    border: 1px solid #c4cedb;
}

.badge-small {
    display: inline-block;
    padding: 1px 5px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    font-size: 9px;
    color: var(--text-secondary);
    margin-right: 2px;
    font-family: "SF Mono", Menlo, monospace;
}

.results-empty {
    padding: 12px;
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
}

/* === Code === */

code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 12px;
}

ul {
    padding-left: 24px;
    margin-top: 8px;
}

ul li {
    margin-bottom: 4px;
}

/* === Checkbox label === */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

/* === Autosave indicator === */

.autosave-indicator {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* === Sieć poleceń (mermaid graph) === */

#network-graph {
    overflow-x: auto;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    text-align: center;
}

#network-graph svg {
    max-width: 100%;
    height: auto;
}

.info-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* === Footer === */

.app-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
}

.app-footer a {
    color: var(--accent);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* === Responsywnosc === */

/* === Zapisane polecenia (saved recommendations) === */

.saved-recs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.saved-recs-table th {
    text-align: left;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.saved-recs-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
    color: var(--text-primary, #1d1d1f);
}

.saved-recs-table a {
    color: #0057d9;
    font-weight: 600;
}

.saved-rec-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 150px;
}

.saved-recs-table tr:hover {
    background: var(--bg-tertiary);
}

#trash-details summary.trash-toggle {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    list-style: none;
    user-select: none;
}

#trash-details summary.trash-toggle::-webkit-details-marker {
    display: none;
}

#trash-details summary.trash-toggle::before {
    content: "▶ ";
    color: var(--text-tertiary);
    font-size: 10px;
}

#trash-details[open] summary.trash-toggle::before {
    content: "▼ ";
}

#trash-details[open] summary.trash-toggle {
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.btn-icon.btn-restore {
    color: var(--accent);
}

.btn-icon.btn-soft-delete:hover {
    background: rgba(210, 59, 52, 0.15);
}

/* === POMOC - SAMOUCZEK (collapsible) === */

.help-section {
    margin-top: 32px;
    margin-bottom: 16px;
}

.help-section[open] {
    margin-top: 16px;
}

.help-toggle-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #e8ecf2 0%, white 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
    transition: all 0.2s;
    font-size: 14px;
    user-select: none;
}

.help-toggle-btn::-webkit-details-marker {
    display: none;
}

.help-toggle-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.help-section[open] .help-toggle-btn {
    background: var(--accent-light);
    border-color: var(--accent);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.help-icon {
    font-size: 18px;
}

.help-label {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.help-hint {
    flex: 1;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 400;
}

.help-chevron {
    color: var(--accent);
    font-size: 12px;
    transition: transform 0.2s;
}

.help-section[open] .help-chevron {
    transform: rotate(180deg);
}

.help-content {
    border: 2px solid var(--accent);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 16px;
    background: white;
    margin-top: -2px;
}

.help-content .card {
    margin-bottom: 12px;
    box-shadow: none;
}

.help-content .card:last-child {
    margin-bottom: 0;
}

/* === "Jak dzialaja polecenia" - 2 boxy obok siebie === */

.how-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.how-box {
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.how-box-existing {
    background: linear-gradient(135deg, #f0faf3 0%, #ffffff 100%);
    border-color: #157f50;
}

.how-box-new {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    border-color: #2563eb;
}

.how-box h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.how-box p {
    margin-bottom: 8px;
    font-size: 13px;
}

.how-box ol, .how-box ul {
    font-size: 13px;
    margin: 8px 0 8px 20px;
    padding: 0;
}

.how-box ol li, .how-box ul li {
    margin-bottom: 4px;
}

.how-box em {
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-style: italic;
}

.how-summary {
    padding: 12px 16px;
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
}

.how-summary code {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
}

/* === Examples grid === */

.examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.example-box {
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    font-size: 13px;
}

.example-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 13px;
}

.example-box p {
    line-height: 1.6;
    color: var(--text-secondary);
}

.example-box code {
    font-size: 11px;
    padding: 1px 5px;
}

@media (max-width: 900px) {
    .how-grid, .examples-grid {
        grid-template-columns: 1fr;
    }
}

/* === Tooltip (chmurka) === */

.tooltip-trigger {
    position: relative;
    cursor: help;
}

.tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    padding: 8px 12px;
    background: #1b2532;
    color: white;
    font-size: 12px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    border-radius: 6px;
    white-space: normal;
    width: 280px;
    z-index: 10000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.tooltip-trigger:hover::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1px;
    border: 5px solid transparent;
    border-bottom-color: #1b2532;
    z-index: 10001;
}

/* === Banner declined === */

.declined-banner {
    margin-top: 12px;
    padding: 16px 20px;
    background: #fff5f5;
    border: 1px solid #d23b34;
    border-radius: var(--radius);
    color: #721c24;
    font-weight: 500;
    text-align: center;
}

/* Wiersz po dodaniu kontaktu - zielona obwódka */

.rec-row.row-resolved td {
    background: #f0faf3 !important;
    border-color: rgba(40, 205, 65, 0.3);
}

.rec-row.row-resolved td input,
.rec-row.row-resolved td select {
    color: var(--text-secondary);
}

.resolved-badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--success);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.resolved-badge small {
    font-family: "SF Mono", Menlo, monospace;
    font-size: 9px;
    opacity: 0.9;
    margin-left: 4px;
}

/* v19: pasek postepu po klik +Dodaj (non-blocking, kazdy wiersz ma swoj) */
.progress-cell {
    min-width: 140px;
    padding: 4px 0;
}
.progress-cell .progress-bar {
    width: 100%;
    height: 4px;
    background: var(--surface-secondary, #f2f2f7);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.progress-cell .progress-bar-fill {
    position: absolute;
    top: 0; left: -30%;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, transparent, var(--accent, #2563eb), transparent);
    animation: progress-indeterminate 1.4s ease-in-out infinite;
    border-radius: 2px;
}
@keyframes progress-indeterminate {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* Toast notyfikacje */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    background: #1b2532;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-size: 13px;
    transition: opacity 0.4s, transform 0.4s;
    max-width: 360px;
}

.toast-success {
    background: #157f50;
}

.toast-error {
    background: var(--error);
}

.toast-fade {
    opacity: 0;
    transform: translateX(40px);
}

@media (max-width: 1200px) {
    .col-email { width: 150px; }
    .col-telefon { width: 100px; }
    .col-imie { width: 100px; }
    .col-nazwisko { width: 130px; }
    .col-internal { width: 60px; }
}

@media (max-width: 900px) {
    .rec-table {
        font-size: 12px;
    }
    .rec-table thead th {
        font-size: 10px;
    }
}

/* FIX 2026-05-08 v14 (Gemini R11 Task 2): pasek Gemini Flash 2.5 quota na gorze. */
.gemini-quota-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    background: #f0f0f0;
    z-index: 99999;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: help;
}
.gemini-quota-fill {
    height: 100%;
    transition: width 0.5s ease, background-color 0.5s ease;
    opacity: 0.85;
}
.gemini-quota-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10px;
    line-height: 14px;
    color: #333;
    font-weight: 500;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
    white-space: nowrap;
    pointer-events: none;
}
.app-shell { padding-top: 14px; }


/* === weSEQ.IT slate polish (dopasowanie do skorki panelu Slate) === */
body.theme-apple-minimal { font-feature-settings: "cv01","cv03","ss01","calt","kern"; }
.theme-apple-minimal .btn-primary {
  background: linear-gradient(180deg, #3f7bf2 0%, #2563eb 100%) !important;
  box-shadow: 0 1px 2px rgba(37,99,235,.30), 0 8px 18px rgba(37,99,235,.26), inset 0 1px 0 rgba(255,255,255,.16) !important;
}
.theme-apple-minimal .btn-primary:hover { background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%) !important; }
.theme-apple-minimal *:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* === Polecenia: podzial list (fix 2026-06-09 per-osoba) + read-only sekcja w karcie kontaktu === */
.rec-split-head {
  font-size: 13px; font-weight: 600; color: var(--text-secondary, #4a5568);
  margin: 6px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border-color, #c4cedb);
}
.rec-split-head .badge-count { margin-left: 4px; }
.recs-ro-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.recs-ro-table th {
  text-align: left; padding: 6px 8px; font-weight: 600;
  color: var(--text-tertiary, #788596); border-bottom: 1px solid var(--border-color, #c4cedb);
}
.recs-ro-table td {
  padding: 6px 8px; vertical-align: top;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.recs-ro-empty { color: var(--text-tertiary, #788596); font-size: 12px; padding: 8px 0; margin: 0; }

/* ETAP 2: sekcja "Dodaj polecenie" w karcie kontaktu - spojnosc z rec-table / skorka panelu */
#add-rec-card .add-rec-sub td { background: var(--bg-row-sub, #f5f8fc) !important; padding: 12px 14px !important; }
#add-rec-card .add-rec-sub input[type="text"] {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; box-sizing: border-box; background: var(--bg-primary); color: var(--text-primary);
  transition: border-color 0.12s ease;
}
#add-rec-card .add-rec-sub input[type="text"]:focus { outline: none; border-color: var(--accent); }
#add-rec-card .add-rec-results { margin-top: 8px; }
#add-rec-card .add-rec-results .recs-ro-table td { vertical-align: middle; }
#add-rec-card .add-rec-results .btn-small { margin: 0; }
/* szerokosci kolumn dopasowane do UX (poprawki 2026-06-09): email +~10 znakow, telefon +3 cyfry,
   nazwisko +~4 znaki. Pozostale col-* dziedzicza z .rec-table. */
#add-rec-card .col-inst     { width: 150px; }
#add-rec-card .col-email    { width: 250px; }
#add-rec-card .col-telefon  { width: 135px; }
#add-rec-card .col-nazwisko { width: 170px; }
#add-rec-card .rec-table input[type="text"],
#add-rec-card .rec-table input[type="email"],
#add-rec-card .rec-table input[type="tel"],
#add-rec-card .rec-table select { box-sizing: border-box; }
/* sygnal ze naglowek ma tooltip (skroty - user nie wiedzial, ze jest podpowiedz): kropkowane
   podkreslenie + kursor help. Najedz, by zobaczyc pelny opis. */
#add-rec-card .rec-table th[title], .recs-ro-table th[title] {
  cursor: help; text-decoration: underline dotted; text-underline-offset: 3px;
  text-decoration-color: var(--text-tertiary);
}
#add-rec-card .col-pewien, #add-rec-card .col-same { width: 72px; }
