/* Customer Intelligence — UI tweaks on top of Pico.css.
   Goal: minimal additions, lean on Pico's defaults. */

:root {
    --ci-pill-bg: var(--pico-secondary-background);
    --ci-pill-fg: var(--pico-secondary-inverse);
}

/* ----- topbar / brand ----- */
.ci-topbar {
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-inline: 1rem;
    margin-bottom: 1rem;
}
.ci-brand { text-decoration: none; }

/* ----- big centered search hero on / and /search ----- */
.ci-search-hero {
    text-align: center;
    margin: 2rem 0 2.5rem;
}
.ci-search-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 0.8rem; }
.ci-search-form {
    max-width: 720px;
    margin: 0 auto;
}
.ci-search-form input[type="search"] {
    font-size: 1.15rem;
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.ci-search-results {
    max-width: 720px;
    margin: 1rem auto 0;
    text-align: left;
}
.ci-search-list {
    background: var(--pico-card-background-color, #fff);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 8px;
    overflow: hidden;
}
.ci-search-list li {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    list-style: none;
    margin: 0;
}
.ci-search-list li:last-child { border-bottom: 0; }
.ci-search-list li a { text-decoration: none; }
.ci-search-list li small { display: block; color: var(--pico-muted-color); }
.ci-empty { text-align: center; color: var(--pico-muted-color); margin-top: 1rem; }

/* ----- dashboard stat cards ----- */
.ci-stats article {
    text-align: center;
    padding: 1rem 0.8rem;
}
.ci-stats header { font-size: 0.85rem; color: var(--pico-muted-color); }
.ci-stat-num { font-size: 1.8rem; display: block; margin: 0.25rem 0; }
.ci-stats small { color: var(--pico-muted-color); }

/* ----- two-column recent feed ----- */
.ci-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
@media (max-width: 800px) {
    .ci-grid-two { grid-template-columns: 1fr; }
}
.ci-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ci-list li {
    padding: 0.45rem 0;
    border-bottom: 1px dashed var(--pico-muted-border-color);
}
.ci-list li:last-child { border-bottom: 0; }
.ci-list li a { text-decoration: none; font-weight: 500; }
.ci-list li small { display: block; color: var(--pico-muted-color); font-size: 0.85rem; }

/* ----- profile page ----- */
.ci-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.ci-profile-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ci-profile-actions [role="button"] { margin: 0; }
.ci-breadcrumb { padding-left: 0; }
.ci-breadcrumb li { list-style: none; }

.ci-kv {
    width: 100%;
    border-collapse: collapse;
}
.ci-kv th {
    text-align: left;
    width: 16rem;
    color: var(--pico-muted-color);
    font-weight: 500;
    padding: 0.35rem 0.5rem 0.35rem 0;
    vertical-align: top;
}
.ci-kv td {
    padding: 0.35rem 0;
    vertical-align: top;
}

.ci-orders { width: 100%; }
.ci-orders th, .ci-orders td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}
.ci-orders code { font-size: 0.85em; }
.ci-line-items { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.ci-opp-list .ci-opp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.ci-opp-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ci-opp-actions [role="button"] { padding: 0.3rem 0.7rem; font-size: 0.85rem; margin: 0; }
.ci-products { margin: 0.4rem 0; }
.ci-products ul { margin: 0.2rem 0 0; padding-left: 1.2rem; }

.ci-summary-note { color: var(--pico-muted-color); font-size: 0.9rem; }

.ci-events { list-style: none; padding: 0; margin: 0; }
.ci-event {
    padding: 0.55rem 0.75rem;
    border-left: 3px solid var(--pico-muted-border-color);
    margin-bottom: 0.5rem;
    background: var(--pico-card-background-color, #fafafa);
}
.ci-event-call { border-left-color: #4f86c6; }
.ci-event-sms  { border-left-color: #2aa876; }
.ci-event-inbound { background: rgba(79,134,198,0.06); }
.ci-event-content {
    margin: 0.3rem 0 0;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

/* ----- pills ----- */
.ci-pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem;
    border-radius: 999px;
    background: var(--ci-pill-bg);
    color: var(--ci-pill-fg);
    line-height: 1.4;
    vertical-align: middle;
}
.ci-pill-wholesale { background: #f4d35e; color: #2b2b2b; }
.ci-pill-retail    { background: #d0e1ff; color: #1b3b6f; }
.ci-pill-ai        { background: #e0d4f7; color: #4a2a8a; }
.ci-pill-open      { background: #d2f4d2; color: #166534; }
.ci-pill-won       { background: #b2e8b2; color: #0c5e1a; }
.ci-pill-lost      { background: #f6c0c0; color: #7a1f1f; }
.ci-pill-abandoned { background: #e3e3e3; color: #555; }
.ci-pill-pending   { background: #fff1c0; color: #6a4500; }
.ci-pill-in_progress { background: #cfe7ff; color: #1b4b80; }
.ci-pill-complete  { background: #d2f4d2; color: #166534; }
.ci-pill-failed    { background: #f6c0c0; color: #7a1f1f; }
.ci-pill-warn      { background: #ffe4b3; color: #7a4500; }
.ci-pill-paid      { background: #d2f4d2; color: #166534; }
.ci-pill-refunded  { background: #f6c0c0; color: #7a1f1f; }
.ci-pill-fulfilled { background: #c9ecff; color: #134168; }
.ci-pill-unfulfilled { background: #fff1c0; color: #6a4500; }

.ci-money { font-weight: 600; }
.ci-meta  { color: var(--pico-muted-color); font-weight: normal; }

/* ----- login ----- */
.ci-login {
    max-width: 400px;
    margin: 4rem auto 0;
}
.ci-error {
    background: #fde2e2;
    color: #7a1f1f;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.ci-footer {
    margin-top: 3rem;
    color: var(--pico-muted-color);
    text-align: center;
}
