html {
  font-size: 14px;
}

:root {
  --brokerdesk-primary: #123766;
  --brokerdesk-accent: #2f8df4;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

main {
  padding-bottom: 60px;
}

/* ================================
   iOS zoom prevention (FINAL)
   ================================ */

@media (max-width: 768px) {
  .form-control,
  input.form-control,
  textarea.form-control,
  select.form-control {
    font-size: 16px !important;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }
}

/* ================================
   Focus styles
   ================================ */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--brokerdesk-accent);
}

/* ================================
   Form floating tweaks
   ================================ */

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ================================
   Consumer search filters
   ================================ */

body.consumer-filter-open {
  overflow: hidden;
}

.consumer-filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(33, 37, 41, 0.48);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.consumer-filter-overlay.is-open {
  opacity: 1;
}

.consumer-filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1065;
  width: min(420px, 100vw);
  background: #fff;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.consumer-filter-drawer.is-open {
  transform: translateX(0);
}

.consumer-filter-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.consumer-filter-drawer-header,
.consumer-filter-drawer-footer {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1rem;
}

.consumer-filter-drawer-header {
  border-bottom: 1px solid #dee2e6;
}

.consumer-filter-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
}

.consumer-filter-drawer-footer {
  border-top: 1px solid #dee2e6;
  background: #fff;
}

.consumer-filter-section {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.75rem;
}

.consumer-filter-section-title {
  cursor: pointer;
  font-weight: 600;
  list-style-position: inside;
}

@media (max-width: 576px) {
  .consumer-filter-drawer {
    width: min(360px, 92vw);
  }
}

.consumer-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.consumer-filter-chip {
  align-items: center;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  color: #212529;
  display: inline-flex;
  font-size: 0.875rem;
  gap: 0.4rem;
  line-height: 1.2;
  min-height: 32px;
  padding: 0.35rem 0.35rem 0.35rem 0.7rem;
}

.consumer-filter-chip-label {
  color: #6c757d;
}

.consumer-filter-chip-clear {
  align-items: center;
  border-radius: 999px;
  color: #6c757d;
  display: inline-flex;
  font-size: 1rem;
  height: 24px;
  justify-content: center;
  text-decoration: none;
  width: 24px;
}

.consumer-filter-chip-clear:hover,
.consumer-filter-chip-clear:focus {
  background: #f1f3f5;
  color: #212529;
}

/* ================================
   Clickable rows / cards
   ================================ */

.clickable-row {
  cursor: pointer;
}

/* Household member cards */
.household-member,
.card.clickable-row {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.household-member:hover,
.card.clickable-row:hover {
  background-color: #f8f9fa;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.household-member:focus-visible,
.card.clickable-row:focus-visible {
  outline: none;
  background-color: rgba(37, 140, 251, 0.12);
}

/* ================================
   Inline edit icons
   ================================ */

.inline-edit {
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
  margin-left: 6px;
}

.inline-edit:hover {
  opacity: 1;
}

/* ================================
   Copyable fields (button feel)
   ================================ */

.copyable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.copyable:hover {
  background-color: rgba(37, 140, 251, 0.12);
}

.copyable:active {
  background-color: rgba(37, 140, 251, 0.22);
  transform: scale(0.97);
}

/* ================================
   Desktop table affordance
   ================================ */

@media (min-width: 768px) {
  table.table-hover tbody tr {
    transition: background-color 0.15s ease, transform 0.08s ease;
  }

  table.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
  }

  table.table-hover td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

table.table-hover tbody tr:focus-visible {
  outline: none;
  background-color: rgba(37, 140, 251, 0.12);
}

/* ================================
   Table mobile improvements
   ================================ */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 576px) {
  table.table td,
  table.table th {
    padding: 0.5rem 0.4rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  table.table td:first-child {
    white-space: normal;
    font-weight: 500;
  }
}

table.table a {
  text-decoration: none;
}

table.table a:hover {
  text-decoration: underline;
}

/* ================================
   Mobile Contact Cards
   ================================ */

.contact-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-card:hover {
  background-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.contact-card:focus-visible {
  outline: none;
  background-color: rgba(37, 140, 251, 0.12);
}

@media (hover: none) {
  .contact-card:active {
    background-color: rgba(0, 0, 0, 0.06);
  }
}

/* ================================
   Floating Add Contact Button
   ================================ */

.add-contact-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 576px) {
  .add-contact-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.95rem;
  }
}

/* ================================
   Toast notifications
   ================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
}

.toast {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ================================
   Household member cards (no hover affordance)
   ================================ */

.household-member {
  cursor: default;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}

.household-member:hover,
.household-member:focus-visible {
  background-color: inherit;
  box-shadow: none;
}

/* ================================
   Household member list (non-card style)
   ================================ */

.household-member {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #e9ecef;
  background-color: transparent;
  box-shadow: none;
}

.household-member:first-child {
  border-top: 1px solid #e9ecef;
}

.household-member .card-body {
  padding: 0.75rem 0.25rem;
}

.household-status-card {
  background: #fff;
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.household-status-card:hover {
  background: #f1f3f5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.09);
}

.household-status-card:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.25);
  outline-offset: 2px;
}

.household-status-card:active {
  transform: translateY(1px);
}

.household-status-edit-icon {
  color: #6c757d;
  font-size: 1rem;
  line-height: 1;
}

.household-leads-summary {
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.household-leads-summary-toggle {
  align-items: center;
  background: #fff;
  border: 0;
  color: #212529;
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  text-align: left;
  transition: background-color 0.15s ease;
  width: 100%;
}

.household-leads-summary-toggle:hover {
  background: #f1f3f5;
}

.household-leads-summary-toggle:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.25);
  outline-offset: -3px;
}

