/* =====================================================================
   Stream Operations — Notes Workspace
   /pm/notesWorkspace.css
   ===================================================================== */

/* ── View layout ────────────────────────────────────────────────────── */

#notesView {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    padding: 28px 32px 48px;
}

/* ── Content panel (wraps toolbar + feed) ───────────────────────────── */

.nw-panel {
    background: var(--pm-panel);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow);
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* ── Toolbar (search + filters) ────────────────────────────────────── */

.nw-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nw-search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.nw-search-wrap svg {
    position: absolute;
    left: 11px;
    color: var(--pm-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.nw-search {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-sm);
    background: var(--pm-bg);
    color: var(--pm-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.nw-search:focus {
    border-color: var(--pm-accent);
    box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.08);
    background: var(--pm-panel);
}

.nw-search::placeholder { color: var(--pm-muted); opacity: 0.65; }

.nw-filters {
    display: flex;
    gap: 2px;
    background: var(--pm-bg);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-sm);
    padding: 3px;
    flex-shrink: 0;
}

.nw-filter {
    appearance: none;
    background: none;
    border: none;
    border-radius: calc(var(--pm-radius-sm) - 3px);
    cursor: pointer;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--pm-muted);
    padding: 5px 13px;
    line-height: 1;
    transition: background 120ms ease, color 120ms ease;
    white-space: nowrap;
}

.nw-filter.is-active {
    background: var(--pm-panel);
    color: var(--pm-text);
    font-weight: 500;
    box-shadow: var(--pm-shadow-sm);
}

.nw-filter:not(.is-active):hover { color: var(--pm-text); }

/* ── Feed ───────────────────────────────────────────────────────────── */

.nw-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Note card ──────────────────────────────────────────────────────── */

.nw-note-card {
    background: var(--pm-bg);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-sm);
    padding: 14px 16px 12px;
    transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.nw-note-card:hover {
    background: var(--pm-panel);
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    border-color: #d0d7e8;
}

/* Header row: badge · client · entity */
.nw-note-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

/* Type badge */
.nw-note-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nw-badge--entity  { background: rgba(79, 70, 229, 0.09);  color: #4338CA; }
.nw-badge--client  { background: rgba(13, 148, 136, 0.09); color: #0D7870; }
.nw-badge--tax     { background: rgba(217, 119, 6, 0.09);  color: #B45309; }
.nw-badge--default { background: rgba(102, 112, 133, 0.08); color: var(--pm-muted); }

/* Client name */
.nw-note-client {
    font-size: 13px;
    font-weight: 600;
    color: var(--pm-text);
    min-width: 0;
}

.nw-client-link {
    color: var(--pm-text);
    text-decoration: none;
    font-weight: 600;
    transition: color 120ms ease;
}

.nw-client-link:hover { color: var(--pm-accent); text-decoration: underline; }

/* Entity name */
.nw-note-entity {
    font-size: 12px;
    color: var(--pm-muted);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nw-note-sep {
    font-size: 10px;
    color: var(--pm-muted);
    opacity: 0.35;
    flex-shrink: 0;
}

/* Note body */
.nw-note-body {
    font-size: 13.5px;
    color: var(--pm-text);
    line-height: 1.55;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Footer: avatar · author · sep · timestamp */
.nw-note-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--pm-border);
}

.nw-note-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    font-size: 7.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nw-note-author {
    font-size: 12px;
    font-weight: 500;
    color: var(--pm-text);
}

.nw-note-time {
    font-size: 11.5px;
    color: var(--pm-muted);
    margin-left: auto;
}

/* ── Loading / Error / Empty states ─────────────────────────────────── */

.nw-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 0;
    gap: 10px;
    color: var(--pm-muted);
    font-size: 13.5px;
    text-align: center;
}

.nw-state svg { opacity: 0.3; }

.nw-empty {
    text-align: center;
    padding: 48px 0;
    font-size: 13.5px;
    color: var(--pm-muted);
    opacity: 0.6;
}
