:root {
  --page: #f5f5f5;
  --surface: #ffffff;
  --text: #222222;
  --muted: #666666;
  --border: #e0e0e0;
  --input: #fafafa;
  --brand: #1a1a1a;
  --brand-hover: #000000;
  --danger: #d9534f;
  --danger-bg: #fff0f0;
  --success: #1f8f55;
  --success-bg: #eefaf3;
  --warning: #b56a00;
  --warning-bg: #fff7e8;
  --info: #2563a8;
  --info-bg: #edf5ff;
  --radius: 10px;
  --shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--text);
  font-family: "Helvetica Neue", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-top: 60px;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.brand-row {
  display: contents;
}

.brand {
  order: 1;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 38px;
  width: auto;
}

.nav {
  order: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  flex: 1;
}

.nav button {
  border: 0;
  background: transparent;
  color: #333;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .8px;
  padding: 8px 0;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.nav button.active,
.nav button:hover {
  border-bottom-color: #777;
}

.nav button.disabled,
.nav button.disabled:hover {
  color: #a0a0a0;
  cursor: not-allowed;
  border-bottom-color: transparent;
}

.user-area {
  order: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  margin-left: auto;
}

.user-display {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.user-display .role {
  color: var(--muted);
  font-weight: 500;
}

.page {
  padding: 32px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
}

h2 {
  font-size: 28px;
  font-weight: 600;
}

h3 {
  font-size: 18px;
  font-weight: 600;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 26px;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr);
}

.user-management {
  grid-template-columns: 360px minmax(0, 1fr);
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 16px;
}

.user-search-filters {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 240px;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.search-input-wrapper input {
  padding-left: 36px !important;
  min-height: 40px;
}

#userSearchRole {
  min-height: 40px;
  width: 180px;
}

.subtitle.compact {
  margin: 4px 0 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 80px;
  padding: 12px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stat-number {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.stat-number.OVERDUE {
  color: #c92a2a;
  font-weight: 700;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.lead-filters {
  display: grid;
  align-items: center;
}

.lead-filters.has-spoc {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 180px) minmax(180px, 220px) auto;
}

.lead-filters.no-spoc {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 180px) auto;
}

.lead-filters .btn {
  white-space: nowrap;
}

.tab-selector {
  display: flex;
  gap: 4px;
  margin: 4px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
}

.tab-selector button {
  flex: 1 0 auto;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tab-selector button.active,
.tab-selector button[aria-selected="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .08);
}

.followup-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
  align-items: center;
}

.followup-filters .btn {
  white-space: nowrap;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #444;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dadada;
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: #b5b5b5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

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

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

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

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

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

.followup-table {
  min-width: 860px;
}

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

th {
  background: #fafafa;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

tr:last-child td {
  border-bottom: 0;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}

.followup-action-cell {
  text-align: right;
  white-space: nowrap;
}

.followup-action-cell .btn,
.list-item > .btn {
  width: auto;
}

.list-item > .btn {
  justify-self: start;
}

.contact-stack {
  display: grid;
  gap: 8px;
}

.contact-line {
  display: grid;
  gap: 2px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status.CONVERTED,
.status.APPROVED,
.status.YES,
.status.ACTIVE {
  color: var(--success);
  background: var(--success-bg);
}

.status.FOLLOW_UP,
.status.PENDING,
.status.NO,
.status.SUBMITTED {
  color: var(--warning);
  background: var(--warning-bg);
}

.status.DEAL_CLOSED,
.status.REJECTED,
.status.NOT_INTERESTED,
.status.OVERDUE,
.status.INACTIVE {
  color: var(--danger);
  background: var(--danger-bg);
}

.status.OPEN,
.status.COMPLETED,
.status.PAID {
  color: var(--info);
  background: var(--info-bg);
}

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

.list-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 8px;
  background: #fff;
}

.list-item .item-top strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.list-item .contact-line strong {
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.small {
  font-size: 12px;
}

.timeline {
  border-left: 2px solid var(--border);
  margin-left: 8px;
  padding-left: 18px;
  display: grid;
  gap: 14px;
}

.timeline-entry {
  position: relative;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.timeline-contact-additions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, .28);
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: min(560px, 100%);
  height: 100%;
  background: #fff;
  padding: 24px;
  overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0, 0, 0, .12);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.drawer-close:hover {
  background: var(--border);
  color: var(--text);
}

.followup-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin: 0;
}

.followup-form-actions .btn {
  width: auto;
}

.representatives-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

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

.representative-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  padding: 16px;
  padding-top: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  position: relative;
}

.representative-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
}

.representative-remove:hover {
  background: var(--border);
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .32);
}