.household-leads-count {
  align-items: center;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  color: #495057;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 600;
  height: 1.6rem;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0 0.55rem;
}

.household-leads-summary-chevron {
  color: #6c757d;
  transition: transform 0.15s ease;
}

.household-leads-summary-toggle[aria-expanded="false"] .household-leads-summary-chevron {
  transform: rotate(180deg);
}

.household-leads-summary-list {
  border-top: 1px solid #dee2e6;
}

.household-lead-summary-row {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.95rem 1.25rem;
  text-align: left;
  transition: background-color 0.15s ease;
  width: 100%;
}

.household-lead-summary-row:hover {
  background: #f1f3f5;
}

.household-lead-summary-row:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.25);
  outline-offset: -3px;
}

.household-lead-summary-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}

.household-lead-summary-status {
  color: #212529;
  font-size: 0.98rem;
  font-weight: 600;
  width: 100%;
}

.household-lead-summary-updated {
  color: #6c757d;
  font-size: 0.85rem;
}

.household-lead-summary-initial {
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  color: #6c757d;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 600;
  height: 1.35rem;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0 0.4rem;
  text-transform: uppercase;
}

.household-lead-summary-chevron {
  color: #6c757d;
  font-size: 1rem;
}

.household-leads-summary-empty {
  color: #6c757d;
  padding: 1.25rem 1.5rem;
}

.household-leads-summary-actions {
  background: #fff;
  padding: 0.85rem 1.25rem;
}

.household-speed-dial {
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
  display: grid;
  gap: 0.75rem;
  justify-items: end;
  position: fixed;
  right: 1.5rem;
  z-index: 1040;
}

.household-fab {
  align-items: center;
  background: #0d6efd;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(13, 110, 253, 0.35);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.4rem;
  height: 3.25rem;
  justify-content: center;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  width: 3.25rem;
}

.household-fab:hover {
  background: #0b5ed7;
  box-shadow: 0 10px 26px rgba(13, 110, 253, 0.42);
  transform: translateY(-1px);
}

.household-fab:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.28);
  outline-offset: 3px;
}

.household-fab:active {
  transform: translateY(1px);
}

.household-speed-dial.is-open .household-fab i {
  transform: rotate(45deg);
}

.household-fab i {
  transition: transform 0.15s ease;
}

.household-speed-dial-actions {
  display: grid;
  gap: 0.6rem;
  justify-items: end;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.household-speed-dial.is-open .household-speed-dial-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.household-speed-action {
  align-items: center;
  background: transparent;
  border: 0;
  color: #212529;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  gap: 0.6rem;
  justify-content: flex-end;
  padding: 0;
  text-decoration: none;
  width: auto;
}

.household-speed-action:hover,
.household-speed-action:focus {
  color: #212529;
}

.household-speed-action:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.22);
  outline-offset: 2px;
}

.household-speed-label {
  align-items: center;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 600;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  white-space: nowrap;
}

.household-speed-action-button {
  align-items: center;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #0d6efd;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.75rem;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  width: 2.75rem;
}

.household-speed-action:hover .household-speed-action-button {
  background: #f1f7ff;
  border-color: #b6d4fe;
  transform: translateY(-1px);
}

