/* Companies pages (list + profile). Complements dotleads.css with the dl-co- prefix
   so nothing here can collide with the shared design system. */

/* ---------- list: filter bar ---------- */

.dl-co-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.dl-co-filters .dl-select,
.dl-co-filters .dl-input { width: auto; min-width: 130px; flex: 0 1 auto; }

/* The stage, tag and assignee filters are DL.combobox pickers: the .dl-cbx wrap
   takes the old select's slot in the flex row and the input fills the wrap. */
.dl-co-filters .dl-cbx { flex: 0 1 auto; width: 180px; min-width: 150px; }
.dl-co-filters .dl-cbx .dl-input { width: 100%; min-width: 0; }

.dl-co-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
}

.dl-co-search > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}

.dl-co-search .dl-input { width: 100%; padding-left: 34px; }

.dl-co-minscore { max-width: 110px; }

/* ---------- list: table ---------- */

.dl-co-tablehead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dl-co-tablewrap { overflow-x: auto; }

.dl-co-name-link {
    font-weight: 600;
    color: var(--text-strong);
}

.dl-co-name-link:hover { color: var(--emerald); }

.dl-co-sub { font-size: .74rem; color: var(--text-faint); }

.dl-co-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 34px 12px;
    color: var(--text-muted);
    font-size: .88rem;
}

/* Stage badge gets its color inline from the stage row. */
.dl-co-stage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--hairline-strong);
    background: var(--hover-bg);
    color: var(--text-soft);
    white-space: nowrap;
}

.dl-co-stage .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dl-co-score {
    display: inline-block;
    min-width: 34px;
    text-align: center;
    font-weight: 700;
    font-family: var(--nav-font);
}

.dl-co-tagchips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }

.dl-co-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--hover-bg);
    color: var(--text-soft);
    border: 1px solid var(--hairline-strong);
    white-space: nowrap;
}

.dl-co-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.dl-co-chip button {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: .95rem;
    line-height: 1;
    padding: 0 0 0 2px;
}

.dl-co-chip button:hover { color: var(--status-bad-text); }

/* ---------- list: pager ---------- */

.dl-co-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.dl-co-pageinfo { font-size: .8rem; color: var(--text-muted); }

.dl-co-pagebtns { display: flex; gap: 8px; }

/* ---------- profile: header ---------- */

.dl-co-head {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    align-items: flex-start;
    justify-content: space-between;
}

.dl-co-headmain { flex: 1 1 320px; min-width: 0; }

.dl-co-title {
    font-family: var(--nav-font);
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--text-strong);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dl-co-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.dl-co-meta a { color: var(--emerald); }

.dl-co-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dl-co-assign {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-muted);
}

/* The assignee picker is a DL.combobox; keep it as compact as the old select was.
   Horizontal padding stays with the component so the clear and chevron buttons fit. */
.dl-co-assign .dl-cbx { width: 230px; }

.dl-co-assign .dl-cbx .dl-input {
    min-height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 10px;
    font-size: .84rem;
}

.dl-co-headside {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

/* Score donut */
.dl-co-ring { position: relative; display: inline-flex; }

.dl-co-ring svg { transform: rotate(-90deg); }

.dl-co-ring .track { stroke: var(--hover-bg); }

.dl-co-ring .ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dl-co-ring .ring-value strong {
    font-family: var(--nav-font);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-strong);
    line-height: 1;
}

.dl-co-ring .ring-value small {
    font-size: .68rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.dl-co-minor-scores {
    display: grid;
    grid-template-columns: repeat(2, minmax(90px, auto));
    gap: 6px 18px;
    font-size: .8rem;
    color: var(--text-muted);
}

.dl-co-minor-scores strong { color: var(--text-strong); font-family: var(--nav-font); }

/* ---------- profile: quick links ---------- */

.dl-co-quicklinks { display: flex; flex-wrap: wrap; gap: 10px; }

.dl-co-quicklink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--hairline-strong);
    border-radius: 10px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--text-soft);
    background: var(--surface-color);
    transition: border-color .15s, color .15s, transform .12s;
}

