/* legacy.css — sidebar filtri (.chip), .client-row, .conv-*, .vis-tooltip, .ibadge. */
    /* Filtru čipi: aktīvais ir pildīts, pārējie ir caurspīdīgi.
       Saglabājam vienotu izmēru, lai pārslēgšanās nelēkātu. */
    .chip {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 3px 8px; border-radius: 9999px;
      font-size: 11px; font-weight: 600;
      border: 1px solid transparent;
      background: #f1f5f9; color: #475569;
      cursor: pointer; user-select: none;
      transition: background-color .15s, color .15s, border-color .15s;
    }
    .chip:hover { background: #e2e8f0; color: #334155; }
    .chip.is-active { background: #4338ca; color: #fff; }
    .chip.is-active .chip-count { color: #c7d2fe; }
    .chip-count { font-weight: 500; opacity: .85; }

    /* vis-network tooltip — pārveidots par lasāmu kartīti.
       Default vis-tooltip ir viena gara rinda balta fonā ar minimālu padding;
       pārtaisām par tumšu kartīti ar max-width un pareizu word-wrap. */
    .vis-tooltip {
      max-width: 360px !important;
      max-height: 280px !important;
      overflow-y: auto !important;
      padding: 10px 12px !important;
      background: #1e293b !important;
      color: #f1f5f9 !important;
      border: 1px solid #334155 !important;
      border-radius: 6px !important;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
      font: 12px/1.5 system-ui, sans-serif !important;
      white-space: normal !important;
      word-wrap: break-word !important;
      /* pointer-events: auto — lai lietotājs var ar peli iekāpt tooltipā un
         skrollēt garākus aprakstus (LightRAG mēdz uzkrāt 4-5 versijas vienai
         entitijai). vis-network default ir 'none', bet tas neļauj scroll. */
      pointer-events: auto !important;
    }
    .graph-tt-title { font-weight: 600; color: #ffffff; margin-bottom: 2px; }
    .graph-tt-type  { font-size: 11px; color: #94a3b8; text-transform: uppercase;
                      letter-spacing: 0.04em; margin-bottom: 6px; }
    .graph-tt-desc  { color: #e2e8f0; white-space: pre-line; }

    /* View-switch (topbar): krāso caur `.topbar-link.is-active`. `.view-btn`
       atstāts kā JS hook (`document.querySelectorAll('.view-btn')`). */

    /* Status badges integrācijām */
    .ibadge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
              border-radius: 9999px; font-size: 11px; font-weight: 600; }
    .ibadge-active   { background: #dcfce7; color: #166534; }
    .ibadge-pending  { background: #fef3c7; color: #92400e; }
    .ibadge-error    { background: #fee2e2; color: #991b1b; }
    .ibadge-disabled { background: #e2e8f0; color: #475569; }

    /* Profila galvenā zona — vieglāka skenēšana */
    .profile-main { scroll-behavior: smooth; }
    .tab-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
    .tab-scroll::-webkit-scrollbar { height: 5px; }
    .tab-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

    .section-heading {
      font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
      text-transform: uppercase; color: #64748b; margin-bottom: 0.5rem;
    }

    /* Klientu saraksts — ielāde un tiešsaistes atjauninājumi */
    @keyframes list-skeleton-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.45; }
    }
    .list-skeleton { animation: list-skeleton-pulse 1.4s ease-in-out infinite; }
    @keyframes list-live-pulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
      70% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
    }
    .list-live-pulse { animation: list-live-pulse 2.4s ease-out infinite; }

    /* Klientu rinda — viens skaidrs aktīvais stāvoklis. Hover ≠ active.
       Aktīvajai kreisajā malā 3px indigo josla (taktils marker), gaišs indigo
       fons, indigo border. Soft otrais līmenis (#ID, valoda) pavāji redzams
       pēc noklusējuma; uzhoverā/aktīvā kļūst pilnīgi redzams. */
    .client-row {
      position: relative;
      border: 1px solid transparent;
      transition: background-color .12s ease, border-color .12s ease;
    }
    .client-row:hover:not(.is-active) {
      background: #f8fafc; /* slate-50 */
    }
    .client-row.is-active {
      background: #eef2ff; /* indigo-50 */
      border-color: #c7d2fe; /* indigo-200 */
    }
    .client-row.is-active::before {
      content: '';
      position: absolute;
      left: -2px; top: 8px; bottom: 8px;
      width: 3px;
      border-radius: 2px;
      background: #4f46e5; /* indigo-600 */
    }
    .client-row .row-meta-soft {
      opacity: 0.55;
      transition: opacity .15s ease;
    }
    .client-row:hover .row-meta-soft,
    .client-row.is-active .row-meta-soft,
    .client-row.is-kb-focus .row-meta-soft {
      opacity: 1;
    }
    .client-row.is-kb-focus {
      outline: 2px solid #818cf8; /* indigo-400 */
      outline-offset: -2px;
    }
    /* Trash poga — slēpta līdz hover/aktīvajai/kb-focus */
    .client-row .row-trash {
      opacity: 0;
      transition: opacity .15s ease;
    }
    .client-row:hover .row-trash,
    .client-row.is-active .row-trash,
    .client-row.is-kb-focus .row-trash,
    .client-row .row-trash:focus-visible {
      opacity: 1;
    }
    @media (max-width: 640px) {
      .client-row .row-trash { opacity: 1; }
    }

    /* Update flash neaiztiek aktīvo rāmi — tikai gaišs box-shadow */
    @keyframes list-item-flash {
      0% { background-color: #fef9c3; }
      100% { background-color: transparent; }
    }
    @keyframes list-item-flash-shadow {
      0%   { box-shadow: 0 0 0 2px #fde047; }
      100% { box-shadow: 0 0 0 0 transparent; }
    }
    .list-item-updated:not(.is-active) {
      animation: list-item-flash 2s ease-out;
    }
    .list-item-updated.is-active {
      animation: list-item-flash-shadow 1.6s ease-out;
    }

    /* Footer masveida dzēšana — slēpta zem details */
    .footer-purge summary {
      cursor: pointer;
      font-size: 11px;
      color: #94a3b8;
      padding: 4px 6px;
      text-align: center;
      border-radius: 6px;
      transition: color .12s, background .12s;
    }
    .footer-purge summary:hover { color: #be123c; background: #fff1f2; }
    .footer-purge[open] summary { color: #be123c; }

    /* Sarunu siena — kompakta plūsma, jaunākās augšā */
    .conv-wall { max-width: 100%; width: 100%; }
    .conv-attachments { max-width: min(100%, 44rem); }
    .conv-att-card {
      display: flex; flex-direction: column;
      width: 176px; flex-shrink: 0;
      border: 1px solid #e2e8f0; border-radius: 12px;
      overflow: hidden; background: #fff;
      box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
    }
    .conv-att-thumb {
      display: block; width: 176px; height: 176px; flex-shrink: 0;
      border-radius: 0; overflow: hidden;
      border: none; border-bottom: 1px solid #e2e8f0;
      background: #f8fafc;
    }
    .conv-att-thumb--empty { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); }
    .conv-att-img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .conv-att-meta {
      display: flex; flex-direction: column; gap: 0.25rem;
      padding: 0.45rem 0.55rem 0.55rem;
      font-size: 11px; line-height: 1.3; min-width: 0;
    }
    .conv-att-price {
      font-size: 13px; font-weight: 700; color: #0f172a;
      font-variant-numeric: tabular-nums;
    }
    .conv-att-sku {
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 10px; color: #64748b;
      word-break: break-all;
    }
    .conv-att-store {
      color: #4338ca; font-weight: 600; text-decoration: none;
      margin-top: 0.1rem;
    }
    .conv-att-store:hover { text-decoration: underline; color: #3730a3; }

    /* Komplekta priekšskatījums — kā catalog-search */
    .conv-combo-wrap { max-width: min(100%, 52rem); width: 100%; display: flex; }
    .conv-combo-panel {
      width: 100%;
      border: 2px solid rgb(20 184 166 / 0.35);
      border-radius: 14px;
      background: linear-gradient(180deg, rgb(240 253 250 / 0.65), #fff);
      padding: 0.75rem 0.85rem;
    }
    .conv-combo-panel-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
      text-transform: uppercase; color: #134e4a; margin-bottom: 0.55rem;
    }
    .conv-combo-row {
      padding-bottom: 0.75rem; margin-bottom: 0.75rem;
      border-bottom: 1px solid rgb(20 184 166 / 0.22);
    }
    .conv-combo-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
    .conv-combo-row-title {
      font-size: 11px; font-weight: 700; color: #134e4a; margin-bottom: 0.45rem;
    }
    .conv-combo-slots {
      display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: stretch;
    }
    .conv-combo-slot {
      width: 176px;
      border: 2px solid rgb(45 212 191 / 0.55);
      background: linear-gradient(180deg, #f0fdfa, #fff);
      box-shadow: 0 1px 2px rgb(13 148 136 / 0.08);
    }
    .conv-combo-role {
      font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
      text-transform: uppercase; color: #134e4a; line-height: 1.25;
    }
    .conv-combo-cat {
      font-size: 10px; font-weight: 600; color: #0f766e; margin-bottom: 0.15rem;
    }
    .conv-combo-name {
      font-size: 11px; font-weight: 600; color: #0f172a; line-height: 1.25;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
      overflow: hidden;
    }

    /* Galvenā prece + saderīgās preces (cross-sale anchor režīms) */
    .conv-anchor-block {
      max-width: min(100%, 44rem); width: 100%;
      display: flex; flex-direction: column; gap: 0.75rem;
    }
    .conv-anchor-section { display: flex; flex-direction: column; gap: 0.4rem; }
    .conv-anchor-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
      text-transform: uppercase; color: #0f172a;
    }
    .conv-anchor-main .conv-att-card {
      border-color: #c7d2fe;
      box-shadow: 0 1px 3px rgb(67 56 202 / 0.12);
    }
    .conv-xsale-panel {
      border: 1px dashed #c7d2fe; border-radius: 12px;
      background: linear-gradient(180deg, #f5f3ff, #fff);
      padding: 0.65rem 0.75rem;
    }
    .conv-xsale-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
      text-transform: uppercase; color: #4338ca; margin-bottom: 0.5rem;
    }
    .conv-xsale-grid {
      display: flex; flex-wrap: wrap; gap: 0.6rem;
    }
    .conv-xsale-cat {
      font-size: 10px; font-weight: 600; color: #4338ca;
      padding: 0 0.55rem; margin-bottom: 0.2rem;
    }

    .conv-day-divider {
      display: flex; align-items: center; gap: 0.5rem;
      padding: 0.15rem 0; margin: 0.35rem 0 0.2rem;
      font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
      text-transform: uppercase; color: #94a3b8;
    }
    .conv-day-divider::before, .conv-day-divider::after {
      content: ''; flex: 1; height: 1px; background: #e2e8f0;
    }
    .conv-session-tag {
      display: inline-flex; align-items: center;
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 10px; font-weight: 500; line-height: 1.2;
      color: #64748b; background: #f1f5f9;
      border: 1px solid #e2e8f0; border-radius: 4px;
      padding: 2px 6px; letter-spacing: 0;
      cursor: copy; user-select: all;
      max-width: 100%; word-break: break-all;
      transition: background 120ms, color 120ms;
    }
    .conv-session-tag:hover { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }
    .conv-session-tag:active { background: #c7d2fe; }
    @keyframes conv-msg-flash {
      0% { background-color: #fef9c3; }
      100% { background-color: transparent; }
    }
    .conv-msg-new { animation: conv-msg-flash 1.6s ease-out; border-radius: 0.375rem; }
    .conv-status {
      display: inline-flex; align-items: center;
      font-size: 11px; font-weight: 600; line-height: 1;
      padding: 1px 4px; border-radius: 4px;
      cursor: help; min-width: 14px; justify-content: center;
    }
    .conv-status-pending   { color: #b45309; background: #fef3c7; }
    .conv-status-sent      { color: #475569; background: #f1f5f9; }
    .conv-status-delivered { color: #1d4ed8; background: #dbeafe; }
    .conv-status-read      { color: #4f46e5; background: #e0e7ff; }
    .conv-status-failed    { color: #b91c1c; background: #fee2e2; }
    .conv-status-in        { color: #047857; background: #d1fae5; font-size: 10px; padding: 2px 8px; border-radius: 9999px; letter-spacing: 0.02em; }
    .conv-msg-footer { font-size: 10px; max-width: 100%; }