.todo-list-kind-icon {
  align-items: center;
  background: #f1f3f5;
  border-radius: 999px;
  color: #495057;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.todo-list-appointment-row,
.household-appointment-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.todo-list-appointment-row:hover,
.household-appointment-row:hover {
  background: #f8f9fa;
}

.todo-list-main-button {
  background: transparent;
  border: 0;
  border-radius: 0.35rem;
  color: inherit;
  display: block;
  min-width: 0;
  padding: 0.15rem 0.25rem;
  transition: background-color 0.15s ease;
  width: 100%;
}

.todo-list-main-button:hover,
.todo-list-main-button:focus-visible {
  background: #f1f3f5;
}

.todo-list-main-static {
  min-width: 0;
  padding: 0.15rem 0.25rem;
}

.appointment-detail-panel {
  display: grid;
  gap: 1rem;
}

.appointment-detail-header {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.appointment-detail-icon {
  align-items: center;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  color: #495057;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.appointment-detail-list {
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  overflow: hidden;
}

.appointment-detail-row {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.appointment-detail-row:last-child {
  border-bottom: 0;
}

.appointment-detail-label {
  color: #6c757d;
  font-size: 0.78rem;
  margin-bottom: 0.1rem;
}

.appointment-detail-value {
  color: #212529;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.appointment-detail-meta {
  color: #6c757d;
  flex: 0 0 auto;
  font-size: 0.85rem;
}

.appointment-call-button {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  white-space: nowrap;
}

.household-speed-dial-todo {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  max-width: min(calc(100vw - 2rem), 22rem);
  padding: 1rem;
  width: 22rem;
}

@media (max-width: 575.98px) {
  .household-speed-dial {
    right: 1rem;
  }
}

.address-label {
  user-select: none;
  color: var(--bs-secondary-color);
  margin-right: 6px;
}

.address-value {
  user-select: text;
}

.address-value::selection {
  background-color: rgba(37, 140, 251, 0.18);
}

/* Labels should never be selected */
.field-label {
  user-select: none;
  color: var(--bs-secondary-color);
  margin-right: 6px;
}

/* Values should be selectable */
.field-value {
  user-select: text;
}

/* Optional: nicer selection highlight for values */
.field-value::selection {
  background-color: rgba(37, 140, 251, 0.18);
}

/* Ensure values are isolated so triple-click targets only the value */
.field-value {
  display: inline-block;
  white-space: nowrap;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.address-label {
  user-select: none;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.address-value {
  user-select: text;
}

/* Copy button */
.copy-btn {
  opacity: 0;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
  color: var(--bs-secondary-color);
}

.address-row:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--bs-primary);
}

/* Sidebar nav pills override */
.nav-pills .nav-link {
    color: #212529;
    background-color: transparent;
}

.nav-pills .nav-link:hover {
    background-color: #f1f3f5;
    color: #000;
}

.nav-pills .nav-link.active,
.nav-pills .nav-link:focus {
    background-color: transparent !important;
    color: #212529 !important;
    box-shadow: none;
}

/* Tighten sidebar on mobile */
@media (max-width: 767.98px) {
    nav {
        padding-bottom: 0 !important;
        border-bottom: 1px solid #dee2e6;
    }

    main {
        padding-top: 0 !important;
    }
}

/* ================================
   Desktop app sidebar
   ================================ */

@media (min-width: 768px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
}

/* ================================
   Smooth collapse / expand panels
   ================================ */
.collapse-panel {
    overflow: hidden;

    /* Motion */
    transition:
        max-height 0.35s ease,
        opacity 0.2s ease,
        transform 0.25s ease;

    /* Expanded state */
    max-height: 900px; /* comfortably above form height */
    opacity: 1;
    transform: translateY(0);
}

.collapse-panel.hidden {
    /* Collapsed state */
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);

    /* Prevent interaction while hidden */
    pointer-events: none;
}
/* Login page subtle entrance */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeUp 380ms ease-out;
}

.login-logo {
    animation: fadeUp 260ms ease-out;
}

/* Mobile login card adjustments */
@media (max-width: 576px) {
    .login-card {
        max-width: none;
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 1.75rem 1.25rem;
        box-shadow: none;
    }

    body {
        background: #fff;
    }
}

/* This is for updating Households/Details.cshtml */
.detail-field {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    line-height: 1.4;
}

.detail-label {
    font-weight: 600;
    min-width: 80px;
    color: #6c757d;
    flex-shrink: 0;
}

.detail-value {
    white-space: nowrap;
}

/* Inline icon actions (call / text) */
.icon-action {
    color: var(--bs-secondary-color);
    text-decoration: none;
    line-height: 1;
}

.icon-action:hover {
    color: var(--bs-primary);
}

.phone-action {
    font-size: 1.25rem; /* increase icon size */
    color: #6c757d;     /* subtle, not highlighted */
    text-decoration: none;
}

.phone-action:hover {
    color: #212529;     /* slightly darker on hover */
}

.icon-action i {
    vertical-align: middle;
}

.icon-action i {
    font-size: 1.6rem;   /* 🔥 this is the key */
    color: #6c757d;
}

.icon-action:hover i {
    color: #212529;
}

.icon-action {
    padding: 2px;
}

/* Icons for call, text, email */
a.text-muted {
    cursor: pointer;
}

a.text-muted:hover {
    color: #0d6efd !important;
}

/* ================================
   Household call / text modals
   ================================ */

.contact-action-modal .modal-content {
    border-radius: 8px;
    overflow: hidden;
}

.contact-action-header {
    align-items: flex-start;
    background: #fff;
    border-bottom: 1px solid #edf0f2;
    padding: 1rem;
}

.contact-action-header-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.contact-action-header-icon-call {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.contact-action-header-icon-text {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.contact-action-body {
    background: #f8f9fa;
    padding: 0.75rem;
}

.contact-action-list {
    display: grid;
    gap: 0.5rem;
}

.contact-action-choice {
    align-items: center;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #212529;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 0.75rem;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.contact-action-choice:hover {
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 8px 20px rgba(33, 37, 41, 0.08);
    color: #212529;
    transform: translateY(-1px);
}

.contact-action-choice:focus-visible {
    border-color: #258cfb;
    box-shadow: 0 0 0 0.25rem rgba(37, 140, 251, 0.25);
    outline: none;
}

.contact-action-choice-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.contact-action-choice-icon-call {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.contact-action-choice-icon-text {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.contact-action-choice-main {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.contact-action-choice-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-action-choice-meta {
    align-items: center;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.82rem;
    gap: 0.35rem;
}

.contact-action-choice-number {
    color: #495057;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#textModal .contact-action-choice:hover {
    border-color: rgba(25, 135, 84, 0.35);
}

.contact-action-empty {
    align-items: center;
    background: #fff;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    color: #6c757d;
    display: grid;
    gap: 0.5rem;
    justify-items: center;
    padding: 2rem 1rem;
    text-align: center;
}

.contact-action-empty i {
    font-size: 1.5rem;
}

@media (max-width: 576px) {
    .contact-action-choice {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .contact-action-choice-number {
        grid-column: 2 / 3;
        justify-self: start;
    }
}

.readonly-field {
    background-color: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
}

select[readonly] {
    pointer-events: none;
    background-color: #f8f9fa;
}

/* Carrier logo sizing in plan tables */
.carrier-logo {
    height: 36px;
    width: auto;
}

/* Spacing for plan table rows */
td[data-plan-id] {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* ================================
   Plan cards (Quote Details)
   ================================ */

.plan-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem; /* 👈 THIS creates spacing between plans */
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

.quote-page-bg {
    background-color: #f6f7f9;
    min-height: 100vh;
}

.table-responsive {
    background: transparent;
}

/* ================================
   Plan cards – mobile layout
   ================================ */

@media (max-width: 576px) {

    .plan-card {
        padding: 1rem;
    }

    .plan-grid > div {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Premium: hero on top */
    .plan-grid .col-3:first-child {
        text-align: center;
    }

    .plan-grid .col-3:first-child .fw-bold {
        font-size: 2rem;
    }

    /* Deductible smaller */
    .plan-grid .col-3:nth-child(2) .fw-semibold {
        font-size: 1.25rem;
    }

    @media (max-width: 576px) {

        /* Benefits: two-column grid on mobile */
        .plan-grid .col-3:nth-child(3),
        .plan-grid .col-3:nth-child(4) {
            width: 100%;
        }

        .plan-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            column-gap: 1rem;
            row-gap: 0.5rem;
        }

        /* Benefit labels */
        .plan-grid .col-3:nth-child(3) div {
            text-align: left;
            font-size: 0.9rem;
            color: #6c757d;
        }

        /* Benefit values */
        .plan-grid .col-3:nth-child(4) div {
            text-align: right;
            font-weight: 500;
            font-size: 0.9rem;
        }
    }

    /* Links + button stack */
    .plan-card .d-flex.align-items-center {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .plan-card form button {
        width: 100%;
    }
}

@media (max-width: 576px) {

    /* Center plan links on mobile */
    .plan-card .d-flex.flex-wrap.gap-3.small {
        justify-content: center;
        text-align: center;
    }

    .plan-card .d-flex.flex-wrap.gap-3.small a {
        justify-content: center;
        text-align: center;
    }
}

/* ================================
   Larger Select button (all devices)
   ================================ */

.plan-card form button {
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
    min-width: 140px;
}

/* Separator between medications and providers */
.medication-provider-separator {
    border-top: 1px solid #dee2e6;
}

/* ================================
   Calendar styles
   ================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 0;
    background: #f8f9fa;
}

.calendar-cell {
    border: 1px solid #dee2e6;
    min-height: 110px;
    padding: 4px;
    overflow-y: auto;
    background: #fff;
}

.calendar-cell.empty {
    background: #f8f9fa;
}

.calendar-day {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.calendar-event {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 📱 Mobile */
@media (max-width: 768px) {
    .calendar-cell {
        min-height: 80px;
        font-size: 0.65rem;
    }

    .calendar-header {
        font-size: 0.7rem;
    }
}

/* Calendar day link styles */
.calendar-link {
    text-decoration: none;
    color: inherit;
}
.calendar-link:hover {
    background: #f8f9fa;
}
#calendar-wrapper {
    transition: transform .4s ease, opacity .4s ease;
}

#calendar-wrapper.zoomed {
    transform: scale(1.15);
    opacity: 0;
    pointer-events: none;
}

.day-overlay {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
}

.day-panel {
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    animation: zoomIn .35s ease;
}

.day-overlay {
    align-items: stretch;
}

@keyframes zoomIn {
    from { transform: scale(.9); opacity: 0 }
    to   { transform: scale(1); opacity: 1 }
}

/* Day agenda styles */
.day-agenda {
    border-top: 1px solid #e5e7eb;
}

.time-row {
    display: grid;
    grid-template-columns: 84px 1fr; /* ⬅ more room for "10:00 PM" */
    min-height: 32px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.85rem;
}

.time-label {
    text-align: right;
    padding: 4px 8px;
    color: #6c757d;
    border-right: 1px solid #f1f3f5;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.time-slot {
    padding: 4px 8px;
    position: relative;
}

.time-slot.event {
    background: #e7f1ff;
    border-left: 3px solid #0d6efd;
    font-weight: 500;
}

/* Sticky day header */
.day-header{
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    padding: 8px 0 10px 0;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    gap: 12px;
    align-items: center;
}

.calendar-cell.today {
    outline: 2px solid #0d6efd;
    background: #e7f1ff;
}

/* ================================
   Day view – hour blocks
   ================================ */

.time-slot {
    position: relative;
    height: 48px;              /* one hour height */
    background:
        linear-gradient(
            to bottom,
            transparent 50%,
            #f1f3f5 50%
        );
    background-size: 100% 24px; /* half-hour guide */
}

/* Event block */
.calendar-block {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 20px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 2px 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* Half-hour positioning */
.calendar-block.half {
    top: 26px;
}

.calendar-block.full {
    top: 4px;
}

/* Hover affordance */
.calendar-block:hover {
    background: #0b5ed7;
}

/* Clickable empty slot affordance */
.time-slot:hover {
    background-color: rgba(13,110,253,0.04);
    cursor: pointer;
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.calendar-event-time {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    flex-shrink: 0;
}

.calendar-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Month header with arrows */
.calendar-month-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.month-title {
    margin: 0;
    min-width: 180px;
    text-align: center;
}

.month-nav {
    font-size: 1.4rem;
    text-decoration: none;
    color: #495057;
    padding: 4px 10px;
    border-radius: 6px;
}

.month-nav:hover {
    background-color: #f1f3f5;
    color: #000;
}

/* ================================
   Calendar cockpit
   ================================ */
.calendar-cockpit {
    display: grid;
    gap: 20px;
    align-items: stretch;
    max-width: 1180px;
    margin: 0 auto;
}

.calendar-todos,
.calendar-month-panel,
.calendar-day-panel,
.dashboard-widget {
    border: 1px solid #dde5ee;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.calendar-todos {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid #edf0f3;
    background: #fbfcfe;
}

.calendar-widget,
.dashboard-widget {
    min-width: 0;
}

.calendar-widget.is-dragging,
.dashboard-widget.is-dragging {
    opacity: 0.96;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
    transform-origin: top left;
    will-change: transform;
}

.widget-drag-placeholder {
    border: 2px dashed #93c5fd;
    background: #eff6ff;
    box-shadow: none;
    opacity: 0.72;
}

.widget-drag-placeholder > * {
    visibility: hidden;
}

.calendar-widget-header {
    cursor: default;
}

.calendar-title-group {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.calendar-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: grab;
    flex: 0 0 auto;
    touch-action: none;
    user-select: none;
}

.calendar-drag-handle:active {
    cursor: grabbing;
}

.calendar-drag-handle:hover,
.calendar-drag-handle:focus {
    border-color: #dbe3ec;
    background: #fff;
    color: #475569;
}

.is-widget-dragging,
.is-widget-dragging * {
    cursor: grabbing !important;
    user-select: none;
}

.calendar-panel-heading h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
}

.calendar-kicker {
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.calendar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(67, 56, 202, 0.08);
}

.calendar-heading-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.calendar-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    background: #fff;
    color: #2563eb;
    text-decoration: none;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-icon-action:hover,
.calendar-icon-action:focus {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.todo-list {
    display: grid;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.todo-filter-row {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f3;
    background: #fff;
}

.todo-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.todo-filter:hover,
.todo-filter.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.todo-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    color: inherit;
    border-bottom: 1px solid #f1f3f5;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.todo-item:hover {
    background: #f8fafc;
    border-left-color: #bfdbfe;
}

.todo-complete-form {
    margin: 0;
}

.todo-complete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #dbe3ec;
    border-radius: 999px;
    background: #fff;
    color: #9ca3af;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.todo-complete-button:hover,
.todo-complete-button:focus {
    border-color: #86efac;
    background: #f0fdf4;
    color: #15803d;
}

.todo-copy {
    display: grid;
    min-width: 0;
}

.todo-copy strong,
.todo-copy span,
.todo-copy a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.todo-copy strong {
    font-size: 0.88rem;
}

.todo-copy span,
.todo-copy a,
.todo-date {
    color: #6b7280;
    font-size: 0.78rem;
}

.todo-copy a {
    text-decoration: none;
}

.todo-copy a:hover {
    color: #1d4ed8;
}

.todo-date.overdue {
    color: #dc2626;
    font-weight: 700;
}

.todo-date {
    justify-self: end;
    border-radius: 999px;
    background: #f3f6f9;
    padding: 3px 8px;
}

.todo-date.overdue {
    background: #fef2f2;
}

.calendar-empty-state {
    padding: 18px 16px;
    color: #6b7280;
    font-size: 0.9rem;
}

.calendar-month-panel .calendar-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #edf0f3;
    background: #fbfcfe;
}

.calendar-month-panel .month-title {
    min-width: 0;
    flex: 1 1 auto;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
}

.calendar-month-panel .month-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 1rem;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-month-panel .month-nav:hover,
.calendar-month-panel .month-nav:focus {
    background: #fff;
    border-color: #dbe3ec;
}

.cockpit-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #e6ebf1;
    padding: 1px;
}

.cockpit-calendar-header {
    background: #f3f6f9;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 9px 4px;
    text-align: center;
}

.cockpit-day-cell {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    min-height: 72px;
    padding: 8px;
    background: #fff;
    color: #111827;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.cockpit-day-cell:not(.empty):hover {
    background: #fbfdff;
    box-shadow: inset 0 0 0 2px #dbeafe;
}

.cockpit-day-cell.empty {
    background: #f8fafc;
}

.cockpit-day-cell.today {
    background: #fbfdff;
}

.cockpit-day-cell.selected {
    background: #eef6ff;
    box-shadow: inset 0 0 0 2px #2563eb;
}

.cockpit-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
}

.cockpit-day-cell.today .cockpit-day-number {
    background: #f3f6f9;
    color: #0f172a;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.cockpit-day-cell.selected .cockpit-day-number {
    background: #2563eb;
    color: #fff;
    box-shadow: none;
}

.cockpit-day-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(7, 89, 133, 0.08);
}

.day-appointment-list {
    display: grid;
}

.day-appointment-row,
.day-empty-slot {
    display: grid;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    background: #fff;
    text-align: left;
    transition: background-color 0.15s ease;
}

.day-appointment-row {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
}

.day-appointment-row:hover,
.day-empty-slot:hover {
    background: #f8fafc;
}

.appointment-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 999px;
    background: #eef6ff;
    color: #1d4ed8;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 0 8px;
}

.appointment-copy {
    display: grid;
    min-width: 0;
}

.appointment-copy strong,
.appointment-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-copy span {
    color: #6b7280;
    font-size: 0.82rem;
}

.day-empty-slot {
    grid-template-columns: auto minmax(0, auto);
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 132px;
    background: #fbfcfe;
    color: #6b7280;
    font-weight: 600;
}

.day-empty-slot i {
    color: #2563eb;
}

/* ================================
   Dashboard widgets
   ================================ */
.dashboard-shell {
    max-width: 1320px;
    margin: 0 auto;
}

.dashboard-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-heading h1 {
    margin: 0;
    color: #111827;
    font-size: 1.85rem;
    line-height: 1.2;
    font-weight: 750;
}

.dashboard-customize {
    position: relative;
    flex: 0 0 auto;
}

.dashboard-widget-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1050;
    min-width: 210px;
    padding: 8px;
    border: 1px solid #dde5ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.dashboard-widget-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #111827;
    font-size: 0.88rem;
    text-align: left;
}

.dashboard-widget-menu-item:hover,
.dashboard-widget-menu-item:focus {
    background: #eff6ff;
    color: #1d4ed8;
}

.dashboard-widget-menu-empty {
    padding: 8px 10px;
    color: #6b7280;
    font-size: 0.85rem;
}

.dashboard-widget-hide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    flex: 0 0 auto;
}

.dashboard-widget-hide:hover,
.dashboard-widget-hide:focus {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.dashboard-widget-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
    grid-auto-flow: row;
}

.dashboard-widget {
    display: flex;
    flex-direction: column;
}

.dashboard-widget .calendar-panel-heading h2 {
    font-size: 1.02rem;
}

.dashboard-widget-body {
    flex: 1 1 auto;
    padding: 16px;
}

.dashboard-count-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 999px;
    border: 3px solid #6c757d;
    color: #6c757d;
    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.dashboard-count-ring.active {
    border-color: #0d6efd;
    color: #0d6efd;
}

.dashboard-count-ring:hover,
.dashboard-count-ring:focus {
    background: #eff6ff;
    color: #0d6efd;
}

@media (min-width: 992px) {
    .dashboard-widget-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(2, 360px);
        grid-auto-rows: 360px;
    }

    .dashboard-widget-grid .calendar-day-panel,
    .dashboard-widget-grid .calendar-todos {
        min-height: 0;
    }

    .dashboard-widget-grid > [data-widget-id] {
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .dashboard-widget-grid .calendar-month-panel,
    .dashboard-widget-grid .calendar-day-panel {
        display: flex;
        flex-direction: column;
    }

    .dashboard-widget-grid .cockpit-day-cell {
        min-height: 0;
        padding: 5px;
    }

    .dashboard-widget-grid .cockpit-day-number {
        width: 24px;
        height: 24px;
        font-size: 0.78rem;
    }

    .dashboard-widget-grid .cockpit-day-count {
        min-width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }

    .dashboard-widget-grid .todo-list,
    .dashboard-widget-grid .day-appointment-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }
}

@media (min-width: 992px) {
    .calendar-cockpit {
        height: calc(100vh - 2rem);
        grid-template-columns: minmax(0, 760px) minmax(280px, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
        justify-content: center;
        overflow: hidden;
    }

    .calendar-todos,
    .calendar-month-panel,
    .calendar-day-panel {
        min-height: 0;
    }

    .calendar-cockpit > .calendar-widget:nth-child(1) {
        grid-column: 1;
        grid-row: 1 / -1;
    }

    .calendar-cockpit > .calendar-widget:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        max-height: none;
    }

    .calendar-cockpit > .calendar-widget:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
    }

    .todo-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    .calendar-month-panel,
    .calendar-day-panel {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .cockpit-month-grid {
        flex: 1 1 auto;
        min-height: 0;
        grid-template-rows: auto repeat(6, minmax(0, 1fr));
    }

    .cockpit-day-cell {
        min-height: 0;
        overflow: hidden;
    }

    .day-appointment-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
}

@media (max-width: 991.98px) {
    .calendar-cockpit {
        grid-template-columns: 1fr;
    }

    .calendar-todos {
        max-height: none;
    }

    .todo-list {
        max-height: 280px;
    }
}

@media (max-width: 575.98px) {
    .calendar-panel-heading {
        align-items: flex-start;
    }

    .cockpit-day-cell {
        min-height: 48px;
        padding: 6px;
    }

    .cockpit-calendar-header {
        font-size: 0.66rem;
        padding: 6px 2px;
    }

    .cockpit-day-count {
        min-width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }

    .day-appointment-row {
        grid-template-columns: 76px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 12px;
    }
}

/* Google Calendar-style page layout */
.calendar-page-toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto 1rem;
    max-width: none;
    width: 100%;
}

