@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');
/* Reset WP styles that leak through */
#pcrm-app * { box-sizing: border-box; }
#pcrm-app a { text-decoration: none; }
body.page-template-default { background: #f5f5f3; }

/* ── Layout ───────────────────────────────────────────────── */
#pcrm-app {
  display: flex;
  min-height: 100vh;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.pcrm-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img.site-logo { max-height: 36px; width: auto; filter: brightness(0) invert(1); }
.sidebar-logo .site-name-text { color: #fff; font-size: 16px; font-weight: 600; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 1.25rem;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.nav-icon { font-size: 8px; opacity: 0.6; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); }
.logout-btn { color: rgba(255,255,255,0.4); font-size: 16px; transition: color .15s; }
.logout-btn:hover { color: #fff; }

/* ── Main area ────────────────────────────────────────────── */
.pcrm-main {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
  background: #f5f5f3;
}

.pcrm-view { display: none; padding: 2rem; }
.pcrm-view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.view-header h1 { font-size: 20px; font-weight: 600; color: #1a1a1a; font-family: 'Roboto', sans-serif; letter-spacing: -0.01em; }
.panel-header h2 { font-size: 16px; font-weight: 600; margin: 0; font-family: 'Roboto', sans-serif; }
.content-card-header { font-family: 'Roboto', sans-serif; font-weight: 600; }
.form-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 1.25rem; color: #1a1a1a; font-family: 'Roboto', sans-serif; }
.modal-header h2 { font-size: 16px; font-weight: 600; margin: 0; font-family: 'Roboto', sans-serif; }

/* ── Metric cards ─────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
.metric-card {
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.metric-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.metric-value { font-size: 26px; font-weight: 600; color: #1a1a1a; }
.metric-sub { font-size: 12px; color: #aaa; margin-top: 2px; }

/* ── Cards / lists ────────────────────────────────────────── */
.content-card {
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.content-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0ec;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Table ────────────────────────────────────────────────── */
.pcrm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pcrm-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #f0f0ec;
}
.pcrm-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f3;
  color: #1a1a1a;
  vertical-align: middle;
}
.pcrm-table tr:last-child td { border-bottom: none; }
.pcrm-table tr:hover td { background: #fafaf8; }

/* ── Status badges ────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.badge-pending  { background: #fff7e6; color: #8a5c00; }
.badge-active   { background: #e6f7ee; color: #1a7a40; }
.badge-sstc     { background: #e6f0ff; color: #1a4fa0; }
.badge-sold     { background: #f0f0f0; color: #666; }
.badge-new      { background: #e6f0ff; color: #1a4fa0; }
.badge-viewing  { background: #e6f7ee; color: #1a7a40; }
.badge-offer    { background: #fff7e6; color: #8a5c00; }
.badge-cold     { background: #f5f5f3; color: #888; }
.badge-offer-stage  { background: #fff7e6; color: #8a5c00; }
.badge-exchange { background: #e6f7ee; color: #1a7a40; }
.badge-completion { background: #f0f0f0; color: #666; }
.badge-fallen   { background: #fee; color: #a00; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  padding: 9px 18px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-secondary {
  padding: 7px 14px;
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: #f5f5f3; }

/* ── Forms ────────────────────────────────────────────────── */
.pcrm-form { max-width: 720px; }
.form-section { background: #fff; border: 1px solid #e8e8e4; border-radius: 10px; padding: 1.5rem; margin-bottom: 1.25rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a1a;
  outline: none;
  transition: border-color .15s;
  background: #fff;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #1a1a1a; }
.field textarea { resize: vertical; line-height: 1.5; }
.field-grid.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.optional { font-weight: 400; color: #aaa; font-size: 11px; margin-left: 4px; }
.field-hint { font-size: 12px; color: #888; margin-bottom: 0.75rem; margin-top: -0.5rem; }

/* ── Upload area ──────────────────────────────────────────── */
.upload-area { border: 2px dashed #ddd; border-radius: 10px; overflow: hidden; }
.upload-placeholder {
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  color: #888;
  transition: background .15s;
  font-size: 13px;
}
.upload-placeholder:hover { background: #fafaf8; }
.upload-icon { font-size: 24px; margin-bottom: 0.5rem; color: #bbb; }
.upload-hint { font-size: 12px; color: #aaa; margin-top: 4px; }
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.photo-preview { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; }

/* ── Form actions ─────────────────────────────────────────── */
.form-actions { padding: 0.5rem 0; }
.submit-note { font-size: 12px; color: #aaa; margin-top: 0.75rem; }
.success-msg { background: #e6f7ee; border: 1px solid #a0dbb8; border-radius: 8px; padding: 10px 14px; color: #1a7a40; font-size: 13px; margin-bottom: 1rem; }
.error-msg { background: #fee; border: 1px solid #fcc; border-radius: 8px; padding: 10px 14px; color: #a00; font-size: 13px; margin-bottom: 1rem; }

/* ── Loading ──────────────────────────────────────────────── */
.loading { padding: 2rem; text-align: center; color: #aaa; font-size: 13px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .pcrm-sidebar { width: 100%; height: 56px; flex-direction: row; position: fixed; bottom: 0; top: auto; }
  .sidebar-logo, .sidebar-user { display: none; }
  .sidebar-nav { display: flex; flex-direction: row; padding: 0; overflow-x: auto; }
  .pcrm-main { margin-left: 0; margin-bottom: 56px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .field-grid.two-col { grid-template-columns: 1fr; }
}

/* ── Nav badges ───────────────────────────────────────────── */
.nav-group-label { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 1.25rem 4px; }
.nav-badge { background: #e55; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.nav-item { display: flex; align-items: center; gap: 9px; }
.nav-item svg { flex-shrink: 0; opacity: 0.7; }

/* ── View date ────────────────────────────────────────────── */
.view-date { font-size: 13px; color: #aaa; }

/* ── Side panels ──────────────────────────────────────────── */
.side-panel {
  position: fixed; top: 0; right: 0; width: 460px; height: 100vh;
  background: #fff; border-left: 1px solid #e8e8e4;
  box-shadow: -4px 0 24px rgba(0,0,0,0.06);
  transform: translateX(100%);
  transition: transform .25s ease; z-index: 200; overflow-y: auto;
  display: flex; flex-direction: column;
}
.side-panel.open { transform: translateX(0); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #f0f0ec; position: sticky; top: 0; background: #fff; z-index: 1; }
.panel-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #aaa; line-height: 1; padding: 0; }
.panel-close:hover { color: #1a1a1a; }
#panel-lead-body, #panel-tx-body { padding: 1.25rem 1.5rem; flex: 1; }

/* ── Modals ───────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #f0f0ec; position: sticky; top: 0; background: #fff; }
.modal-header button { background: none; border: none; font-size: 22px; cursor: pointer; color: #aaa; line-height: 1; }
.modal-body { padding: 1.5rem; }

/* ── Toggle / checkbox ────────────────────────────────────── */
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: #444; }
.toggle-input { display: none; }
.toggle-track { width: 36px; height: 20px; background: #ddd; border-radius: 20px; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left .2s; }
.toggle-input:checked + .toggle-track { background: #1a1a1a; }
.toggle-input:checked + .toggle-track::after { left: 19px; }

/* ── Multi-step form ──────────────────────────────────────── */
.form-steps { display: flex; gap: 0; margin-bottom: 1.5rem; background: #fff; border: 1px solid #e8e8e4; border-radius: 10px; overflow: hidden; }
.step { flex: 1; padding: 10px 8px; text-align: center; font-size: 12px; color: #aaa; border-right: 1px solid #e8e8e4; transition: all .15s; }
.step:last-child { border-right: none; }
.step.active { background: #1a1a1a; color: #fff; font-weight: 500; }
.step.done { background: #f5f5f3; color: #666; }
.form-page { display: none; }
.form-page.active { display: block; }
.form-nav { display: flex; gap: 10px; align-items: center; padding: 0.5rem 0; }

/* ── Offer comparison cards ───────────────────────────────── */
.offer-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.offer-card { background: #fff; border: 1px solid #e8e8e4; border-radius: 10px; padding: 1rem 1.25rem; }
.offer-card.accepted { border-color: #a0dbb8; background: #f6fff9; }
.offer-card.rejected { opacity: 0.5; }
.offer-amount { font-size: 22px; font-weight: 600; color: #1a1a1a; margin-bottom: 4px; }
.offer-buyer { font-size: 13px; color: #888; margin-bottom: 10px; }
.offer-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.offer-tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #f0f0f0; color: #555; }
.offer-tag.positive { background: #e6f7ee; color: #1a7a40; }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { margin: 0; padding: 0; }
.tl-item { display: flex; gap: 12px; margin-bottom: 14px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 5px; top: 20px; bottom: -14px; width: 1px; background: #f0f0ec; }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; }
.tl-dot-blue { background: #378ADD; }
.tl-dot-green { background: #3B6D11; }
.tl-dot-amber { background: #EF9F27; }
.tl-dot-gray { background: #ccc; }
.tl-content { flex: 1; }
.tl-note { font-size: 13px; color: #1a1a1a; }
.tl-time { font-size: 11px; color: #aaa; margin-top: 2px; }

/* ── Message thread ───────────────────────────────────────── */
.message-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1rem; max-height: 300px; overflow-y: auto; padding: 4px 0; }
.msg { max-width: 80%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.msg-agent { background: #1a1a1a; color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.msg-buyer { background: #f0f0ec; color: #1a1a1a; align-self: flex-start; border-bottom-left-radius: 3px; }
.msg-time { font-size: 10px; opacity: 0.6; margin-top: 3px; }
.msg-compose { display: flex; gap: 8px; margin-top: 8px; }
.msg-compose textarea { flex: 1; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; resize: none; font-family: inherit; }
.msg-compose button { align-self: flex-end; }

/* ── Vendor report ────────────────────────────────────────── */
.vendor-report-box { background: #f5f5f3; border-radius: 10px; padding: 1rem; margin-top: 1rem; }
.vendor-report-box textarea { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; resize: vertical; font-family: inherit; min-height: 100px; }

/* ── Calendar week view ───────────────────────────────────── */
.week-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.week-nav button { padding: 6px 14px; border: 1px solid #ddd; border-radius: 8px; background: none; cursor: pointer; font-size: 13px; }
.week-nav span { font-size: 14px; font-weight: 500; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { background: #fff; border: 1px solid #e8e8e4; border-radius: 8px; padding: 8px; min-height: 90px; }
.week-day-header { font-size: 11px; color: #888; margin-bottom: 6px; }
.week-day-date { font-size: 14px; font-weight: 500; color: #1a1a1a; }
.week-day.today { border-color: #1a1a1a; }
.viewing-pill { background: #1a1a1a; color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 6px; margin-bottom: 4px; cursor: pointer; line-height: 1.3; }
.viewing-pill.confirmed { background: #1a7a40; }
.viewing-pill.completed { background: #888; }
.viewing-pill.cancelled { background: #f0f0f0; color: #aaa; text-decoration: line-through; }

/* ── Stat progress bars ───────────────────────────────────── */
.progress-bar-wrap { background: #f0f0ec; border-radius: 4px; height: 5px; margin-top: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: #1a1a1a; border-radius: 4px; transition: width .4s; }

/* ── Message bubbles (agent portal) ──────────────────────── */
.msg { display: inline-block; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.msg-agent { background: #1a1a1a; color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; float: right; clear: both; }
.msg-buyer { background: #f0f0ec; color: #1a1a1a; align-self: flex-start; border-bottom-left-radius: 3px; float: left; clear: both; }
.message-thread::after { content: ''; display: table; clear: both; }

/* ── File uploader ────────────────────────────────────────── */
.pcrm-uploader { width: 100%; }

.pcrm-drop-zone {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fafaf8;
}
.pcrm-drop-zone:hover, .pcrm-drop-zone.drag-over {
  border-color: #1a1a1a;
  background: #f5f5f3;
}
.pcrm-drop-icon { color: #bbb; margin-bottom: 8px; }
.pcrm-drop-label { font-size: 13px; color: #555; font-weight: 500; }
.pcrm-drop-hint  { font-size: 12px; color: #aaa; margin-top: 4px; }

.pcrm-file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

.pcrm-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 9px;
  position: relative;
}
.pcrm-file-item.error { border-color: #fcc; background: #fff8f8; }
.pcrm-file-item.done  { border-color: #c8e6c9; }

.pcrm-file-icon { flex-shrink: 0; }
.pcrm-file-info { flex: 1; min-width: 0; }
.pcrm-file-name { font-size: 13px; font-weight: 500; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcrm-file-meta { font-size: 11px; color: #888; margin-top: 2px; }

.pcrm-file-progress { height: 3px; background: #f0f0ec; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.pcrm-file-progress-bar { height: 100%; background: #1a1a1a; border-radius: 3px; width: 0; transition: width .1s; }
.pcrm-file-item.done .pcrm-file-progress { display: none; }
.pcrm-file-item.error .pcrm-file-progress-bar { background: #e55; }

.pcrm-file-remove {
  background: none; border: none; color: #aaa; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px; margin-left: 4px;
  flex-shrink: 0;
}
.pcrm-file-remove:hover { color: #c00; }

.pcrm-file-link {
  font-size: 12px; color: #185FA5; margin-left: 8px;
  flex-shrink: 0; text-decoration: none;
}
.pcrm-file-link:hover { text-decoration: underline; }

/* ── Photo grid ───────────────────────────────────────────── */
.photo-reorder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.photo-grid-cell {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: grab;
  background: #f0f0ec;
  transition: border-color .15s, opacity .15s;
}
.photo-grid-cell:first-child { border-color: #1a1a1a; }
.photo-grid-cell.dragging  { opacity: .4; }
.photo-grid-cell.drag-target { border-color: #1a1a1a; border-style: dashed; }
.photo-grid-cell img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo-grid-badge {
  position: absolute; top: 5px; left: 5px;
  background: #1a1a1a; color: #fff;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
  letter-spacing: .03em;
}
.photo-grid-num {
  position: absolute; bottom: 5px; right: 6px;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 10px;
}
.photo-grid-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 14px; line-height: 20px;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  padding: 0;
}
.photo-grid-cell:hover .photo-grid-remove { display: flex; }
.photo-grid-add {
  border: 2px dashed #ddd; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fafaf8; transition: background .15s, border-color .15s;
}
.photo-grid-add:hover { background: #f5f5f3; border-color: #bbb; }

/* ── Analytics dashboard ──────────────────────────────────── */
.an-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.an-metric {
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 11px;
  padding: 1rem 1.25rem;
}
.an-metric-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.an-metric-value { font-size: 26px; font-weight: 700; color: #1a1a1a; display: flex; align-items: baseline; gap: 4px; }
.an-metric-sub   { font-size: 11px; color: #aaa; margin-top: 3px; }

.an-section {
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 11px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.an-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.an-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}
.an-two-col > div { margin-bottom: 1rem; }
.an-chart-wrap { position: relative; }

/* Period buttons */
.period-btn.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

@media (max-width: 768px) {
  .an-metrics   { grid-template-columns: 1fr 1fr; }
  .an-two-col   { grid-template-columns: 1fr; }
}

/* ── Inbox layout ─────────────────────────────────────────── */
.inbox-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 100px);
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 12px;
  overflow: hidden;
}

/* Conversation list */
.inbox-list {
  border-right: 1px solid #f0f0ec;
  overflow-y: auto;
}
.inbox-conv {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f3;
  transition: background .1s;
  position: relative;
}
.inbox-conv:hover  { background: #fafaf8; }
.inbox-conv.active { background: #f0ede8; }
.inbox-conv.unread .inbox-conv-name { font-weight: 700; }
.inbox-conv.unread .inbox-conv-preview { color: #1a1a1a; }

.inbox-conv-thumb {
  width: 42px; height: 42px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0; background: #f0f0ec;
}
.inbox-conv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inbox-conv-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #888; background: #e8e8e4;
}
.inbox-conv-body    { flex: 1; min-width: 0; }
.inbox-conv-top     { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 1px; }
.inbox-conv-name    { font-size: 13px; font-weight: 600; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-conv-time    { font-size: 11px; color: #aaa; flex-shrink: 0; }
.inbox-conv-prop    { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.inbox-conv-preview { font-size: 12px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-unread-dot {
  position: absolute; top: 12px; right: 12px;
  background: #1a1a1a; color: #fff;
  font-size: 10px; font-weight: 600;
  min-width: 18px; height: 18px;
  border-radius: 20px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}

/* Thread panel */
.inbox-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.inbox-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0ec;
  flex-shrink: 0;
  background: #fff;
}
.inbox-thread-name { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.inbox-thread-prop { font-size: 12px; color: #888; margin-top: 2px; }

.inbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafaf8;
}
.inbox-msg-row { display: flex; flex-direction: column; }
.inbox-msg-row--agent { align-items: flex-end; }
.inbox-msg-row--buyer { align-items: flex-start; }
.inbox-msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.inbox-msg-agent { background: #1a1a1a; color: #fff; border-bottom-right-radius: 4px; }
.inbox-msg-buyer { background: #fff; color: #1a1a1a; border: 1px solid #e8e8e4; border-bottom-left-radius: 4px; }
.inbox-msg-time  { font-size: 11px; color: #bbb; margin-top: 3px; padding: 0 4px; }

.inbox-compose {
  padding: 12px 16px;
  border-top: 1px solid #f0f0ec;
  background: #fff;
  flex-shrink: 0;
}
.inbox-compose textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 9px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  margin-bottom: 8px;
}
.inbox-compose textarea:focus { border-color: #1a1a1a; }
.inbox-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Empty state */
.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #aaa;
  text-align: center;
  padding: 2rem;
}

@media (max-width: 768px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-list { max-height: 220px; border-right: none; border-bottom: 1px solid #f0f0ec; }
}
