/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0e1117;
  color: #e0e6f0;
  min-height: 100vh;
}
a { color: #4da6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #14203d;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #1e2d4a;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav .brand { font-weight: 700; font-size: 1.05rem; color: #fff; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: #a0b4cc; font-size: 0.9rem; }
.nav-links a.active, .nav-links a:hover { color: #fff; }
.nav-links .logout { color: #e05555 !important; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
button, .btn { cursor: pointer; border: none; border-radius: 6px; padding: 0.45rem 0.9rem; }
.btn-primary { background: #2563eb; color: #fff; font-weight: 600; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: transparent; border: 1px solid #334155; color: #a0b4cc; }
.btn-outline:hover { border-color: #4da6ff; color: #fff; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.btn-danger { background: #7f1d1d; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }
.btn-delete-contact { background: #3d0f0f; color: #f87171; font-size: 0.72rem; opacity: 0.7; }
.btn-delete-contact:hover { background: #7f1d1d; opacity: 1; }
.btn-action {
  background: #1e2d4a;
  color: #c8d8f0;
  border: 1px solid #2a3d5e;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.btn-action:hover { background: #263652; border-color: #4da6ff; }
.btn-icon { background: transparent; color: #556; padding: 0; font-size: 0.85rem; }
.btn-icon:hover { color: #e05555; }
.close-btn { background: transparent; color: #a0b4cc; font-size: 1.1rem; cursor: pointer; border: none; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
input[type=text], input[type=email], input[type=tel], input[type=search],
input[type=date], input[type=password], select, textarea {
  background: #1a2540;
  border: 1px solid #2a3d5e;
  color: #e0e6f0;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  width: 100%;
  color-scheme: dark;
}
input[type=date]::-webkit-calendar-picker-indicator {
  filter: invert(0.8) brightness(1.4);
  cursor: pointer;
  padding: 2px;
}
input::placeholder { color: #4a5a72; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
}
select option { background: #1a2540; }
.form-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.form-row > * { flex: 1; min-width: 0; }
.form-grid { display: grid; gap: 0.5rem; margin-bottom: 0.75rem; }
.form-grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; color: #a0b4cc; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
textarea { resize: vertical; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-weight: 600;
}
.badge-customer { background: #1a3a1a; color: #4ade80; }
.badge-bl { background: #3a1a1a; color: #f87171; }
.badge-state { background: #1a2a3a; color: #60a5fa; }
.badge-src { background: #2a1a3a; color: #c084fc; }

/* ── Collapsibles ─────────────────────────────────────────────────────────── */
.collapsible {
  background: #131d30;
  border: 1px solid #2a3d5e;
  border-radius: 8px;
  padding: 1rem;
  margin: 0.75rem 0;
}
.collapsible h4 { margin-bottom: 0.75rem; color: #a0b4cc; font-size: 0.9rem; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: #131d30;
  border: 1px solid #2a3d5e;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo { font-size: 2.5rem; margin-bottom: 0.75rem; }
.login-box h1 { font-size: 1.1rem; color: #c8d8f0; margin-bottom: 1.5rem; }
.login-box input { margin-bottom: 1rem; }
.login-box button { width: 100%; background: #2563eb; color: #fff; font-weight: 600; padding: 0.6rem; border-radius: 6px; cursor: pointer; border: none; font-size: 1rem; }
.login-box button:hover { background: #1d4ed8; }
.err { color: #f87171; font-size: 0.85rem; margin-bottom: 0.75rem; }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.dashboard { padding: 1rem; max-width: 1200px; margin: 0 auto; }

.dash-search-wrap { position: relative; margin-bottom: 1rem; }
.dash-search-wrap input[type=search] { width: 100%; font-size: 0.95rem; padding: 0.6rem 1rem; }
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: #131d30; border: 1px solid #2a3d5e; border-radius: 8px;
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.search-result {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 1rem; text-decoration: none; color: inherit;
  border-bottom: 1px solid #1e2d4a;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: #1a2d4a; }
.sr-name { font-size: 0.9rem; font-weight: 600; color: #c8d8f0; }
.sr-hint { font-size: 0.78rem; color: #6b7fa0; white-space: nowrap; }
.sr-empty { display: block; padding: 0.6rem 1rem; font-size: 0.85rem; color: #4a5a72; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.metric {
  background: #131d30;
  border: 1px solid #1e2d4a;
  border-radius: 8px;
  padding: 0.9rem;
  text-align: center;
}
.metric-val { display: block; font-size: 1.8rem; font-weight: 700; color: #4da6ff; }
.metric-val.warn { color: #f59e0b; }
.metric-lbl { font-size: 0.78rem; color: #6b7fa0; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dash-left { display: flex; flex-direction: column; gap: 1rem; }
.dash-section { background: #131d30; border: 1px solid #1e2d4a; border-radius: 8px; padding: 1rem; }
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.section-hdr h2 { font-size: 0.95rem; color: #a0b4cc; }
.dash-section > h2 { font-size: 0.95rem; color: #a0b4cc; margin-bottom: 0.75rem; }

/* Task list */
.task-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.task-card-wrap { }
.task-card-wrap[draggable="true"] { cursor: grab; }
.task-card-wrap.dragging { opacity: 0.3; }
.task-x {
  position: absolute; top: 5px; right: 6px;
  color: #3a5070; font-size: 11px; line-height: 1;
  cursor: pointer; padding: 0 2px; border-radius: 2px;
  user-select: none;
}
.task-x:hover { color: #ef4444; background: rgba(239,68,68,0.15); }
.task-confirm {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.55rem 0.7rem;
  background: #0e1a2a; border: 1px solid #2563eb; border-radius: 6px;
  font-size: 0.82rem; color: #c8d8f0;
}
.task-confirm span { flex: 1; min-width: 0; }
.confirm-yes, .confirm-no {
  padding: 3px 10px; border-radius: 4px; border: none;
  font-size: 0.78rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.confirm-yes { background: #22c55e; color: #0a1628; }
.confirm-yes:hover { background: #16a34a; }
.confirm-no { background: #1e2d4a; color: #a0b4cc; }
.confirm-no:hover { background: #2a3d5a; }
.task-item {
  position: relative;
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: #0e1a2a; border: 1px solid #1e2d4a; border-radius: 6px;
  padding: 0.6rem 1.3rem 0.6rem 0.6rem; text-decoration: none; color: inherit; width: 100%; box-sizing: border-box;
}
.task-item:hover { border-color: #2563eb; }
.task-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.urgency-0 .task-dot { background: #ef4444; }
.urgency-1 .task-dot { background: #f59e0b; }
.urgency-2 .task-dot { background: #eab308; }
.urgency-3 .task-dot { background: #22c55e; }
.urgency-0 { border-left: 3px solid #ef4444 !important; }
.urgency-1 { border-left: 3px solid #f59e0b !important; }
.urgency-2 { border-left: 3px solid #eab308 !important; }
.urgency-3 { border-left: 3px solid #22c55e !important; }
.task-name { font-size: 0.85rem; font-weight: 600; color: #c8d8f0; }
.task-text { font-size: 0.8rem; color: #a0b4cc; }
.task-flup { font-size: 0.75rem; color: #6b7fa0; margin-top: 2px; }

/* Recent activity */
.activity-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.activity-item {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: #0e1a2a; border: 1px solid #1e2d4a; border-radius: 6px;
  padding: 0.5rem 0.7rem; text-decoration: none; color: inherit;
}
.activity-item:hover { border-color: #2563eb; }
.ch-icon { font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.activity-name { font-size: 0.85rem; font-weight: 600; color: #c8d8f0; }
.activity-notes { font-size: 0.75rem; color: #8a9ab8; margin-top: 1px; line-height: 1.3; }
.activity-meta { font-size: 0.75rem; color: #6b7fa0; margin-top: 2px; }

/* ── Contact drawer ───────────────────────────────────────────────────────── */
.contacts-top-bar { display: flex; align-items: center; gap: 0.6rem; }
.contacts-top-bar input[type=search] { flex: 1; max-width: 500px; }

.drawer { position: fixed; inset: 0; z-index: 300; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 96%; max-width: none; min-width: 360px;
  background: #0d1623;
  border-left: 1px solid #1e2d4a;
  overflow-y: auto;
}

/* ── CRM layout ───────────────────────────────────────────────────────────── */
.crm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 47px);
  overflow: hidden;
}
.crm-sidebar {
  border-right: 1px solid #1e2d4a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-controls {
  padding: 0.6rem;
  border-bottom: 1px solid #1e2d4a;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #0d1623;
}
.filter-row { display: flex; gap: 0.4rem; }
.filter-row select { flex: 1; font-size: 0.8rem; padding: 0.3rem 0.4rem; }
#contact-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.list-count { font-size: 0.75rem; color: #4a5a72; padding: 0.25rem 0.4rem; }
.contact-row {
  display: block;
  width: 100%;
  text-align: left;
  background: #0e1a2a;
  border: 1px solid #1e2d4a;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  color: inherit;
}
.contact-row:hover { border-color: #2563eb; background: #111e33; }
.contact-row.blacklisted { opacity: 0.5; }
.cr-name { font-size: 0.88rem; font-weight: 600; color: #c8d8f0; margin-bottom: 2px; }
.cr-pref { font-size: 0.78rem; font-weight: 400; color: #5a7090; margin-left: 4px; }
.td-addr-sub { font-size: 0.76rem; color: #a0b4cc; margin-top: 2px; }
.cr-meta { font-size: 0.75rem; color: #5a7090; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-todo { font-size: 0.72rem; color: #a78bfa; margin-top: 2px; }
.cr-flup { font-size: 0.72rem; color: #f59e0b; margin-top: 1px; }

/* ── Contact detail ───────────────────────────────────────────────────────── */
.crm-main { overflow-y: auto; }
#contact-detail { padding: 1rem; }
.detail-empty { display: flex; align-items: center; justify-content: center; height: 60vh; color: #3a4a60; font-size: 1.1rem; }
.detail-header { border-bottom: 1px solid #1e2d4a; padding-bottom: 1rem; margin-bottom: 1rem; }
.detail-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.detail-name-row h2 { font-size: 1.3rem; color: #e8f0ff; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.detail-info-grid { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.info-row { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.88rem; }
.info-lbl { min-width: 1.4rem; text-align: center; }
.notes-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.note-chip { background: #1a2540; border: 1px solid #2a3a55; border-radius: 4px; padding: 0.25rem 0.6rem; font-size: 0.8rem; color: #a0b4cc; }
.flup-todo-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.flup-chip { padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.82rem; border: 1px solid; }
.flup-chip.urgency-0 { background: #2a0a0a; border-color: #ef4444; color: #fca5a5; }
.flup-chip.urgency-1 { background: #2a1a0a; border-color: #f59e0b; color: #fcd34d; }
.flup-chip.urgency-2 { background: #1f1a0a; border-color: #eab308; color: #fde047; }
.flup-chip.urgency-3 { background: #0a1f0a; border-color: #22c55e; color: #86efac; }
.flup-chip.urgency-9 { background: #1a2540; border-color: #2a3a55; color: #6b7fa0; }
.todo-chip { background: #1e1530; border: 1px solid #4a3a6a; border-radius: 4px; padding: 0.25rem 0.6rem; font-size: 0.82rem; color: #c4b5fd; }
.comm-pills { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.btn-comm {
  font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem;
  border-radius: 20px; border: 1px solid #2a3d5e;
  background: #1a2540; color: #8a9ab8; cursor: pointer;
}
.btn-comm:hover { border-color: #4da6ff; color: #c8d8f0; }
.comm-active-wa  { background: #166534 !important; border-color: #4ade80 !important; color: #dcfce7 !important; font-weight: 800 !important; box-shadow: 0 0 6px #22c55e88 !important; }
.comm-active-wab { background: #14532d !important; border-color: #86efac !important; color: #dcfce7 !important; font-weight: 800 !important; box-shadow: 0 0 6px #4ade8088 !important; }
.comm-active-txt { background: #1e3a6e !important; border-color: #93c5fd !important; color: #eff6ff !important; font-weight: 800 !important; box-shadow: 0 0 6px #60a5fa88 !important; }
.comm-active-email { background: #3730a3 !important; border-color: #a5b4fc !important; color: #eef2ff !important; font-weight: 800 !important; box-shadow: 0 0 6px #818cf888 !important; }

.action-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Activity log */
.activity-section-hdr { margin: 1rem 0 0.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.activity-section-hdr h3 { font-size: 0.95rem; color: #6b7fa0; margin: 0; }
.bulk-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; background: #0a1520; border: 1px solid #1e3060; border-radius: 6px; font-size: 0.82rem; color: #8aabcf; }
.entry-list { display: flex; flex-direction: column; gap: 0.5rem; }
.entry-item { background: #0e1a2a; border: 1px solid #1e2d4a; border-radius: 6px; padding: 0.6rem 0.75rem; }
.entry-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: #5a7090; flex-wrap: wrap; margin-bottom: 0.25rem; }
.entry-icon { font-size: 0.9rem; }
.entry-channel { font-weight: 600; color: #a0b4cc; }
.entry-ts { color: #4a5a72; }
.entry-to { color: #4da6ff; }
.entry-del { margin-left: auto; }
.entry-subject { font-size: 0.88rem; font-weight: 600; color: #c8d8f0; margin-bottom: 0.2rem; }
.entry-body { font-size: 0.82rem; color: #7a9ab8; white-space: pre-wrap; word-break: break-word; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #131d30;
  border: 1px solid #2a3d5e;
  border-radius: 10px;
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-hdr h3 { font-size: 1rem; }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.empty { color: #3a4a60; font-size: 0.85rem; padding: 0.5rem 0; }
main { flex: 1; }

/* ── Back button (contact detail → contacts list) ─────────────────────────── */
.back-btn {
  display: inline-block;
  color: #5b8fe8;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.3rem 0;
  margin-bottom: 0.5rem;
}
.back-btn:hover { color: #7aaaf0; text-decoration: underline; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .crm-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .crm-sidebar { height: 240px; border-right: none; border-bottom: 1px solid #1e2d4a; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .task-list { grid-template-columns: 1fr; }
  .activity-list { grid-template-columns: 1fr; }
  .crm-main { height: auto; }
  .drawer-panel { width: 100%; min-width: 0; }
  /* Nav wraps on small screens */
  .topnav { flex-wrap: wrap; gap: 0.4rem; }
  .nav-links { flex-wrap: wrap; gap: 0.6rem; font-size: 0.82rem; }
}
@media (max-width: 400px) {
  html { font-size: 14px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ── Prospects DB + Sales History pages ──────────────────────────────────────── */
.tbl-page { padding: 1rem; max-width: 1400px; margin: 0 auto; }
.tbl-controls { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.tbl-controls input[type=search] { max-width: 500px; }
.page-hdr { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.page-hdr h2 { font-size: 1.1rem; color: #c8d8f0; }
.count-chip { background: #1a2540; border: 1px solid #2a3d5e; border-radius: 20px; padding: 0.2rem 0.7rem; font-size: 0.8rem; color: #6b7fa0; }
.table-meta { font-size: 0.8rem; color: #4a5a72; margin-bottom: 0.4rem; }
.data-table-wrap { overflow-x: auto; border: 1px solid #1e2d4a; border-radius: 8px; }
.data-tbl { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-tbl thead { background: #0d1623; position: sticky; top: 0; z-index: 10; }
.data-tbl th { padding: 0.5rem 0.7rem; text-align: left; color: #6b7fa0; font-weight: 600; white-space: nowrap; border-bottom: 1px solid #1e2d4a; }
.data-tbl td { padding: 0.4rem 0.7rem; border-bottom: 1px solid #111927; vertical-align: top; }
.data-tbl tbody tr:hover td { background: #0f1a2a; }
.data-tbl tbody tr:last-child td { border-bottom: none; }
.row-cust td { background: #0a1a0a; }
.row-cust:hover td { background: #0e1f0e !important; }
.row-bl { opacity: 0.5; }
.contact-link { color: #c8d8f0; font-weight: 600; text-decoration: none; }
.contact-link:hover { color: #4da6ff; }
.td-name { min-width: 140px; max-width: 200px; }
.td-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4da6ff; font-size: 0.78rem; }
.td-phone { white-space: nowrap; font-size: 0.78rem; color: #a0b4cc; }
.td-src { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6b7fa0; font-size: 0.78rem; }
.td-sold { max-width: 320px; white-space: normal; word-break: break-word; color: #c8d8f0; font-size: 0.78rem; line-height: 1.35; }
.td-notes { max-width: 200px; color: #7a9ab8; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-flup { white-space: nowrap; font-size: 0.78rem; color: #6b7fa0; }
.td-flup.has-flup { color: #f59e0b; }
.td-ts { white-space: nowrap; font-size: 0.75rem; color: #4a5a72; }
.td-todo { font-size: 0.72rem; color: #a78bfa; margin-top: 2px; }
.badge-prospect { background: #1a2030; color: #4a6a90; border: 1px solid #2a3550; }
.pagination { display: flex; align-items: center; gap: 0.75rem; justify-content: center; padding: 0.75rem 0; }
.page-info { font-size: 0.82rem; color: #4a5a72; }

/* Bills */
.address-link { color: #a0b4cc; text-decoration: none; }
.address-link:hover { color: #4da6ff; text-decoration: underline; }
.dist-badge { margin-left: 0.35rem; font-size: 0.75rem; color: #4a7a9b; text-decoration: none; }
.dist-badge:hover { color: #4da6ff; }
.dist-fetch { margin-left: 0.35rem; font-size: 0.72rem; color: #2a4a60; cursor: pointer; }
.dist-fetch:hover { color: #4a8abf; }

.bills-section { background: #0e1622; border: 1px solid #1e2d42; border-radius: 6px; padding: 0.5rem 0.75rem; margin: 0.5rem 0; }
.bills-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.bills-title { font-size: 0.78rem; font-weight: 600; color: #3a6a9a; }
.bills-list { display: flex; flex-direction: column; gap: 0.25rem; }
.bill-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bill-link { font-size: 0.78rem; color: #5a8abf; text-decoration: none; }
.bill-link:hover { color: #7ab4ef; text-decoration: underline; }
.bills-empty { font-size: 0.72rem; color: #2a3a50; }
.bill-meta { color: #3a5a7a; font-size: 0.72rem; }
.bill-name-diff { color: #b45309; }
.bills-header .btn-sm { font-size: 0.68rem; padding: 0.1rem 0.4rem; color: #3a5a7a; border-color: #1e2d42; background: transparent; }
.bills-header .btn-sm:hover { color: #5a8abf; border-color: #3a5a7a; }
.bill-row .btn-sm { font-size: 0.65rem; padding: 0.05rem 0.3rem; color: #3a3a4a; border-color: #1e2030; background: transparent; opacity: 0.6; }
.bill-row .btn-sm:hover { opacity: 1; color: #f87171; border-color: #7f1d1d; }

/* Sales History */
.sales-section h3 { font-size: 0.9rem; color: #6b7fa0; margin-bottom: 0.5rem; }
.s-num { color: #3a4a60; font-size: 0.78rem; width: 2rem; text-align: right; padding-right: 0.5rem; }
.s-date { white-space: nowrap; color: #c8d8f0; font-size: 0.82rem; }

/* ── Pinned note block ───────────────────────────────────────────── */
.pinned-note {
  background: #1a2540; border: 1px solid #2a3a55; border-radius: 6px;
  padding: 0.6rem; font-size: 0.82rem; color: #a0b4cc;
  margin-bottom: 0.75rem; white-space: pre-wrap; cursor: pointer;
  width: 100%; line-height: 1.2; box-sizing: border-box;
}
.pinned-note:hover { border-color: #f7c948; color: #c8d8e8; }
.pinned-note-empty { border-style: dashed; background: transparent; }
.pinned-note-placeholder { color: #3d4a5c; font-style: italic; }

/* ── Note collapsible panel ──────────────────────────────────────── */
.collapsible-panel { display: none; margin-bottom: 0.75rem; }
.collapsible-panel.open { display: block; }

/* ── Linked proposals section ───────────────────────────────────── */
.proposals-section { margin-bottom: 1rem; }
.proposals-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; color: #5a7a99; margin-bottom: 0.4rem; }
.proposal-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.6rem; background: #0f1a2e; border-radius: 6px; margin-bottom: 0.3rem; gap: 0.5rem; }
.proposal-name { flex: 1; min-width: 0; }
.proposal-admin-link { color: #a0b4cc; font-size: 0.85rem; text-decoration: none; }
.proposal-admin-link:hover { color: #f7c948; }
.proposal-links { display: flex; gap: 0.5rem; flex-shrink: 0; }
.proposal-link { font-size: 0.78rem; color: #5a9fd4; text-decoration: none; white-space: nowrap; }
.proposal-link:hover { color: #f7c948; }
.signed-link { color: #4caf74; }
.signed-link:hover { color: #6fcf97; }