.calendar-page-title {
    color: #202124;
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
}

.calendar-page-subtitle {
    color: #5f6368;
    font-size: 0.9rem;
}

.calendar-main {
    min-height: 100vh;
}

.calendar-page-layout.calendar-cockpit {
    align-items: stretch;
    display: grid;
    gap: 0;
    grid-template-columns: minmax(220px, 260px) minmax(420px, 1fr) minmax(280px, 340px);
    grid-template-rows: 1fr;
    height: calc(100vh - 6rem);
    height: calc(100dvh - 6rem);
    margin: 0 auto;
    max-width: none;
    overflow: hidden;
    width: 100%;
}

.calendar-page-layout .calendar-widget {
    border-radius: 0;
    box-shadow: none;
    min-height: 0;
}

.calendar-page-layout > .calendar-widget:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.calendar-page-layout > .calendar-widget:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.calendar-page-layout > .calendar-widget:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}

.calendar-page-layout .calendar-month-panel,
.calendar-page-layout .calendar-day-panel,
.calendar-page-layout .calendar-todos {
    border: 1px solid #dadce0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.calendar-page-layout .calendar-day-panel,
.calendar-page-layout .calendar-todos {
    height: 100%;
}

.calendar-page-layout > .calendar-widget.calendar-month-panel {
    align-self: start;
}

.calendar-page-layout .calendar-day-panel {
    border-left: 0;
    border-right: 0;
}

.calendar-page-layout .calendar-drag-handle {
    display: none;
}

.calendar-page-layout .calendar-panel-heading,
.calendar-page-layout .calendar-month-panel .calendar-month-header {
    background: #fff;
    border-bottom: 1px solid #dadce0;
    min-height: 4rem;
    padding: 0.8rem 1rem;
}

.calendar-page-layout .calendar-panel-heading h2,
.calendar-page-layout .calendar-month-panel .month-title {
    color: #202124;
    font-size: 1rem;
    font-weight: 500;
}

.calendar-page-layout .calendar-kicker {
    color: #5f6368;
    font-size: 0.72rem;
    font-weight: 600;
}

.calendar-page-layout .calendar-month-panel .month-nav {
    border-radius: 999px;
    color: #5f6368;
    height: 2rem;
    width: 2rem;
}

.calendar-page-layout .cockpit-month-grid {
    background: #fff;
    gap: 0;
    grid-template-rows: auto repeat(6, minmax(2.15rem, auto));
    padding: 0.85rem 0.95rem 1rem;
}

.calendar-page-layout .calendar-month-panel {
    background: #fff;
    box-shadow: inset -1px 0 0 #edf0f3;
}

.calendar-page-layout .calendar-month-header {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #edf0f3;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    min-height: 4rem;
    padding: 0.85rem 1rem;
}

.calendar-page-layout .calendar-month-panel .calendar-drag-handle {
    color: #94a3b8;
}

.calendar-page-layout .calendar-month-panel .month-title {
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.calendar-page-layout .calendar-month-panel .month-nav {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #475569;
    height: 2rem;
    width: 2rem;
}

.calendar-page-layout .calendar-month-panel .month-nav:hover,
.calendar-page-layout .calendar-month-panel .month-nav:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.calendar-page-layout .cockpit-calendar-header {
    background: #fff;
    color: #5f6368;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.3rem 0;
}

.calendar-page-layout .cockpit-day-cell {
    align-items: center;
    background: #fff;
    border-radius: 999px;
    display: flex;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0;
    position: relative;
}

.calendar-page-layout .cockpit-day-cell.empty {
    background: transparent;
}

.calendar-page-layout .cockpit-day-cell:not(.empty):hover {
    background: #f3f4f6;
    box-shadow: none;
}

.calendar-page-layout .cockpit-day-cell.selected {
    background: transparent;
    box-shadow: none;
}

.calendar-page-layout .cockpit-day-cell.selected .cockpit-day-number {
    background: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
    color: #fff;
}

.calendar-page-layout .cockpit-day-cell.today .cockpit-day-number {
    background: #1d4ed8;
    box-shadow: 0 1px 2px rgba(29, 78, 216, 0.25);
    color: #fff;
}

.calendar-page-layout .cockpit-day-cell.today.selected .cockpit-day-number {
    background: #0f172a;
    box-shadow: 0 0 0 2px #1d4ed8;
    color: #fff;
}

.calendar-page-layout .cockpit-day-number {
    font-size: 0.8rem;
    font-weight: 500;
    height: 1.8rem;
    width: 1.8rem;
}

.calendar-page-layout .cockpit-day-count {
    background: #34a853;
    border: 2px solid #fff;
    bottom: 0.12rem;
    box-shadow: none;
    height: 0.55rem;
    min-width: 0.55rem;
    padding: 0;
    position: absolute;
    right: 0.35rem;
    text-indent: -999px;
    width: 0.55rem;
}

.day-schedule-grid {
    background: #fff;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.day-schedule-hour {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    min-height: 4rem;
}

.day-schedule-time {
    border-right: 1px solid #dadce0;
    color: #70757a;
    font-size: 0.75rem;
    padding: 0.45rem 0.8rem 0 0;
    text-align: right;
}

.day-schedule-slot {
    align-content: start;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    display: grid;
    gap: 0.3rem;
    min-height: 4rem;
    padding: 0.25rem 0.5rem;
    position: relative;
    text-align: left;
    width: 100%;
}

.day-schedule-half-slot {
    align-items: center;
    background: transparent;
    border: 0;
    display: flex;
    height: 50%;
    justify-content: flex-start;
    left: 0;
    min-height: 0;
    padding: 0 0.75rem;
    position: absolute;
    right: 0;
    text-align: left;
    z-index: 1;
}

.day-schedule-half-slot[data-half-minute="0"] {
    top: 0;
}

.day-schedule-half-slot[data-half-minute="30"] {
    top: 50%;
}

.day-schedule-half-slot:hover {
    background: rgba(26, 115, 232, 0.06);
}

.day-schedule-event.day-appointment-row {
    align-items: center;
    background: #e8f0fe;
    border: 0;
    border-radius: 0.45rem;
    box-sizing: border-box;
    color: #174ea6;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 4.4rem minmax(0, 1fr);
    height: var(--event-height, auto);
    left: 0.5rem;
    min-height: min(var(--event-height, 2.25rem), 2.25rem);
    overflow: hidden;
    padding: 0.45rem 0.6rem;
    position: absolute;
    right: 0.5rem;
    top: var(--event-top, 0rem);
    z-index: 2;
}

.day-schedule-event.day-appointment-row.is-short-event {
    gap: 0.35rem;
    grid-template-columns: 3.45rem minmax(0, 1fr);
    padding: 0.2rem 0.5rem;
}

.day-schedule-event.is-short-event .appointment-time {
    font-size: 0.7rem;
    line-height: 1;
}

.day-schedule-event.is-short-event .appointment-copy {
    align-content: center;
}

.day-schedule-event.is-short-event .appointment-copy strong {
    font-size: 0.76rem;
    line-height: 1.05;
}

.day-schedule-event.is-short-event .appointment-copy span {
    display: none;
}

.day-schedule-event.day-appointment-row:hover {
    background: #d2e3fc;
}

.day-schedule-event .appointment-time {
    background: transparent;
    color: #174ea6;
    justify-content: flex-start;
    min-height: 0;
    padding: 0;
}

.day-schedule-event .appointment-copy strong {
    color: #174ea6;
    font-size: 0.86rem;
}

.day-schedule-event .appointment-copy span {
    color: #3c4043;
    font-size: 0.75rem;
}

.calendar-page-layout .calendar-todos {
    background: #fff;
}

.calendar-page-layout .todo-filter-row {
    background: #fff;
    border-bottom-color: #dadce0;
}

.calendar-page-layout .todo-filter {
    border-radius: 999px;
}

.calendar-page-layout .todo-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
}

.calendar-page-layout .todo-item {
    align-content: start;
    grid-template-columns: 1.7rem minmax(0, 1fr);
    padding: 0.6rem 0.9rem;
    row-gap: 0.2rem;
}

.calendar-page-layout .todo-date {
    grid-column: 2;
    justify-self: start;
}

@media (max-width: 1199.98px) {
    .calendar-page-layout.calendar-cockpit {
        grid-template-columns: minmax(210px, 240px) minmax(380px, 1fr) minmax(250px, 300px);
    }
}

@media (min-width: 768px) {
    .calendar-main {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        padding-bottom: 1rem !important;
    }

    .calendar-main .calendar-page-layout.calendar-cockpit {
        flex: 1 1 auto;
        height: calc(100vh - 6rem) !important;
        height: calc(100dvh - 6rem) !important;
        min-height: calc(100vh - 6rem) !important;
        min-height: calc(100dvh - 6rem) !important;
    }
}

@media (max-width: 991.98px) {
    .calendar-page-layout.calendar-cockpit {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        overflow: visible;
    }

    .calendar-page-layout > .calendar-widget:nth-child(1),
    .calendar-page-layout > .calendar-widget:nth-child(2),
    .calendar-page-layout > .calendar-widget:nth-child(3) {
        grid-column: 1;
        grid-row: auto;
    }

    .calendar-page-layout .calendar-day-panel {
        border-left: 1px solid #dadce0;
        border-right: 1px solid #dadce0;
    }

    .day-schedule-grid {
        max-height: 70vh;
    }
}

@media (max-width: 767.98px) {
    #mobileSidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 85%;
        max-width: 280px;
        z-index: 1040;
        overflow-y: auto;
        background: #fff;
    }
}

