:root {
  --bg: #eaf4ff;
  --bg-strong: #d9ecff;
  --panel: #ffffff;
  --line: #bfd6ef;
  --text: #15233b;
  --muted: #5e718b;
  --primary: #1f6fd1;
  --primary-dark: #1557aa;
  --accent: #0d8bb8;
  --warn: #b56a00;
  --danger: #b42318;
  --soft: #e1f0ff;
  --soft-strong: #cfe6ff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 9px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  color: var(--primary);
  background: var(--soft);
  border: 1px solid #badcff;
}

.secondary:hover {
  background: var(--soft-strong);
}

.ghost {
  color: #24415f;
  background: #f7fbff;
  border: 1px solid var(--line);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.full {
  width: 100%;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
  min-height: 22px;
}

.warning {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #f6c36b;
  border-radius: 8px;
  background: #fff7e8;
  color: #8a4b00;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(92, 168, 255, 0.28), rgba(218, 240, 255, 0.64)),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(31, 111, 209, 0.13);
}

.login-panel h1 {
  margin: 0;
  font-size: 28px;
}

.form-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 6px;
  color: #3e4a5e;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fbfdff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.20);
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  background: #1976d2;
  color: #fff;
  box-shadow: 8px 0 26px rgba(31, 111, 209, 0.14);
}

.brand {
  display: grid;
  gap: 4px;
  padding: 2px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.brand strong {
  font-size: 19px;
  letter-spacing: 0;
}

.brand span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

nav {
  display: grid;
  align-content: start;
  gap: 3px;
  overflow-y: auto;
  padding: 0 4px 8px;
}

.nav-section {
  margin: 16px 8px 7px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
}

.nav-section:first-child {
  margin-top: 0;
}

nav button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.notification-button {
  position: relative;
}

.notification-badge {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 10px;
  background: #e02020;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.notification-button .notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
}

.text-button {
  color: var(--primary);
  background: transparent;
  padding: 4px 0;
  justify-self: start;
}

nav button.active,
nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

nav button.active {
  box-shadow: inset 3px 0 0 #fff, 0 2px 10px rgba(11, 61, 126, 0.12);
}

.workspace {
  min-width: 0;
}

.test-mode-banner {
  padding: 10px 18px;
  background: #fff2cc;
  border-bottom: 1px solid #e1ad35;
  color: #744b00;
  font-size: 13px;
  font-weight: 750;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(234, 244, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.counselor-self-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.counselor-self-status h3,
.counselor-self-status p {
  margin: 0;
}

.customer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  padding: 12px;
  border-left: 3px solid var(--primary);
  background: var(--soft);
  color: #344054;
  font-size: 13px;
}

.customer-summary strong {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 15px;
}

.file-picker-row,
.proof-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.option-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-group {
  margin: 0;
}

.option-list {
  display: grid;
  gap: 0;
}

.option-add-form {
  display: flex;
  gap: 8px;
  margin: 12px 0 8px;
}

.option-add-form input {
  min-width: 0;
  flex: 1;
}

.option-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 6px 10px;
  border-bottom: 1px solid var(--line);
}

.option-item > span {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 650;
}

.option-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.danger-text {
  color: var(--danger);
  background: transparent;
}

.read-confirmed {
  min-width: 42px;
  color: #176b3a;
  background: #e4f6ea;
  border-color: #96d5aa;
  font-size: 16px;
  font-weight: 800;
}

.toast.success {
  background: #176b3a;
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 760;
  line-height: 1.2;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

#content {
  padding: 20px 28px 40px;
}

.band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(31, 111, 209, 0.055);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h3,
.section-head p {
  margin: 0;
}

.section-head p {
  margin-top: 4px;
}

.band > h3,
.section-head h3 {
  color: #1e3554;
  font-size: 18px;
  font-weight: 740;
  line-height: 1.35;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 88px;
  box-shadow: 0 8px 22px rgba(31, 111, 209, 0.06);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 9px;
  font-size: 24px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(130px, 180px)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(2, minmax(165px, 1fr));
  gap: 12px 14px;
  align-items: end;
}

.filter-grid button {
  justify-self: start;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(31, 111, 209, 0.055);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.lead-table {
  min-width: 1120px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #445168;
  background: #e2f0ff;
  font-weight: 750;
}

tr:hover td {
  background: #f3f9ff;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf6f4;
  color: #0d6f65;
  font-size: 12px;
  font-weight: 700;
}

.pill.warn {
  background: #fff4df;
  color: var(--warn);
}

.pill.danger {
  background: #fee4e2;
  color: var(--danger);
}

.pill.success {
  background: #dcfce7;
  color: #167044;
}

.pill.info {
  background: #dff3ff;
  color: #166b94;
}

.field-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 5px;
  border: 1px solid #78a9c7;
  border-radius: 50%;
  color: #236889;
  font-size: 11px;
  font-weight: 800;
  cursor: help;
}

.field-help::after {
  content: attr(data-help);
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(280px, 70vw);
  padding: 9px 10px;
  border-radius: 6px;
  background: #17384a;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.field-help:hover::after,
.field-help:focus::after {
  opacity: 1;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
}

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  font-size: 14px;
}

.kv span:nth-child(odd) {
  color: var(--muted);
}

.list {
  display: grid;
  gap: 10px;
}

.record {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.record p {
  margin: 6px 0 0;
}

.notification {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.notification.unread {
  border-left: 4px solid var(--primary);
  background: #f5faff;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 80px rgba(21, 87, 170, 0.24);
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.42);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

#modalBody {
  padding: 16px;
}

.fallback-open {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.testing-panel {
  border-color: #e1ad35;
  background: #fffdf6;
}

.testing-actions {
  margin-top: 16px;
}

.toggle-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e1ad35;
  border-radius: 6px;
  background: #fff7df;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 168px;
}

.link-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 750;
}

.cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cell-note {
  margin-top: 8px;
  max-width: 260px;
  color: #24415f;
}

.cell-danger {
  margin-top: 5px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.compact-input {
  width: 84px;
  padding: 7px 8px;
}

.handover-toolbar,
.pagination {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.pagination {
  align-items: center;
  color: var(--muted);
}

.profile-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.profile-images a {
  color: var(--primary);
  word-break: break-all;
}

.profile-images img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.profile-image {
  margin: 0;
  min-width: 0;
}

.profile-image figcaption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reset-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.reset-tabs .active {
  background: #dceeff;
  border-color: #6faeea;
  color: #1557aa;
}

.settings-panel {
  max-width: 640px;
}

.attachment-text {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  word-break: break-all;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid #a6d0ff;
  border-radius: 8px;
  background: #f7fbff;
  color: #173960;
  box-shadow: 0 16px 44px rgba(21, 87, 170, 0.18);
}

.toast.error {
  border-color: #fecdca;
  background: #fff5f5;
  color: var(--danger);
}

.toast.success {
  border-color: #96d5aa;
  background: #176b3a;
  color: #fff;
}

.csv-box {
  min-height: 180px;
}

.import-progress {
  width: 100%;
  height: 12px;
  margin-top: 14px;
  accent-color: var(--primary);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 2px 4px;
  color: var(--muted);
  font-size: 14px;
}

.pager-summary {
  margin: 10px 2px 0;
  text-align: right;
}

@media (max-width: 1100px) {
  .stats,
  .grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }

  .sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-section {
    display: none;
  }

  .sidebar nav button {
    width: auto;
  }

  .sidebar #logoutBtn {
    width: auto;
  }

  .toolbar,
  .filter-grid,
  .option-groups,
  .customer-summary,
  .grid-2,
  .grid-3,
  .grid-4,
  .stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  #content {
    padding: 14px;
  }

  .notification {
    flex-direction: column;
  }

  .pager {
    justify-content: space-between;
    gap: 8px;
  }

}

