/* ============================================================
 * InSync365 Shared Controls
 * ------------------------------------------------------------
 * Neutral building blocks reused by every redesigned screen.
 * Per-screen stylesheets (redesign-*.css) only define cell-level
 * cosmetics; all sortable headers and filter pills go through
 * here so the visuals stay consistent across the app.
 *
 * Adopted by:
 *   - CompanyDocumentsV2 (cd-screen)
 * Pending migration:
 *   - EmployeesListV2 still uses .el-th / .el-pill (kept until
 *     a separate cleanup PR replaces them with these shared
 *     classes; do not duplicate the rules there in the meantime).
 * ============================================================ */

/* ── Table card shell — wraps the toolbar + table + pager into one
 * surface. Used by every redesigned list screen (Documents V2,
 * Approvals V2, …). `overflow: clip` lets the sticky thead pin
 * cleanly without trapping inside a scroll container.
 * ─────────────────────────────────────────────────────────────── */
.is-tablecard {
    background: var(--is-bg-surface);
    border: 1px solid var(--is-border-1);
    border-radius: var(--is-radius-md);
    box-shadow: var(--is-shadow-1);
    overflow: clip;
}

/* ── Sortable column header (used inside any sticky-thead table) ── */
.is-th { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.is-th i { font-size: 9px; opacity: 0; transition: opacity .15s, color .15s; color: var(--is-fg-3); }
.is-th:hover i { opacity: .6; }
.is-th.is-sorted i { opacity: 1; color: var(--is-action-blue); }

/* ── Filter pill — chrome around an SfMultiSelect ────────────── */
.is-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--is-radius-sm);
    border: 1px solid var(--is-border-3);
    background: #fff;
    font: 600 12.5px var(--is-font-sans);
    color: var(--is-fg-2);
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    box-sizing: border-box;
    vertical-align: middle;
}
.is-pill:hover { background: var(--is-bg-surface-3); color: var(--is-fg-1); }
.is-pill i.is-pill__chev { font-size: 9px; color: var(--is-fg-3); }
.is-pill.is-active { background: var(--is-brand-blue-100); border-color: var(--is-brand-blue-200); color: var(--is-brand-blue-700); }
.is-pill.is-active i { color: var(--is-brand-blue-700); }
.is-pill__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--is-brand-blue);
    color: #fff;
    font: 700 10px var(--is-font-sans);
    margin-left: 1px;
}

/* ── Syncfusion SfMultiSelect — restyled to live invisibly inside .is-pill
 * The pill chrome (label + count + chevron) is rendered by our wrapper.
 * The SfMultiSelect sits invisibly underneath providing the popup +
 * checkboxes. CSS hides its default visuals.
 * ─────────────────────────────────────────────────────────────── */
.is-sf-pill { position: relative; }
.is-sf-pill .e-multiselect,
.is-sf-pill .e-control-wrapper,
.is-sf-pill .e-input-group {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    opacity: 0;
}
.is-sf-pill .e-multi-select-wrapper {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 !important;
}
.is-sf-pill .e-multi-select-wrapper .e-chips-collection { display: none !important; }
.is-sf-pill .e-multi-select-wrapper input.e-control,
.is-sf-pill .e-multi-select-wrapper .e-input-filter,
.is-sf-pill .e-multi-select-wrapper .e-searcher {
    color: transparent !important;
    caret-color: transparent !important;
    cursor: pointer !important;
}
.is-sf-pill .e-multi-select-wrapper .e-ddl-icon,
.is-sf-pill .e-multi-select-wrapper .e-clear-icon { display: none !important; }

/* ── PBI 7148 — custom toast (.cd-toast) 1:1 sa HTML dizajnom; renderuje ga CdToast komponenta ──
   Globalno (učitava se i na „Detalji firme" i na /companiesv2). Stack gore-desno, iznad spinnera. */
.cd-toaststack {
    position: fixed;
    top: 74px;
    right: 20px;
    z-index: 100002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.cd-toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    min-height: 46px;
    box-sizing: border-box;
    border-radius: var(--is-radius-sm, 6px);
    box-shadow: var(--is-shadow-3, 0 8px 24px rgba(20,28,50,.10), 0 2px 6px rgba(20,28,50,.06));
    background: #fff;
    border-left: 4px solid var(--is-success, #26b050);
    min-width: 320px;
    max-width: 420px;
    pointer-events: auto;
    animation: cd-toast-in .18s ease;
}
@keyframes cd-toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.cd-toast > i { font-size: 14px; color: var(--is-success, #26b050); flex-shrink: 0; align-self: center; }
.cd-toast--err { border-left-color: var(--is-danger, #d92c2c); }
.cd-toast--err > i { color: var(--is-danger, #d92c2c); }
.cd-toast__body { flex: 1; min-width: 0; }
.cd-toast__t { font: 700 12.5px var(--is-font-sans); color: var(--is-fg-1, #1a1f2e); }
.cd-toast__d { font: 400 12px var(--is-font-sans); color: var(--is-fg-3, #7a8395); margin-top: 2px; word-break: break-word; }
.cd-toast__x { font-size: 12px; color: var(--is-fg-muted, #9aa3b3); cursor: pointer; flex-shrink: 0; align-self: center; }
.cd-toast__x:hover { color: var(--is-fg-1, #1a1f2e); }