/* ================================
   Mobile sliding sidebar
   ================================ */
@media (max-width: 767.98px) {

    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 85%;
        max-width: 280px;
        background: #fff;
        z-index: 1040;

        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .mobile-sidebar.open {
        transform: translateX(0);
    }

    /* Prevent background scroll when open */
    body.sidebar-open {
        overflow: hidden;
    }
}

.table-responsive {
    overflow-y: visible;
}

.big-checkbox {
    transform: scale(1.4);
    cursor: pointer;
}

.big-checkbox {
    transform: scale(1.4);
    cursor: pointer;
    margin-top: 2px;
}

#allLeads .list-group-item {
    border-top: none;
}

/* ================================
   PWA tab switcher
   ================================ */

.pwa-tab-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 2px solid #6c757d;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #212529;
    font-size: 1.15rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.pwa-tab-btn:active {
    transform: scale(0.92);
    background: #f1f3f5;
}

.pwa-tab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Fullscreen overlay */
.pwa-tab-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: #f1f3f5;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: pwaTabFadeIn 0.25s ease;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@keyframes pwaTabFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.pwa-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    position: sticky;
    top: 0;
    background: #f1f3f5;
    z-index: 2;
}

.pwa-tab-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 24px;
}

/* Individual tab card */
.pwa-tab-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
}