/* Apple-inspired desktop refinement: quiet surfaces, one clear action color, and stable rhythm. */
:root {
  --bg: #f5f5f7;
  --bg-strong: #ececef;
  --panel: #ffffff;
  --line: #e5e5ea;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --primary: #007aff;
  --primary-dark: #0066d6;
  --accent: #0071c9;
  --warn: #b26a00;
  --danger: #d92d20;
  --soft: #edf6ff;
  --soft-strong: #dceeff;
  --radius: 10px;
  --control-height: 42px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  letter-spacing: 0;
}

button {
  min-height: var(--control-height);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .23);
  outline-offset: 1px;
}

.primary {
  background: var(--primary);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}

.primary:hover { background: var(--primary-dark); }

.secondary {
  color: var(--primary);
  background: rgba(0, 122, 255, .09);
  border-color: transparent;
}

.secondary:hover { background: rgba(0, 122, 255, .15); }

.ghost {
  color: #3a3a3c;
  background: rgba(118, 118, 128, .10);
  border-color: transparent;
}

.ghost:hover { background: rgba(118, 118, 128, .16); }

input,
select,
textarea {
  min-height: var(--control-height);
  border-color: #d1d1d6;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, .02);
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  height: var(--control-height);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .16);
}

label {
  gap: 6px;
  color: #48484a;
  font-size: 12px;
  font-weight: 650;
}

.login-shell {
  background: #f5f5f7;
}

.login-panel {
  width: min(400px, 100%);
  border-color: rgba(0, 0, 0, .08);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .10);
}

.login-panel h1 {
  font-size: 26px;
  letter-spacing: 0;
}

.app {
  grid-template-columns: 222px minmax(0, 1fr);
}

