/* Admin CRM demo layout for the hvac, landscaping, auto-repair and salon example sites.
   vertical-crm.js sets --accent, --accent-dark and --accent-soft from WXCRM_DATA. */
:root { --ink: #0f172a; --line: #e2e8f0; --muted: #64748b; --bg: #f4f6f8; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--ink); }
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--accent-dark); color: #fff; padding: 18px 14px; }
.brand { font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: rgba(255,255,255,.7); margin-top: 2px; }
.side nav { margin-top: 22px; display: grid; gap: 4px; }
.side nav button { text-align: left; background: transparent; color: rgba(255,255,255,.82); border: 0; padding: 10px 12px; border-radius: 8px; font: inherit; cursor: pointer; }
.side nav button.on, .side nav button:hover { background: rgba(255,255,255,.14); color: #fff; }
.side .fine { font-size: 12px; color: rgba(255,255,255,.65); margin-top: 24px; }
.main { padding: 22px 26px 48px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 1.6rem; }
.top .acts-row { display: flex; gap: 8px; flex-wrap: wrap; }
.note { background: var(--accent-soft); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 18px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.metric b { display: block; font-size: 1.45rem; color: var(--accent); }
.metric span { color: var(--muted); font-size: 13px; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; padding: 9px 14px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.pipe { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: #e9eef2; border-radius: 10px; padding: 10px; min-height: 360px; }
.col h2 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; }
.col.over { outline: 2px dashed var(--accent); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: grab; }
.card.dragging { opacity: .4; }
.card small { color: var(--muted); display: block; font-size: 12px; }
.card .when { margin-top: 6px; color: var(--accent-dark); font-weight: 600; }
.who { display: flex; gap: 8px; align-items: center; }
.av { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-dark); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.chip { display: inline-block; margin-top: 6px; font-size: 11px; font-style: normal; background: var(--accent-soft); color: var(--accent-dark); padding: 2px 7px; border-radius: 99px; }
.chip.temp { background: var(--accent); color: #fff; margin-left: 6px; margin-top: 0; }
.chip.x { background: #fff; border: 1px solid var(--accent); color: var(--accent-dark); margin-right: 4px; }
.metrics.has-x { grid-template-columns: repeat(5, 1fr); }
.track { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.empty { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #f8fafc; font-size: 12px; color: var(--muted); }
tr[data-id] { cursor: pointer; }
tr[data-id]:hover td { background: #f8fafc; }
h3.sub { margin: 22px 0 8px; font-size: 15px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #fef3c7; color: #92400e; }
.pill.ok { background: #dcfce7; color: #166534; }
.modal-back, .drawer-back { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; z-index: 30; }
.modal-back.open, .drawer-back.open { display: block; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, 92vw); max-height: 92vh; overflow: auto; background: #fff; border-radius: 12px; padding: 18px; z-index: 31; display: none; }
.modal.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; width: min(520px, 100%); height: 100%; background: #fff; z-index: 32; overflow: auto; padding: 20px; display: none; }
.drawer.open { display: block; }
.drawer-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer-top h2 { margin: 0; }
.drawer .msg { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.acts { padding-left: 18px; font-size: 14px; }
.acts small { color: var(--muted); }
label { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }
input, select, textarea { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr 64px 96px 32px; gap: 6px; margin-bottom: 6px; }
.line button { border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { padding: 12px 14px; }
  .side nav { margin-top: 10px; display: flex; overflow-x: auto; gap: 6px; }
  .side nav button { white-space: nowrap; }
  .side .fine { display: none; }
  .main { padding: 16px 14px 40px; }
  .metrics, .metrics.has-x { grid-template-columns: 1fr 1fr; }
  .pipe { grid-template-columns: repeat(5, 240px); }
}