.pwa-tab-card:active {
    transform: scale(0.96);
}

.pwa-tab-card.active {
    outline: 2px solid #0d6efd;
}

.pwa-tab-card-title {
    padding: 10px 28px 10px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #212529;
    border-bottom: 1px solid #f1f3f5;
}

.pwa-tab-card-preview {
    height: 100px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 0.7rem;
}

.pwa-tab-card-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
}

.pwa-tab-card-close:active {
    background: rgba(0, 0, 0, 0.7);
}

/* Lead disposition options ------------------------------------------------ */
.disposition-options {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.disposition-option {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    font-size: 0.93rem;
    font-weight: 500;
    gap: 0.7rem;
    line-height: 1.2;
    padding: 0.55rem 0.65rem;
    text-align: left;
    transition: background-color 120ms ease;
    width: 100%;
}

.disposition-option:hover {
    background: #f3f4f6;
}

.disposition-option:focus-visible {
    background: #f3f4f6;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15);
    outline: none;
}

.disposition-option-radio {
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    flex-shrink: 0;
    height: 1.05rem;
    position: relative;
    transition: border-color 120ms ease;
    width: 1.05rem;
}

.disposition-option:hover .disposition-option-radio {
    border-color: #94a3b8;
}

.disposition-option.is-active .disposition-option-radio {
    border-color: #1d4ed8;
}

.disposition-option.is-active .disposition-option-radio::after {
    background: #1d4ed8;
    border-radius: 999px;
    content: "";
    height: 0.5rem;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
}

.disposition-option.is-active {
    color: #0f172a;
    font-weight: 600;
}

.disposition-option-label {
    flex: 1 1 auto;
    min-width: 0;
}