.modal-panel {
  width: min(680px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .22);
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header .subtitle {
  margin: 4px 0 0;
}

.modal-form {
  align-items: end;
}

.modal-submit {
  align-self: end;
}

.login-screen {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #f5f5f5;
}

.login-box {
  width: min(360px, 100%);
  padding: 32px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  animation: fadeIn 0.4s ease;
}

.login-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login-logo {
  height: 80px;
  width: auto;
}

.login-box h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: #222;
  margin-bottom: 22px;
}

.login-box .form .field {
  margin-bottom: 18px;
}

.login-box .form .field label {
  font-size: 13px;
  font-weight: 500;
  color: #444;
  margin-bottom: 6px;
}

.login-box .form .field input {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #dadada;
  background: #fafafa;
  font-size: 14px;
  transition: border 0.2s, box-shadow 0.2s;
}

.login-box .form .field input:focus {
  border-color: #b5b5b5;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
  outline: none;
}

.login-box .form .btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: #1a1a1a;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.login-box .form .btn-primary:hover {
  background: #000;
}

.login-box .alert {
  text-align: center;
  margin-top: -8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 14px;
}

.alert-error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #ffd4d4;
}

.alert-success {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #cdeed9;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    padding-top: 104px;
  }

  .topbar {
    height: 104px;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
  }

  .brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .user-area {
    margin-left: 0;
  }

  .nav {
    width: 100%;
    gap: 14px;
  }

  .page {
    padding: 10px;
  }

  .container {
    padding: 16px;
    border-radius: 12px;
  }

  h2 {
    font-size: 24px;
  }

  .section-header {
    display: grid;
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 2px;
    margin-bottom: 12px;
  }

  .section-header > div {
    display: contents;
  }

  .section-header > .btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-top: 2px;
  }

  .section-header .subtitle {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    line-height: 1.3;
  }

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

  .user-search-filters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 12px;
  }

  .search-input-wrapper {
    width: 100%;
  }

  #userSearchRole {
    width: 100%;
  }

  .users-toolbar .btn {
    width: 100%;
  }

  .two-col,
  .user-management,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .controls {
    flex-direction: column;
  }

  .controls > * {
    width: 100%;
  }

  .lead-filters.has-spoc,
  .lead-filters.no-spoc {
    gap: 8px;
    margin-bottom: 14px;
  }

  .lead-filters.has-spoc {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .lead-filters.no-spoc {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .lead-filters input[name="leadSearch"] {
    grid-column: 1 / -1;
  }

  .lead-filters.has-spoc .btn {
    grid-column: 1 / -1;
  }

  .lead-filters.no-spoc .btn {
    width: auto;
  }

  .tab-selector {
    margin-top: 0;
    flex-wrap: wrap;
    overflow-x: visible;
    scrollbar-width: none;
  }

  .tab-selector::-webkit-scrollbar {
    display: none;
  }

  .tab-selector button {
    flex-basis: calc(50% - 2px);
  }

  .followup-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .followup-filters input[name="followupSearch"],
  .followup-filters select[name="followupSpocFilter"],
  .followup-filters .btn {
    grid-column: 1 / -1;
  }

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

  .representative-row {
    grid-template-columns: 1fr;
  }

  .desktop-table {
    display: none;
  }

  .users-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .users-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
    display: block;
    width: 100%;
  }

  .users-table thead {
    display: none;
  }

  .users-table tbody {
    display: block;
    width: 100%;
  }

  .users-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 12px;
    column-gap: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    padding: 16px;
    margin-bottom: 12px;
    align-items: center;
  }

  .users-table td {
    display: block;
    width: 100%;
    padding: 0;
    border-bottom: 0;
  }

  /* Cell 1: Name */
  .users-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .users-table td:nth-child(1)::before {
    display: none;
  }
  .users-table td:nth-child(1) strong {
    font-size: 16px;
    color: var(--text);
  }

  /* Cell 4: Status */
  .users-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .users-table td:nth-child(4)::before {
    display: none;
  }

  /* Cell 2: Contact */
  .users-table td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
  }
  .users-table td:nth-child(2)::before {
    display: none;
  }
  .users-table td:nth-child(2) > div:first-child {
    font-weight: 600;
    color: var(--text);
  }

  /* Cell 3: Role */
  .users-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
    font-size: 13px;
    display: flex;
    gap: 6px;
  }
  .users-table td:nth-child(3)::before {
    content: "Role:";
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
  }

  /* Cell 5: Area */
  .users-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    font-size: 13px;
    display: flex;
    gap: 6px;
    justify-self: end;
  }
  .users-table td:nth-child(5)::before {
    content: "Area:";
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
  }

  /* Cell 6: Actions */
  .users-table .action-cell {
    grid-column: 1 / -1;
    grid-row: 4;
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    min-width: 0;
  }
  .users-table .action-cell::before {
    display: none;
  }
  .users-table .action-cell .btn {
    flex: 1;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
    width: auto;
  }

  .modal {
    align-items: end;
    padding: 10px;
  }

  .modal-panel {
    max-height: 92vh;
    padding: 18px;
    border-radius: 12px 12px 0 0;
  }

  .modal-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .modal-close,
  .modal-submit {
    width: 100%;
  }
}

