/* 04-drawer.css — The side drawer and what lives in it: key/value lists, stage chips, the timeline;
   phone numbers and the contact lock.
   Part of the CRM stylesheet: the files load in number order (components/app_styles.html) and later
   rules win, exactly as when this was one file. */

/* ---------- Drawer ---------- */
.drawer-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; } /* a closed drawer waits off-screen: clipped, never scrollable */
.drawer-root.open { pointer-events: auto; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .28); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s; }
.drawer-root.open .drawer-overlay { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .25s;
  visibility: hidden; /* closed: not shown, not focusable */
}
.drawer-root.open .drawer { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.drawer.wide { width: min(640px, 100vw); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 0; }
.drawer-kicker { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.drawer-kicker.accent { color: var(--accent-strong); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 24px 24px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.drawer-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.drawer-hero h2 { font-size: 20px; font-weight: 750; }
.drawer-hero .sub { font-size: 13.5px; color: var(--muted); }
.drawer-hero.tinted { margin: -14px -20px 16px; padding: 18px 20px; background: linear-gradient(180deg, var(--accent-soft), transparent); }
.drawer .field { margin-bottom: 14px; }
.drawer .field .input, .drawer .field .select { height: 40px; }
.drawer-section { padding: 14px 0; border-top: 1px solid var(--border-soft); }
.drawer-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
.kv .k { font-size: 12.5px; color: var(--muted); }
.kv .v { font-size: 14px; font-weight: 600; }
.kv .v.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.kv .v.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-chip { height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.stage-chip:hover { border-color: var(--accent-soft-2); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--faint); }

.toast-saved { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--success); }

/* ---------- Phone privacy ---------- */
.phone-link { font-weight: 600; font-variant-numeric: tabular-nums; }
.phone-actions { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; vertical-align: middle; }
.phone-copy {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer;
}
.phone-copy:hover, .phone-copy:focus-visible { color: var(--accent-strong); background: var(--accent-soft); }
@media (pointer: coarse) { .phone-copy { width: 36px; height: 36px; } } /* a finger-sized target on phones */
.phone-link:hover { color: var(--accent-strong); }
.phone-hidden { display: inline-flex; flex-direction: column; gap: 1px; }
.phone-hidden .masked { font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: .02em; }
.phone-hidden .hint { font-size: 12px; color: var(--accent-strong); font-weight: 600; }
.contact-lock { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: var(--accent-soft); border: 1px dashed var(--accent-soft-2); }
.contact-lock svg { color: var(--accent-strong); margin-top: 2px; }
.contact-lock b { display: block; font-size: 14px; }
.contact-lock span { font-size: 13px; color: var(--text-2); }

