/* cdna_panel.css — Customer DNA panel, VAULT design system.
 * Relies on the host page's :root tokens (--ink, --bone, --gold, fonts…).
 * Shared by crm_customers.html and crm_my_sessions.html. */

.cdna-btn {
  font-family: var(--font-body);
  font-size: 0.74em;
  font-weight: 600;
  letter-spacing: 0.4px;
  background: var(--ink);
  color: var(--gold-pale);
  border: none;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.cdna-btn:hover { background: var(--gold-deep); color: #fff; transform: translateY(-1px); }
tr.cdna-open { background: var(--bone) !important; }
tr.cdna-open .cdna-btn { background: var(--gold-deep); color: #fff; }

.cdna-row > td { padding: 0 !important; background: var(--bone); }
.cdna-panel {
  font-family: var(--font-body);
  color: var(--ink);
  padding: 22px 26px 26px;
  border-top: 2px solid var(--gold);
  border-bottom: 1px solid var(--bone-dark);
  animation: cdna-in 0.25s ease;
}
@keyframes cdna-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cdna-loading, .cdna-err, .cdna-empty {
  font-size: 0.86em; color: var(--ink-60); padding: 8px 0; font-style: italic;
}
.cdna-err { color: var(--carmine); font-style: normal; }

/* header */
.cdna-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.cdna-name { font-family: var(--font-display); font-size: 1.5em; font-weight: 500; letter-spacing: -0.4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cdna-code { font-family: var(--font-mono); font-size: 0.5em; font-weight: 500; background: var(--ink); color: var(--gold-pale); padding: 3px 9px; border-radius: 999px; letter-spacing: 0.5px; }
.cdna-tier { font-family: var(--font-body); font-size: 0.46em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: 3px 9px; border-radius: 999px; }
.cdna-tier-VVIP { background: #3b0764; color: #f0e6ff; }
.cdna-tier-VIP  { background: var(--gold-deep); color: #fff; }
.cdna-tier-PC   { background: var(--emerald); color: #fff; }
.cdna-tier-Regular { background: var(--bone-dark); color: var(--ink-60); }
.cdna-demo { font-size: 0.84em; color: var(--ink-60); margin-top: 5px; }
.cdna-rebuilt { font-family: var(--font-mono); font-size: 0.68em; color: var(--ink-30); white-space: nowrap; padding-top: 6px; }

/* stat strip */
.cdna-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--bone-dark); border: 1px solid var(--bone-dark); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; }
.cdna-stat { background: var(--white); padding: 12px 14px; }
.cdna-stat-accent { background: linear-gradient(135deg, var(--ink) 0%, #2a2a2a 100%); }
.cdna-stat-accent .cdna-stat-v { color: var(--gold-pale); }
.cdna-stat-accent .cdna-stat-l { color: rgba(240,230,200,0.7); }
.cdna-stat-v { font-family: var(--font-display); font-size: 1.32em; font-weight: 500; letter-spacing: -0.3px; }
.cdna-stat-l { font-size: 0.68em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-60); margin-top: 2px; }
@media (max-width: 760px) { .cdna-stats { grid-template-columns: repeat(2, 1fr); } }

.cdna-attend { font-size: 0.82em; color: var(--ink-60); margin-bottom: 6px; }
.cdna-attend:last-of-type { margin-bottom: 14px; }

/* sections grid */
.cdna-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
@media (max-width: 900px) { .cdna-grid { grid-template-columns: 1fr; } }
.cdna-sec-h { font-family: var(--font-body); font-size: 0.74em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink); padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--bone-dark); display: flex; align-items: center; gap: 8px; }
.cdna-count { font-family: var(--font-mono); font-size: 0.85em; font-weight: 500; background: var(--gold-pale); color: var(--gold-deep); padding: 1px 7px; border-radius: 999px; }
.cdna-sec-body { max-height: 220px; overflow-y: auto; padding-right: 4px; }

.cdna-rowline { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dotted var(--ink-10); font-size: 0.84em; }
.cdna-rowline:last-child { border-bottom: none; }
.cdna-rl-date { font-family: var(--font-mono); font-size: 0.82em; color: var(--ink-30); white-space: nowrap; min-width: 78px; }
.cdna-rl-code { font-family: var(--font-mono); font-size: 0.88em; font-weight: 500; color: var(--gold-deep); white-space: nowrap; }
.cdna-rl-main { flex: 1; }
.cdna-rl-sub { color: var(--ink-30); font-size: 0.9em; }
.cdna-rl-money { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.cdna-tag { font-size: 0.92em; }

/* v72 — referral lineage */
.cdna-ref-up { font-size: 0.86em; color: var(--ink-60); margin-bottom: 8px; }
.cdna-ref-rollup { font-size: 0.9em; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--bone-dark); }
.cdna-ref-node { font-size: 0.9em; padding: 3px 0; display: flex; gap: 8px; align-items: baseline; }
.cdna-ref-link { color: var(--gold-deep); cursor: pointer; text-decoration: underline dotted; }
.cdna-ref-link:hover { color: var(--ink); }

.cdna-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cdna-chip { font-family: var(--font-mono); font-size: 0.78em; background: var(--white); border: 1px solid var(--bone-dark); border-radius: var(--radius-sm); padding: 3px 9px; }

/* observations */
.cdna-obs-add { display: flex; gap: 8px; margin-bottom: 10px; }
.cdna-obs-input { flex: 1; font-family: var(--font-body); font-size: 0.84em; padding: 7px 11px; border: 1px solid var(--bone-dark); border-radius: var(--radius-sm); background: var(--white); }
.cdna-obs-input:focus { outline: none; border-color: var(--gold); }
.cdna-obs-btn { font-family: var(--font-body); font-size: 0.8em; font-weight: 600; background: var(--ink); color: #fff; border: none; border-radius: var(--radius-sm); padding: 7px 16px; cursor: pointer; }
.cdna-obs-btn:hover { background: var(--gold-deep); }
.cdna-obs-btn:disabled { opacity: 0.5; cursor: default; }
.cdna-obs { padding: 7px 0; border-bottom: 1px dotted var(--ink-10); }
.cdna-obs:last-child { border-bottom: none; }
.cdna-obs-meta { font-family: var(--font-mono); font-size: 0.7em; color: var(--ink-30); text-transform: uppercase; letter-spacing: 0.4px; }
.cdna-obs-text { font-size: 0.88em; margin-top: 2px; }

/* modal (salesperson surface) */
.cdna-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.cdna-modal[hidden] { display: none; }
.cdna-modal-backdrop { position: absolute; inset: 0; background: rgba(13,13,13,0.55); backdrop-filter: blur(2px); }
.cdna-modal-box { position: relative; background: var(--bone); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: min(940px, 100%); max-height: calc(100vh - 80px); overflow-y: auto; border-top: 3px solid var(--gold); animation: cdna-in 0.2s ease; }
.cdna-modal-box .cdna-panel { border-top: none; border-bottom: none; }
.cdna-modal-x { position: absolute; top: 12px; right: 14px; z-index: 2; background: none; border: none; font-size: 1.7em; line-height: 1; color: var(--ink-30); cursor: pointer; }
.cdna-modal-x:hover { color: var(--ink); }

/* v66 — dedicated Bills section: download chips grouped by order */
.cdna-bills-body { display: flex; flex-direction: column; gap: 9px; }
.cdna-bills-order { display: flex; flex-direction: column; gap: 4px; }
.cdna-bills-order-h { font-family: var(--font-mono); font-size: 0.7em; font-weight: 500; color: var(--ink-30); letter-spacing: 0.3px; }
.cdna-bills-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cdna-bills-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: #fff; border: 1px solid var(--bone-dark); border-radius: 999px; padding: 3px 11px 3px 4px; font-size: 0.8em; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.cdna-bills-chip:hover { border-color: var(--gold); background: var(--bone); }
.cdna-bills-tag { font-family: var(--font-mono); font-size: 0.82em; font-weight: 500; background: var(--ink); color: var(--gold-pale); padding: 1px 7px; border-radius: 999px; letter-spacing: 0.3px; flex-shrink: 0; }
.cdna-bills-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.cdna-bills-chip:hover .cdna-bills-name { color: var(--gold-deep); }
.cdna-bills-empty { font-size: 0.78em; color: var(--carmine, #b00); font-style: italic; }
