/* Clover OS — Data Manager styles. Builds on colors_and_type.css + styles.css +
   admin.css (it reuses .adm-page, .adm-table, .adm-btn, .adm-picker, .adm-chip,
   .metric-grid). Only Data-Manager-specific bits live here. Brand tokens:
   green #00d59f, navy #041e3f, Inter (body) / Sora (headings). */

.dm-page { max-width: 1200px; }
.dm-lede { font-size: 14px; color: #6b7480; margin: -8px 0 20px; max-width: 72ch; }
.dm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Header: source pill reuses the advertiser .hdr-select chrome */
.app-header .hdr-select__val.dm-mono { font-weight: 600; }

/* summary metric grid — reuses .metric-grid from styles.css, tints values */
.dm-metrics { margin-bottom: 22px; }
.metric__value--ok   { color: #15803d; }
.metric__value--warn { color: #b3760a; }
.metric__value--err  { color: #c0392b; }

/* status: colored dot + label (mirrors admin .adm-spend) */
.dm-status { display: inline-flex; align-items: center; gap: 7px; cursor: default; white-space: nowrap; }
.dm-status__dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #c2c9d2; }
.dm-status__label { font-size: 13px; font-weight: 600; color: #4a5563; }
.dm-status.is-connected  .dm-status__dot { background: #16a34a; }
.dm-status.is-connected  .dm-status__label { color: #15803d; }
.dm-status.is-unassigned .dm-status__dot { background: #c2c9d2; }
.dm-status.is-unassigned .dm-status__label { color: #97a0ac; }
.dm-status.is-missing    .dm-status__dot { background: #e0533d; }
.dm-status.is-missing    .dm-status__label { color: #c0392b; }

/* feed-type badge — mirrors admin .adm-badge.
   Four feed types, kept within the brand palette (navy / green / amber / neutral —
   no blue or purple, no red so it never reads as an error state). */
.dm-feedtype { display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.dm-feedtype__dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.dm-feedtype--inventory { background: #e7ecf3; color: #041e3f; }
.dm-feedtype--inventory .dm-feedtype__dot { background: #041e3f; }
.dm-feedtype--new-specials { background: #e3faf3; color: #04392b; }
.dm-feedtype--new-specials .dm-feedtype__dot { background: #00a87d; }
.dm-feedtype--service-specials { background: #fff3d6; color: #8a5a00; }
.dm-feedtype--service-specials .dm-feedtype__dot { background: #d98a1f; }
.dm-feedtype--other-specials { background: #eceef1; color: #5b6573; }
.dm-feedtype--other-specials .dm-feedtype__dot { background: #97a0ac; }

/* file cell */
.dm-file { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dm-file__name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  font-weight: 600; color: #041e3f; background: none; border: none; padding: 0; cursor: pointer; text-align: left; }
.dm-file__name:hover { color: #00a87d; text-decoration: underline; }
.dm-file__meta { font-size: 11.5px; color: #8a93a0; }
.dm-file__meta b { color: #5b6573; font-weight: 600; }

.dm-adv { font-size: 13px; color: #0b1220; }
.dm-adv--none { color: #b3bcc8; font-style: italic; }
.dm-adv__more { font-size: 11px; color: #8a93a0; margin-left: 6px; }

.dm-when { font-size: 13px; color: #4a5563; }
.dm-size { font-variant-numeric: tabular-nums; font-size: 13px; color: #4a5563; }

/* status filter sits inline in the toolbar */
.dm-filter { display: inline-flex; align-items: center; gap: 8px; }
.dm-filter label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #8a93a0; }

/* advertiser filter trigger — matches the .adm-select look, with a caret */
.dm-advsel { display: inline-flex; align-items: center; gap: 8px; font-family: "Inter", sans-serif;
  font-size: 13px; font-weight: 600; color: #0b1220; padding: 6px 10px; border: 1px solid #d6dbe2;
  border-radius: 8px; background: #fff; cursor: pointer; max-width: 240px; }
.dm-advsel.is-set { border-color: #00a87d; color: #04392b; background: #f3fbf8; }
.dm-advsel__val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-advsel__caret { width: 12px; height: 12px; flex: 0 0 auto; color: #8a93a0; }

/* feed-type column — wrap multiple connected feed-type badges */
.dm-feedtypecell { display: flex; flex-wrap: wrap; gap: 4px; }

/* row hover + selection */
.adm-table tbody tr.dm-row { cursor: pointer; transition: background .12s; }
.adm-table tbody tr.dm-row:hover { background: #f8fbfa; }
.adm-table tbody tr.dm-row.is-sel { background: #eef7f3; }

.dm-orphan-note { font-size: 12.5px; color: #b3760a; background: #fff8ec; border: 1px solid #f5e2bd;
  border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; }

/* =========================================================================
   Side drawer
   ========================================================================= */
.dm-scrim { position: fixed; inset: 0; background: rgba(4, 30, 63, .34); opacity: 0;
  pointer-events: none; transition: opacity .2s; z-index: 900; }
.dm-scrim.show { opacity: 1; pointer-events: auto; }

.dm-drawer { position: fixed; top: 0; right: 0; height: 100%; width: clamp(480px, 40vw, 760px); max-width: 94vw;
  background: #fff; box-shadow: -24px 0 60px rgba(4, 30, 63, .22); z-index: 910;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  display: flex; flex-direction: column; }
.dm-drawer.show { transform: none; }

.dm-drawer__head { padding: 22px 24px 18px; border-bottom: 1px solid #e6e9ee; position: relative; }
.dm-drawer__close { position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid #e6e9ee; background: #fff; color: #6b7480; cursor: pointer; display: grid; place-items: center;
  font-size: 18px; line-height: 1; transition: background .15s, color .15s; }
.dm-drawer__close:hover { background: #f1f4f8; color: #041e3f; }
.dm-drawer__feedtyperow { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.dm-drawer__feedtyperow .dm-status { margin-left: auto; }
.dm-drawer__title { font-family: "Sora", sans-serif; font-weight: 700; font-size: 18px; color: #041e3f;
  margin: 0; word-break: break-all; line-height: 1.35; padding-right: 30px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.dm-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #6b7480;
  background: #f1f4f8; border-radius: 7px; padding: 7px 10px; margin: 12px 0 0; display: flex;
  align-items: center; gap: 8px; word-break: break-all; }
.dm-key__copy { margin-left: auto; flex: 0 0 auto; color: #8a93a0; background: none; border: none; cursor: pointer; padding: 2px; }
.dm-key__copy:hover { color: #00a87d; }
.dm-facts { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 14px; }
.dm-fact__k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #8a93a0; }
.dm-fact__v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: #041e3f; margin-top: 3px; }

.dm-drawer__body { flex: 1; overflow-y: auto; padding: 22px 24px 30px; }
.dm-msec { margin-bottom: 26px; }
.dm-msec:last-child { margin-bottom: 0; }
.dm-msec__t { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dm-msec__t h4 { font-family: "Sora", sans-serif; font-size: 14px; font-weight: 700; color: #041e3f; margin: 0; }
.dm-msec__hint { font-size: 12.5px; color: #8a93a0; margin: -4px 0 12px; }

.dm-conn-empty { font-size: 13px; color: #97a0ac; font-style: italic; padding: 4px 0 2px; }

/* "coming with the pipeline" placeholder card */
.dm-soon { border: 1px dashed #d7dde6; border-radius: 12px; padding: 16px; background: #fafbfc; }
.dm-soon__tag { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: #6b7480; background: #eef1f5;
  border-radius: 5px; padding: 3px 8px; margin-bottom: 11px; }
.dm-soon__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.dm-soon__list li { display: flex; gap: 10px; font-size: 13px; color: #5b6573; align-items: flex-start; }
.dm-soon__list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c2c9d2;
  margin-top: 6px; flex: 0 0 auto; }
.dm-soon__list b { color: #041e3f; font-weight: 600; }

/* =========================================================================
   Connected feeds (feed_source rows) + connect row
   ========================================================================= */
.dm-feedlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.dm-feedcard { border: 1px solid #e6e9ee; border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: border-color .14s, background .14s, box-shadow .14s; background: #fff; }
.dm-feedcard:hover { border-color: #cfd6df; background: #fafbfc; }
.dm-feedcard.is-sel { border-color: #00a87d; background: #f3fbf8; box-shadow: 0 0 0 1px #00a87d inset; }
.dm-feedcard__main { display: flex; align-items: center; gap: 10px; }
.dm-feedcard__adv { font-size: 13.5px; font-weight: 600; color: #041e3f; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-feedcard__feedtype { flex: 0 0 auto; }
.dm-feedcard__meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.dm-feedcard__mapped { font-size: 11.5px; color: #8a93a0; flex: 1; }
.dm-feedcard__x { font-size: 11.5px; font-weight: 600; color: #c0392b; background: none; border: none;
  cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.dm-feedcard__x:hover:not(:disabled) { background: #fcecea; text-decoration: underline; }
.dm-feedcard__x:disabled { color: #c2c9d2; cursor: default; }
.dm-feedcard__flag { flex: 0 0 auto; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #c0392b; background: #fcecea; border: 1px solid #f2cdc6;
  border-radius: 5px; padding: 2px 6px; }
.dm-feedcard__flag--mute { color: #6b7480; background: #eef1f5; border-color: #e0e5ec; }

/* orphan resolve block (file left the bucket) */
.dm-resolve { border: 1px solid #f5e2bd; background: #fff8ec; border-radius: 10px; padding: 12px;
  margin-bottom: 12px; }
.dm-resolve__note { font-size: 12.5px; color: #8a6300; line-height: 1.45; }
.dm-resolve__note b { color: #7a4b00; }
.dm-resolve__row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.dm-resolve__label { flex: 0 0 auto; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #97a0ac; }
.dm-resolve__pick { flex: 1; min-width: 0; }

.dm-connect { display: flex; gap: 8px; align-items: stretch; }
.dm-connect__feedtype { flex: 0 0 auto; max-width: 168px; }
.dm-connect__adv { flex: 1; min-width: 0; }

/* =========================================================================
   Column mapping
   ========================================================================= */
.dm-map { border: 1px solid #e6e9ee; border-radius: 12px; overflow: hidden; }
.dm-map__state { font-size: 13px; color: #6b7480; padding: 16px; border: 1px dashed #d7dde6;
  border-radius: 12px; background: #fafbfc; display: flex; align-items: center; gap: 10px; }
.dm-map__state--err { color: #c0392b; background: #fcf0ee; border-color: #f2cdc6; }
.dm-map__retry { margin-left: auto; }

.dm-map__bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #f8fafc; border-bottom: 1px solid #e6e9ee; }
.dm-map__summary { font-size: 12px; color: #5b6573; flex: 1; }
.dm-map__summary b { color: #041e3f; font-weight: 700; }
.dm-map__req { margin-left: 4px; }
.dm-map__req--warn { color: #b3760a; font-weight: 600; }
.dm-map__req--ok { color: #15803d; font-weight: 600; }
.dm-map__trunc { margin-left: 4px; color: #8a93a0; }
.dm-map__actions { display: flex; gap: 6px; flex: 0 0 auto; }

.dm-map__grid { display: flex; flex-direction: column; }
.dm-map__head, .dm-map__row { display: grid; grid-template-columns: 1.1fr 1.1fr 0.8fr 28px; gap: 10px; align-items: center; }
.dm-map__head { padding: 8px 12px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #97a0ac; border-bottom: 1px solid #eef1f5; }
.dm-map__row { padding: 8px 12px; border-bottom: 1px solid #f1f4f8; }
.dm-map__row:last-child { border-bottom: none; }
.dm-map__row.is-needed { background: #fffaf0; }
.dm-map__placeholder { padding: 16px 12px; font-size: 13px; color: #6b7480; border-bottom: 1px solid #f1f4f8; }
.dm-map__star { color: #c0392b; font-weight: 700; }
.dm-map__type { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #b3bcc8; }
.dm-map__select { width: 100%; font-size: 12.5px; padding: 6px 8px; border: 1px solid #d7dde6;
  border-radius: 7px; background: #fff; color: #0b1220; }
.dm-map__select--field { font-weight: 600; color: #041e3f; }
.dm-map__select:focus { outline: none; border-color: #00a87d; box-shadow: 0 0 0 2px rgba(0,168,125,.16); }
.dm-map__select.is-err { border-color: #e0a96d; background: #fff7ee; }
.dm-map__sample { font-size: 12px; color: #6b7480; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-map__sample em { color: #b3bcc8; font-style: italic; font-family: "Inter", sans-serif; }
.dm-map__eg { color: #c2c9d2; }
.dm-map__del { width: 24px; height: 24px; border: 1px solid #e6e9ee; border-radius: 6px; background: #fff;
  color: #97a0ac; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.dm-map__del:hover:not(:disabled) { border-color: #f2cdc6; color: #c0392b; background: #fcf0ee; }
.dm-map__del:disabled { opacity: .5; cursor: default; }
.dm-link { background: none; border: none; padding: 0; color: #00a87d; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: underline; }
.dm-link:disabled { opacity: .5; cursor: default; }

.dm-map__addrow { padding: 10px 12px; border-top: 1px solid #f1f4f8; }
.dm-map__foot { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fafbfc;
  border-top: 1px solid #e6e9ee; }
.dm-map__unsaved { font-size: 12px; color: #b3760a; }
.dm-map__saved { font-size: 12px; color: #15803d; font-weight: 600; }

.adm-picker__more { padding: 8px 12px; font-size: 11px; color: #97a0ac; border-top: 1px solid #f1f4f8;
  text-align: center; }

/* compact select used on feed cards */
.adm-select--xs { font-size: 12px; padding: 3px 22px 3px 8px; height: auto; }