.sidebar {
  padding: 20px 12px 14px;
  background: rgba(255, 255, 255, .88);
  color: var(--text);
  border-right: 1px solid rgba(0, 0, 0, .08);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.brand {
  gap: 2px;
  padding: 4px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.brand strong {
  font-size: 18px;
  font-weight: 760;
  color: #1d1d1f;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

nav {
  gap: 2px;
  padding: 2px 3px 8px;
}

.nav-section {
  margin: 17px 9px 6px;
  color: #3a3a3c;
  font-size: 17px;
  font-weight: 760;
  line-height: 1.25;
}

nav button {
  min-height: 34px;
  padding: 7px 10px;
  color: #3a3a3c;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 580;
}

nav button.active,
nav button:hover {
  color: #1d1d1f;
  background: rgba(0, 122, 255, .11);
}

nav button.active {
  color: #005fbe;
  box-shadow: none;
  font-weight: 700;
}

.sidebar #logoutBtn {
  color: #636366;
  background: transparent;
  border: 0;
  text-align: left;
  padding-left: 10px;
}

.sidebar #logoutBtn:hover { background: rgba(118, 118, 128, .10); }

.notification-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff3b30;
  box-shadow: 0 0 0 2px #fff;
}

.workspace { background: var(--bg); }

.topbar {
  min-height: 82px;
  padding: 17px 32px 14px;
  background: rgba(245, 245, 247, .82);
  border-bottom: 0;
  backdrop-filter: blur(18px);
}

.topbar h2 {
  color: #1d1d1f;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
}

#content {
  max-width: 1680px;
  padding: 8px 32px 44px;
}

.band {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: none;
}

.section-head {
  margin-bottom: 16px;
}

.band > h3,
.section-head h3 {
  color: #1d1d1f;
  font-size: 18px;
  font-weight: 720;
}

.section-head p,
.muted { color: var(--muted); }

.stats { gap: 10px; }

.stat {
  min-height: 82px;
  border-color: rgba(0, 0, 0, .07);
  border-radius: 11px;
  padding: 14px 15px;
  box-shadow: none;
}

.stat strong {
  margin-top: 7px;
  color: #1d1d1f;
  font-size: 23px;
}

.toolbar,
.filter-grid {
  gap: 12px;
}

.filter-grid {
  grid-template-columns: minmax(220px, 1.45fr) repeat(2, minmax(160px, 1fr));
}

.lead-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.lead-filter-keyword { grid-column: auto; }
.lead-filter-product { grid-column: auto; }

.lead-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.lead-filter-actions .secondary { min-width: 132px; }

.compact-section-head {
  min-height: 34px;
  margin-bottom: 14px;
}

.transaction-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.transaction-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.refund-form-grid {
  align-items: end;
}

.refund-submit-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

@media (max-width: 1200px) {
  .lead-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lead-filter-actions { grid-column: 1 / -1; }
}

.table-wrap {
  border-color: rgba(0, 0, 0, .08);
  border-radius: 12px;
  box-shadow: none;
}

th,
td {
  border-bottom-color: #ececef;
  padding: 11px 13px;
}

th {
  color: #6e6e73;
  background: #fafafa;
  font-size: 12px;
  font-weight: 700;
}

tr:hover td { background: #f8fbff; }

.row-actions { gap: 6px; }

.link-button {
  color: #0071c9;
  font-weight: 650;
}

.record {
  border-color: #e8e8ed;
  border-radius: 10px;
  padding: 13px 14px;
}

.notification.unread {
  border-left-color: var(--primary);
  background: #f6fbff;
}

.pill {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 650;
}

.option-groups { gap: 16px; }
.option-group { padding: 18px 20px; }

.option-item {
  min-height: 44px;
  padding: 6px 0 6px 2px;
}

.option-item:hover { background: #fafafa; }

.option-actions { gap: 5px; }

.icon-button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: transparent;
  color: #48484a;
  font-size: 18px;
}

.icon-button:hover { background: rgba(118, 118, 128, .12); }
.icon-button.danger-text:hover { background: #fff0ef; }

dialog {
  border-color: rgba(0, 0, 0, .12);
  border-radius: 14px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .22);
}

dialog::backdrop { background: rgba(0, 0, 0, .28); backdrop-filter: blur(3px); }
.modal-head { padding: 16px 20px; border-bottom-color: #e8e8ed; }
#modalBody { padding: 20px; }

.toast {
  border-color: rgba(0, 0, 0, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  color: #1d1d1f;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}

.toast.success { background: #1d1d1f; border-color: #1d1d1f; }

@media (max-width: 760px) {
  .sidebar {
    background: rgba(255, 255, 255, .96);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand { border-bottom: 0; padding: 2px 6px; }
  .topbar { padding: 16px 18px 12px; }
  .topbar h2 { font-size: 24px; }
  #content { padding: 8px 14px 32px; }
  .band { padding: 16px; }
  .lead-filter-grid { grid-template-columns: 1fr; }
  .lead-filter-keyword,
  .lead-filter-product,
  .lead-filter-actions { grid-column: auto; }
  .transaction-filter-grid { grid-template-columns: 1fr; }
  .transaction-filter-actions,
  .refund-submit-row { grid-column: auto; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