@media (min-width: 821px) {
  .brand-row {
    display: contents;
  }

  .mobile-list {
    display: none;
  }
}

.modal-error {
  margin-top: 4px;
  margin-bottom: 16px;
}

@media (max-width: 820px) {
  .user-area .btn-text {
    display: none;
  }
  .user-area .btn {
    padding: 9px 10px;
    gap: 0;
  }
}

/* Grouped Form Sections */
.form-section {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  background: #fbfbfb;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}

.form-section h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

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

@media (max-width: 820px) {
  .form-section-fields {
    grid-template-columns: 1fr;
  }
}

/* GPS Selfie Capture Styles */
.gps-selfie-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gps-selfie-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.gps-selfie-preview-box img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.gps-selfie-status {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.gps-selfie-status .coords {
  font-family: monospace;
  color: var(--text);
  font-weight: 600;
}

/* Drafts UI Styles */
.drafts-container {
  grid-column: 1 / -1;
  border: 1px solid #ffe8cc;
  background: #fff9f0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.drafts-container h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
}

.drafts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.draft-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.draft-actions {
  display: flex;
  gap: 6px;
}

.draft-actions .btn {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

label.required::after {
  content: " *";
  color: var(--danger);
}

/* Loading Spinner Styling */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  min-height: 300px;
  width: 100%;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(26, 26, 26, 0.1);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Custom styling for compact follow-up cards & SVG complete buttons */
.btn-complete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--success);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-complete-icon:hover {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
  box-shadow: 0 2px 8px rgba(31, 143, 85, 0.15);
}

.btn-complete-icon svg {
  display: block;
}

/* Align action cell and list-item button width properly */
.followup-action-cell .btn-complete-icon {
  margin-left: auto;
}

/* Compact followup card layout */
.followup-card {
  padding: 12px;
  gap: 8px;
}

.followup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.followup-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.followup-card-title-group strong {
  font-size: 15px !important;
}

.followup-card-meta {
  font-size: 12px;
  color: var(--muted);
}

.followup-card-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.followup-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

/* Compact contact styling */
.contact-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.primary-badge {
  font-size: 9px;
  background: var(--info-bg);
  color: var(--info);
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.contact-details {
  margin-top: 1px;
}

/* Mobile responsive compact styling overrides */
@media (max-width: 820px) {
  .followup-card {
    padding: 10px 12px;
    gap: 6px;
  }
  .followup-card-body .contact-stack {
    gap: 6px;
  }
}