.dl-co-quicklink:hover { border-color: var(--emerald); color: var(--emerald); transform: translateY(-1px); }

.dl-co-quicklink i { color: var(--emerald); }

/* ---------- profile: info cards ---------- */

.dl-co-info { display: flex; flex-direction: column; gap: 9px; font-size: .87rem; }

.dl-co-info .row-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.dl-co-info .lbl {
    flex: 0 0 96px;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-faint);
}

.dl-co-info .val { color: var(--text-strong); word-break: break-word; min-width: 0; }

.dl-co-info a.val { color: var(--emerald); }

.dl-co-none { color: var(--text-faint); font-size: .85rem; }

.dl-co-socials { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.dl-co-social {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hairline-strong);
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 1rem;
    transition: border-color .15s, color .15s;
}

.dl-co-social:hover { border-color: var(--emerald); color: var(--emerald); }

.dl-co-desc { font-size: .9rem; color: var(--text-soft); white-space: pre-wrap; margin: 0; }

/* ---------- profile: opportunities ---------- */

.dl-co-opp {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--hairline);
}

.dl-co-opp:last-child { border-bottom: 0; }

.dl-co-opp .pts {
    flex-shrink: 0;
    min-width: 44px;
    text-align: center;
    font-family: var(--nav-font);
    font-weight: 700;
    font-size: .82rem;
    color: var(--emerald);
    background: rgba(34, 197, 94, .1);
    border-radius: 8px;
    padding: 5px 8px;
}

.dl-co-opp .t { font-weight: 600; color: var(--text-strong); font-size: .88rem; margin: 0; }

.dl-co-opp .d { font-size: .8rem; color: var(--text-muted); margin: 2px 0 0; }

/* ---------- profile: notes ---------- */

.dl-co-noteform { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }

.dl-co-noteform textarea { flex: 1; resize: vertical; }

.dl-co-note {
    padding: 11px 0;
    border-bottom: 1px solid var(--hairline);
}

.dl-co-note:last-child { border-bottom: 0; }

.dl-co-note .body { font-size: .88rem; color: var(--text-soft); white-space: pre-wrap; margin: 0 0 5px; }

.dl-co-note .meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .74rem;
    color: var(--text-faint);
}

.dl-co-note .meta .who { color: var(--text-muted); font-weight: 500; }

.dl-co-note .meta button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-size: .74rem;
    color: var(--text-faint);
}

.dl-co-note .meta button:hover { color: var(--emerald); }

.dl-co-note .meta button.danger:hover { color: var(--status-bad-text); }

.dl-co-note-edit { display: flex; flex-direction: column; gap: 8px; }

.dl-co-note-edit .btns { display: flex; gap: 8px; }

/* ---------- profile: attachments ---------- */

.dl-co-uploadrow { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.dl-co-uploadstate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    color: var(--text-muted);
}

.dl-co-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--hairline);
}

.dl-co-file:last-child { border-bottom: 0; }

.dl-co-file > i { font-size: 1.15rem; color: var(--emerald); flex-shrink: 0; }

.dl-co-file .bd { flex: 1; min-width: 0; }

.dl-co-file .nm {
    font-size: .86rem;
    font-weight: 500;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-co-file .meta { font-size: .72rem; color: var(--text-faint); }

.dl-co-file .acts { display: flex; gap: 2px; flex-shrink: 0; }

/* ---------- profile: tag editor ---------- */

.dl-co-tagpick { display: flex; gap: 8px; margin-top: 12px; }

/* "Add a tag..." is a DL.combobox; same compact treatment as the assignee picker. */
.dl-co-tagpick .dl-cbx { flex: 1; }

.dl-co-tagpick .dl-cbx .dl-input {
    min-height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 10px;
    font-size: .84rem;
}

/* ---------- modal form grid (add/edit company) ---------- */

.dl-co-formgrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 16px;
}

.dl-co-formgrid .span-2 { grid-column: span 2; }

@media (max-width: 575px) {
    .dl-co-formgrid { grid-template-columns: 1fr; }
    .dl-co-formgrid .span-2 { grid-column: auto; }
    .dl-co-noteform { flex-direction: column; align-items: stretch; }
}
