:root {
    --primary: #F27226;
    --secondary: #51D0D6;
    --dark: #1b1b35;
    --text-light: #ffffff;
    --background: #f1f6fd;
    --header-gradient-start: #1b1b35;
    --header-gradient-end: #2c3562;
    --header-border: rgba(255, 255, 255, 0.08);
    --header-glass: rgba(255, 255, 255, 0.08);
    --sidebar-gradient-start: #1b1d38;
    --sidebar-gradient-end: #101222;
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(81, 208, 214, 0.24);
    --sidebar-text: #e7ecff;
    --brand-tagline: rgba(231, 236, 255, 0.72);
    --menu-icon-bg: rgba(81, 208, 214, 0.16);
    --branch-menu-width: 72px;
    --branch-menu-bg: rgb(26 31 68);
    --branch-menu-border: rgba(255, 255, 255, 0.08);
    --branch-tooltip-bg: rgba(12, 16, 38, 0.96);
    --branch-tooltip-text: #f5f8ff;
    --branch-tooltip-shadow: 0 12px 30px rgba(6, 8, 20, 0.45);
    /* Dynamic height for the horizontal icon rail on small screens */
    --icon-rail-height: 72px;
}

/* Global layout and sizing safeguards */
html { height: 100%; }
*, *::before, *::after { box-sizing: border-box; }

  .support-worker-label {
    background: var(--primary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 6px;
  }

  .allied-health-label {
    background: var(--secondary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 6px;
  }

  .work-cover-label {
    background: #d97706;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 6px;
  }

  .progress-note-card.support-worker-note {
    border-left-color: var(--primary);
  }

.progress-note-card.allied-health-note {
    border-left-color: var(--secondary);
  }

.progress-note-card.work-cover-note {
    border-left-color: #d97706;
  }

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #f8f9fa;
    background-image: linear-gradient(120deg, var(--header-gradient-start) 0%, var(--header-gradient-end) 100%);
    background-repeat: no-repeat;
    background-size: 100% 60px;
    background-position: top;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* prevent cross-page horizontal jitter */
}

@supports (padding-top: env(safe-area-inset-top)) {
    body {
        background-size: 100% calc(60px + env(safe-area-inset-top));
    }
}

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  background: linear-gradient(120deg, var(--header-gradient-start) 0%, var(--header-gradient-end) 100%);
  color: var(--text-light);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 18px 40px rgba(15, 16, 32, 0.3);
  backdrop-filter: blur(10px);
}

.lead-link-field {
    position: relative;
}

.lead-link-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-link-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.lead-link-actions--convert {
    margin-top: 4px;
}

.intake-snapshot {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.intake-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.intake-snapshot-block h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #1f2937;
}

.intake-snapshot-text {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.intake-snapshot-list {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.intake-snapshot-muted {
    color: #94a3b8;
    font-size: 12px;
}

.intake-snapshot-meta {
    font-size: 12px;
    color: #64748b;
    margin-right: 12px;
}

.intake-snapshot-contact {
    margin-top: 8px;
}

.lead-link-trigger {
    width: 100%;
    border: 2px solid rgba(81, 208, 214, 0.55);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    background: #fff;
    font-weight: 500;
    font-size: 1rem;
    color: var(--dark);
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 3.25rem;
    box-shadow: 0 4px 12px rgba(27, 27, 53, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    gap: 0.75rem;
}

.lead-link-trigger::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
    transition: transform 0.2s ease;
}

.lead-link-field.is-open .lead-link-trigger {
    border-color: var(--primary);
    box-shadow: 0 10px 24px rgba(27, 27, 53, 0.12);
    transform: translateY(-1px);
}

.lead-link-field.is-open .lead-link-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.lead-link-trigger:hover,
.lead-link-trigger:focus {
    border-color: var(--secondary);
    box-shadow: 0 8px 20px rgba(27, 27, 53, 0.1);
    outline: none;
}

.lead-link-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(27, 27, 53, 0.12);
    box-shadow: 0 20px 38px rgba(27, 27, 53, 0.18);
    z-index: 300;
    overflow: hidden;
}

.lead-link-menu.is-portal {
    position: fixed;
    z-index: 4000;
}

.lead-link-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(27, 27, 53, 0.08);
    background: rgba(241, 246, 253, 0.65);
}

.lead-link-search-input {
    width: 100%;
    border: 1px solid rgba(27, 27, 53, 0.12);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lead-link-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(242, 114, 38, 0.15);
    outline: none;
}

.lead-link-options {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.lead-link-option {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    color: var(--dark);
}

.lead-link-option:hover,
.lead-link-option:focus {
    background: rgba(81, 208, 214, 0.12);
    outline: none;
}

.lead-link-option.is-active {
    background: rgba(242, 114, 38, 0.12);
}

.lead-link-option.is-hidden {
    display: none;
}

.lead-link-option__title {
    font-weight: 600;
    font-size: 0.98rem;
}

.lead-link-option__meta {
    font-size: 0.85rem;
    color: rgba(27, 27, 53, 0.65);
}

.lead-link-option--empty {
    padding: 1.2rem;
    text-align: center;
    font-size: 0.95rem;
    color: rgba(27, 27, 53, 0.6);
}

.lead-review-page {
    background: linear-gradient(180deg, rgba(81, 208, 214, 0.12) 0%, rgba(241, 246, 253, 0.6) 45%, #f8f9fb 100%);
    min-height: calc(100vh - 60px);
    padding-bottom: 48px;
}

.lead-review-hero {
    padding: 48px 0 32px;
    color: var(--dark);
}

.lead-review-hero__content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 32px;
}

.lead-review-hero__intro h1 {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    margin: 12px 0 8px;
}

.lead-review-hero__intro p {
    margin: 0;
    color: rgba(27, 27, 53, 0.72);
    max-width: 540px;
}

.lead-review-hero__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    flex: 1;
}

.lead-review-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(27, 27, 53, 0.08);
    color: var(--dark);
}

.lead-review-pill--approved {
    background: rgba(81, 208, 214, 0.22);
    color: var(--secondary);
}

.lead-review-pill--pending {
    background: rgba(242, 114, 38, 0.18);
    color: var(--primary);
}

.lead-review-pill--rejected {
    background: rgba(220, 53, 69, 0.18);
    color: #dc3545;
}

.lead-review-chip {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 12px 30px rgba(27, 27, 53, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lead-review-chip__label {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: rgba(27, 27, 53, 0.55);
    text-transform: uppercase;
}

.lead-review-chip__value {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--dark);
    word-break: break-word;
}

.lead-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    margin-top: 12px;
}

.lead-review-main {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(27, 27, 53, 0.12);
    padding: 32px;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.lead-form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(27, 27, 53, 0.08);
}

.lead-form-section:last-of-type {
    border-bottom: none;
}

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

.lead-form-section__header h2 {
    margin: 0 0 6px;
    font-size: 1.4rem;
}

.lead-form-section__header h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.lead-form-section__header p {
    margin: 0;
    color: rgba(27, 27, 53, 0.65);
}

.lead-form-section__step {
    align-self: flex-start;
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    background: rgba(81, 208, 214, 0.12);
    color: var(--secondary);
    border-radius: 999px;
    font-weight: 600;
}

.lead-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.lead-form-grid--stretch {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.lead-form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
}

.lead-form-field span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(27, 27, 53, 0.58);
}

.lead-form-field input,
.lead-form-field select,
.lead-form-field textarea {
    border: 1px solid rgba(27, 27, 53, 0.2);
    border-radius: 12px;
    padding: 0.78rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lead-form-field input:focus,
.lead-form-field select:focus,
.lead-form-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.22rem rgba(242, 114, 38, 0.15);
    outline: none;
}

.lead-form-field textarea {
    resize: vertical;
    min-height: 140px;
}

.lead-form-field--wide {
    grid-column: span 2;
}

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

.lead-form-field--range {
    gap: 12px;
}

.lead-form-field--range input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.lead-range-output {
    font-weight: 700;
    color: var(--primary);
    margin-left: 6px;
}

.lead-contact-collection {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lead-contact-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.85);
}

.lead-contact-actions {
    display: flex;
    justify-content: flex-end;
}

.lead-contact-remove {
    border: none;
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.lead-contact-remove:hover {
    background: rgba(148, 163, 184, 0.22);
}

.lead-contact-add {
    align-self: flex-start;
}

.lead-diagnosis-collection {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lead-diagnosis-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.85);
}

.lead-diagnosis-actions {
    display: flex;
    justify-content: flex-end;
}

.lead-diagnosis-remove {
    border: none;
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.lead-diagnosis-remove:hover {
    background: rgba(148, 163, 184, 0.22);
}

.lead-diagnosis-add {
    align-self: flex-start;
}

.lead-detail-page .lead-document-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.lead-detail-page .lead-document-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 12px;
    background: #ffffff;
}

.lead-detail-page .lead-document-group:last-child {
    border-bottom: 1px solid rgba(203, 213, 225, 0.9);
}

.lead-detail-page .lead-document-group__header {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.lead-detail-page .lead-document-group .lead-document-card {
    border: none;
    padding: 0;
}

.lead-detail-page .lead-document-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(203, 213, 225, 0.95);
    background: transparent;
}

.lead-document-card h3 {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.lead-detail-page .lead-document-form {
    gap: 6px;
}

.lead-detail-page .lead-document-form input[type="file"] {
    padding: 0.35rem 0.1rem 0.45rem;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0;
}

.lead-detail-page .lead-document-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.lead-detail-page .lead-document-item {
    padding: 6px 0;
    background: transparent;
    border: none;
    border-bottom: 1px dashed rgba(226, 232, 240, 0.9);
    border-radius: 0;
}

.lead-detail-page .lead-document-item:last-child {
    border-bottom: none;
}

.lead-document-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-document-form input[type="file"] {
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: 12px;
    padding: 10px;
    background: #ffffff;
}

.lead-document-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lead-document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.lead-document-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.lead-document-link:hover {
    text-decoration: underline;
}

.lead-document-date {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}

.lead-field-hint {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: rgba(27, 27, 53, 0.6);
}

.lead-field-warning {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #b5473d;
    background: rgba(242, 114, 38, 0.1);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

.lead-field-warning.is-hidden {
    display: none;
}

.lead-autocomplete-element {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(27, 27, 53, 0.2);
    box-shadow: 0 4px 12px rgba(27, 27, 53, 0.06);
    --gmpx-color-surface: #ffffff;
    --gmpx-color-on-surface: var(--dark);
    --gmpx-color-outline: rgba(27, 27, 53, 0.2);
    --gmpx-color-outline-hover: rgba(242, 114, 38, 0.65);
    --gmpx-color-outline-focus: rgba(242, 114, 38, 0.65);
    --gmpx-color-primary: var(--primary);
}

.lead-autocomplete-element:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.22rem rgba(242, 114, 38, 0.15);
}

.lead-plan-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
}

.lead-plan-options__label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(27, 27, 53, 0.58);
    font-weight: 600;
}

.lead-plan-options__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.lead-plan-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(27, 27, 53, 0.18);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.lead-plan-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lead-plan-chip span {
    color: var(--dark);
    font-weight: 600;
}

.lead-plan-chip:hover,
.lead-plan-chip:focus-within,
.lead-plan-chip:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(242, 114, 38, 0.18);
    background: rgba(242, 114, 38, 0.08);
}

.lead-plan-chip:hover span,
.lead-plan-chip:focus-within span,
.lead-plan-chip input:checked + span {
    color: var(--primary);
}

.lead-plan-manager-field.is-hidden {
    display: none;
}

.lead-review-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 24px;
    border: 1px solid rgba(27, 27, 53, 0.08);
    border-radius: 16px;
    background: rgba(241, 246, 253, 0.7);
}

.lead-review-actions__meta strong {
    display: block;
    font-size: 1.02rem;
    margin-bottom: 4px;
}

.lead-review-actions__meta p {
    margin: 0;
    color: rgba(27, 27, 53, 0.6);
    max-width: 340px;
}

.lead-review-actions__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lead-review-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lead-summary-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 16px 36px rgba(27, 27, 53, 0.12);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lead-summary-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.lead-summary-card__header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.lead-summary-card__chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(81, 208, 214, 0.2);
    color: var(--secondary);
}

.lead-summary-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.lead-summary-list div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lead-summary-list dt {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(27, 27, 53, 0.55);
}

.lead-summary-list dd {
    margin: 0;
    font-weight: 600;
    color: var(--dark);
    word-break: break-word;
}

.lead-summary-text {
    margin: 0;
    line-height: 1.55;
    color: rgba(27, 27, 53, 0.75);
}

.lead-summary-text.is-muted {
    color: rgba(27, 27, 53, 0.45);
}

.lead-history {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lead-history__title {
    display: block;
    font-weight: 600;
    color: var(--dark);
}

.lead-history__meta {
    font-size: 0.88rem;
    color: rgba(27, 27, 53, 0.6);
}

@media (max-width: 1200px) {
    .lead-review-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .lead-review-main {
        order: 1;
    }

    .lead-review-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .lead-review-hero__metrics {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .lead-review-main {
        padding: 24px;
    }

    .lead-review-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .lead-review-actions__buttons {
        width: 100%;
    }

    .lead-review-actions__buttons .btn-primary,
    .lead-review-actions__buttons .btn-secondary {
        flex: 1;
        text-align: center;
    }
}

/* Lead pipeline pages */
.lead-page {
    --lead-accent: var(--primary);
    --lead-accent-soft: rgba(242, 114, 38, 0.14);
    --lead-secondary: var(--secondary);
    background: transparent;
    min-height: calc(100vh - 60px);
    padding: 20px 0 48px;
}

.lead-detail-page {
    background: linear-gradient(180deg, rgba(240, 250, 252, 0.9) 0%, rgba(248, 250, 252, 0.6) 45%, rgba(241, 246, 253, 0.98) 100%);
    min-height: calc(100% + 40px);
    height: calc(100% + 40px);
    margin: -20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.lead-detail-page.lead-page {
    padding: 0;
}

.lead-shell {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 16px;
}

.lead-stagebar {
    margin: 10px 0 16px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 8px 12px;
    box-shadow: 0 12px 24px -20px rgba(15, 23, 42, 0.35);
}

.lead-stagebar-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.lead-stagebar-scroll::-webkit-scrollbar {
    display: none;
}

.lead-stagebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lead-stagebar-item {
    flex: 0 0 auto;
}

.lead-stagebar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: #475467;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .lead-stagebar-list {
        flex-wrap: nowrap;
    }
}

.lead-stagebar-link:hover {
    background: rgba(81, 208, 214, 0.18);
    border-color: rgba(81, 208, 214, 0.35);
    color: #0f172a;
}

.lead-stagebar-item.is-active .lead-stagebar-link {
    background: rgba(242, 114, 38, 0.2);
    border-color: rgba(242, 114, 38, 0.4);
    color: #9a3412;
    box-shadow: 0 8px 16px -12px rgba(242, 114, 38, 0.6);
}

.lead-stagebar-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(81, 208, 214, 0.2);
    color: #1b1b35;
    font-size: 0.75rem;
}

.lead-stagebar-number {
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    color: inherit;
    font-variant-numeric: tabular-nums;
}

.lead-stagebar-item.is-active .lead-stagebar-icon {
    background: rgba(242, 114, 38, 0.3);
    color: #9a3412;
}

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

.lead-fade {
    animation: leadFadeUp 0.5s ease both;
    animation-delay: var(--lead-delay, 0ms);
}

.lead-profile-hero {
    position: relative;
    border-radius: 22px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(81, 208, 214, 0.14) 55%, rgba(242, 114, 38, 0.06) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 48px -32px rgba(15, 23, 42, 0.45);
    overflow: hidden;
}

.lead-profile-hero::before,
.lead-profile-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    opacity: 0.25;
    pointer-events: none;
}

.lead-profile-hero::before {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(81, 208, 214, 0.45), transparent 65%);
    top: -90px;
    right: -40px;
}

.lead-profile-hero::after {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(242, 114, 38, 0.35), transparent 65%);
    bottom: -80px;
    left: -30px;
}

.lead-profile-hero__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.lead-profile-identity {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    max-width: 640px;
}

.lead-profile-identity h1 {
    margin: 6px 0 4px;
    font-size: clamp(1.9rem, 2.8vw, 2.6rem);
    color: var(--dark);
}

.lead-profile-identity p {
    margin: 8px 0 0;
    color: #475467;
    font-size: 0.95rem;
    max-width: 560px;
}

.lead-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475467;
}

.lead-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lead-profile-actions .btn-secondary,
.lead-profile-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.lead-profile-subline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.lead-stage {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475467;
}

.lead-profile-facts {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    position: relative;
    z-index: 1;
}

.lead-profile-fact {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.4);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lead-profile-fact span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.lead-profile-fact strong {
    font-size: 0.98rem;
    color: #0f172a;
}

.lead-metric-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.5);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lead-metric-card--wide {
    grid-column: span 2;
}

.lead-metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.lead-metric-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.lead-metric-sub {
    font-size: 0.82rem;
    color: #64748b;
}

.lead-metric-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #475467;
}

.lead-panel {
    margin-top: 20px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 18px;
    box-shadow: 0 20px 40px -34px rgba(15, 23, 42, 0.45);
}

.lead-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.lead-panel-header h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    color: #101828;
}

.lead-panel-header p {
    margin: 0;
    color: #667085;
    font-size: 0.92rem;
}

.lead-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lead-panel-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(81, 208, 214, 0.16);
    color: #0f172a;
    border: 1px solid rgba(81, 208, 214, 0.3);
    font-weight: 600;
    font-size: 0.82rem;
}

.lead-panel-pill--ghost {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
    color: #475467;
}

.lead-table-wrap {
    margin-top: 14px;
    overflow-x: auto;
}

.lead-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.lead-table thead th {
    text-align: left;
    padding: 10px 12px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    border-bottom: 1px solid #eef2f6;
}

.lead-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f2f7;
    vertical-align: top;
}

.lead-table tbody tr:hover {
    background: #fbfdff;
}

.lead-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lead-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(81, 208, 214, 0.7), rgba(242, 114, 38, 0.85));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.lead-avatar--lg {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
}

.lead-name {
    display: inline-block;
    font-weight: 700;
    color: #1b1b35;
    text-decoration: none;
}

.lead-name:hover {
    text-decoration: underline;
}

.lead-meta {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

.lead-submeta {
    display: block;
    font-size: 0.75rem;
    color: #667085;
    margin-top: 4px;
}

.lead-submeta a {
    color: #475467;
    text-decoration: none;
}

.lead-submeta a:hover {
    text-decoration: underline;
}

.lead-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: #475467;
}

.lead-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.lead-contact-item.is-muted {
    color: #98a2b3;
}

.lead-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #475467;
}

.lead-status--pending,
.lead-status--new-lead {
    background: rgba(242, 114, 38, 0.14);
    color: #b45309;
    border-color: rgba(242, 114, 38, 0.35);
}

.lead-status--contacted,
.lead-status--qualified,
.lead-status--booked-intake,
.lead-status--intake-completed,
.lead-status--clinical-review {
    background: rgba(81, 208, 214, 0.18);
    color: #0f766e;
    border-color: rgba(81, 208, 214, 0.4);
}

.lead-status--onboarded,
.lead-status--active,
.lead-status--approved {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.35);
}

.lead-status--not-proceeding,
.lead-status--unqualified,
.lead-status--rejected {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.4);
}

.lead-date {
    font-weight: 600;
    color: #475467;
    white-space: nowrap;
}

.lead-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lead-actions form {
    margin: 0;
}

.lead-assign {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
    width: 100%;
}

.lead-assign select {
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 12px;
    background: #ffffff;
    color: #0f172a;
    min-width: 150px;
}

.lead-assign--stack {
    flex-direction: column;
    align-items: stretch;
}

.lead-assign-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.lead-assign--stack .btn-secondary {
    align-self: flex-start;
}

.lead-status-form {
    margin-top: 12px;
}

.lead-owner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
}

.lead-owner i {
    color: #94a3b8;
    font-size: 0.9rem;
}

.lead-owner-name {
    display: block;
}

.lead-owner-meta {
    display: block;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
}

.lead-owner--empty {
    color: #98a2b3;
    font-weight: 600;
}

.lead-actions .btn-secondary,
.lead-actions .btn-primary,
.lead-actions .btn-danger {
    white-space: nowrap;
}

.lead-empty {
    text-align: center;
    color: #94a3b8;
    padding: 18px 12px;
}

.lead-profile-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.6fr) minmax(0, 0.95fr);
    gap: 22px;
    align-items: start;
}

.lead-profile-left,
.lead-profile-main,
.lead-profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lead-profile-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 18px 20px;
    box-shadow: 0 16px 32px -28px rgba(15, 23, 42, 0.45);
    width: 100%;
}

.lead-profile-sidebar {
    align-items: stretch;
    width: 100%;
    align-self: start;
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.lead-card-header h2 {
    margin: 4px 0 0;
    font-size: 1.2rem;
    color: #101828;
}

.lead-card-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
}

.lead-definition-list {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
}

.lead-definition-list div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lead-definition-list dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.lead-definition-list dd {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.lead-form--stacked .lead-form-section {
    padding: 16px;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    margin-bottom: 16px;
    border-bottom: none;
    gap: 16px;
}

.lead-form--stacked {
    gap: 22px;
}

.lead-form-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.lead-profile-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
    margin: 16px 0;
}

.lead-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(81, 208, 214, 0.35);
    background: rgba(81, 208, 214, 0.12);
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
}

.lead-link-chip:hover {
    border-color: rgba(81, 208, 214, 0.6);
    background: rgba(81, 208, 214, 0.2);
}

.lead-muted {
    margin: 0;
    color: #98a2b3;
    font-size: 0.9rem;
}

.lead-note {
    margin: 0;
    color: #475467;
    line-height: 1.6;
}

.lead-comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.lead-comment-list--activity {
    max-height: 420px;
    padding-right: 6px;
}

.lead-comment {
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #ffffff;
    padding: 10px 12px;
    box-shadow: 0 12px 20px -18px rgba(15, 23, 42, 0.4);
}

.lead-comment-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.lead-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(226, 232, 240, 0.9);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    font-size: 0.7rem;
    flex: 0 0 auto;
}

.lead-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lead-comment-meta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lead-comment-author {
    color: #1f2937;
    text-transform: none;
    letter-spacing: 0;
}

.lead-comment p {
    margin: 8px 0 0;
    color: #475467;
    line-height: 1.5;
    white-space: pre-wrap;
}

.lead-comment-list--activity .lead-comment {
    border-radius: 10px;
    background: #f8fafc;
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: none;
    border-left: 3px solid rgba(242, 114, 38, 0.4);
}

.lead-comment-list--activity .lead-comment-meta {
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 0.7rem;
}

.lead-comment-list--activity .lead-comment-author {
    font-weight: 600;
}

.lead-comment-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-comment-form--inline {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
}

.lead-comment-form--inline .lead-form-field {
    flex: 1;
}

.lead-comment-form--inline textarea {
    min-height: 72px;
}

.lead-comment-form textarea {
    font-family: inherit;
    font-size: 0.95rem;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    resize: vertical;
}

.lead-comment-form textarea::placeholder {
    color: #94a3b8;
}

.lead-comment-form textarea:focus {
    outline: none;
    border-color: rgba(242, 114, 38, 0.7);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(242, 114, 38, 0.15);
}

.lead-comment-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(242, 114, 38, 0.45);
    background: rgba(242, 114, 38, 0.12);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lead-comment-send:hover {
    border-color: rgba(242, 114, 38, 0.75);
    background: rgba(242, 114, 38, 0.2);
}

.lead-comment-send:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(242, 114, 38, 0.2);
}

.lead-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
}

.lead-modal.is-open {
    display: block;
}

.lead-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
}

.lead-modal-dialog {
    position: relative;
    max-width: 520px;
    margin: 10vh auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
    padding: 18px 20px 20px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    z-index: 1;
}

.lead-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.lead-modal-kicker {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 700;
}

.lead-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
}

.lead-modal-close {
    border: none;
    background: transparent;
    color: #475467;
    padding: 6px;
    cursor: pointer;
    border-radius: 10px;
}

.lead-modal-close:hover {
    background: rgba(148, 163, 184, 0.18);
}

.lead-modal-body {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lead-modal-subtitle {
    margin: 0;
    color: #475467;
    font-size: 0.92rem;
}

.lead-modal-list {
    margin: 0;
    padding-left: 18px;
    color: #1f2937;
}

.lead-modal-list.is-hidden {
    display: none;
}

.lead-modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.lead-modal-error {
    margin: 0;
    color: #b42318;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .lead-modal-dialog {
        margin: 14vh 16px;
    }
}

.lead-allied-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.lead-allied-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.lead-allied-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lead-allied-card__body {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #ffffff;
    box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lead-allied-card:hover .lead-allied-card__body {
    transform: translateY(-1px);
    border-color: rgba(81, 208, 214, 0.6);
    box-shadow: 0 16px 26px -20px rgba(15, 23, 42, 0.45);
}

.lead-allied-card input:checked + .lead-allied-card__body {
    border-color: rgba(81, 208, 214, 0.95);
    box-shadow: 0 16px 30px -20px rgba(81, 208, 214, 0.55);
    background: linear-gradient(135deg, rgba(81, 208, 214, 0.12), rgba(255, 255, 255, 0.98));
}

.lead-allied-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.18);
}

.lead-allied-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(81, 208, 214, 0.9), rgba(242, 114, 38, 0.9));
}

.lead-allied-name {
    display: block;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

.lead-allied-role {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.lead-allied-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lead-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.lead-assignee-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lead-assignee-select {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.4);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lead-assignee-select::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: 0.65;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 10.25a3.75 3.75 0 100-7.5 3.75 3.75 0 000 7.5z' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3.5 17.25c1.35-2.95 4-4.5 6.5-4.5s5.15 1.55 6.5 4.5' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.lead-assignee-select::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    opacity: 0.65;
    pointer-events: none;
    transform: translateY(-50%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    transition: transform 0.15s ease;
}

.lead-assignee-select.is-open::after {
    transform: translateY(-50%) rotate(180deg);
}

.lead-assignee-select select {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 28px 0 0;
    background: transparent;
    color: #0f172a;
    font-weight: 650;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.lead-assignee-trigger {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 28px 0 0;
    background: transparent;
    color: #0f172a;
    font-weight: 650;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    display: none;
    align-items: center;
    gap: 10px;
}

.lead-assignee-trigger__avatars {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
}

.lead-assignee-trigger__avatar {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 16px -14px rgba(15, 23, 42, 0.55);
    margin-left: -8px;
}

.lead-assignee-trigger__avatar:first-child {
    margin-left: 0;
}

.lead-assignee-trigger__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.22);
    color: rgba(15, 23, 42, 0.9);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.lead-assignee-trigger__more {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: rgba(81, 208, 214, 0.16);
    color: rgba(15, 23, 42, 0.9);
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: -8px;
}

.lead-assignee-trigger__label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-assignee-select.is-empty .lead-assignee-trigger__label {
    color: rgba(100, 116, 139, 0.95);
    font-weight: 600;
}

.lead-assignee-select.is-enhanced select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.lead-assignee-select.is-enhanced .lead-assignee-trigger {
    display: flex;
}

.lead-assignee-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
    z-index: 1000;
    overflow: hidden;
}

.lead-assignee-options {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
}

.lead-assignee-option {
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    display: grid;
    grid-template-columns: 28px 1fr 18px;
    align-items: center;
    gap: 10px;
}

.lead-assignee-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    background: rgba(148, 163, 184, 0.12);
    box-shadow: 0 12px 22px -18px rgba(15, 23, 42, 0.45);
}

.lead-assignee-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: rgba(15, 23, 42, 0.85);
    background: rgba(148, 163, 184, 0.2);
}

.lead-assignee-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-assignee-check {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.lead-assignee-option:hover,
.lead-assignee-option:focus {
    background: rgba(81, 208, 214, 0.12);
    outline: none;
}

.lead-assignee-option.is-active {
    background: rgba(242, 114, 38, 0.12);
}

.lead-assignee-option.is-active .lead-assignee-check {
    border-color: rgba(242, 114, 38, 0.65);
    background-color: rgba(242, 114, 38, 0.18);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16.25 5.75l-7.5 8.5-3.5-3.5' stroke='%23f27226' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.lead-assignee-footer {
    padding: 10px 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(241, 246, 253, 0.7);
    display: flex;
    justify-content: flex-end;
}

.lead-assignee-clear {
    border: none;
    background: transparent;
    color: rgba(71, 85, 103, 0.95);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.lead-assignee-clear:hover,
.lead-assignee-clear:focus {
    background: rgba(81, 208, 214, 0.14);
    outline: none;
}

.lead-assignee-select:hover {
    border-color: rgba(81, 208, 214, 0.55);
}

.lead-assignee-select:focus-within {
    border-color: rgba(81, 208, 214, 0.8);
    box-shadow: 0 0 0 2px rgba(81, 208, 214, 0.18), 0 10px 18px -16px rgba(15, 23, 42, 0.4);
}

.lead-profile-card--compact {
    height: auto;
    align-self: stretch;
}

.lead-assignee-grid .lead-team-card {
    display: flex;
    width: 100%;
    margin: 0;
}

.lead-assignee-grid .lead-team-card__body {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    padding: 6px 8px;
    gap: 8px;
    width: 100%;
    border-radius: 10px;
}

.lead-assignee-grid .lead-team-name {
    font-size: 0.85rem;
}

.lead-assignee-grid .lead-team-card:hover .lead-team-card__body {
    transform: none;
}

.lead-assignee-grid .lead-team-avatar {
    width: 32px;
    height: 32px;
}

.lead-team-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.lead-team-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lead-team-card__body {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #ffffff;
    box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lead-team-card:hover .lead-team-card__body {
    transform: translateY(-1px);
    border-color: rgba(81, 208, 214, 0.6);
    box-shadow: 0 16px 26px -20px rgba(15, 23, 42, 0.45);
}

.lead-team-card input:checked + .lead-team-card__body {
    border-color: rgba(81, 208, 214, 0.95);
    box-shadow: 0 16px 30px -20px rgba(81, 208, 214, 0.55);
    background: linear-gradient(135deg, rgba(81, 208, 214, 0.12), rgba(255, 255, 255, 0.98));
}

.lead-team-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.18);
}

.lead-team-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(81, 208, 214, 0.9), rgba(242, 114, 38, 0.9));
}

.lead-team-name {
    display: block;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

.lead-team-role {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}

@media (max-width: 1024px) {
    .lead-profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .lead-profile-hero {
        padding: 20px;
    }

    .lead-profile-actions {
        width: 100%;
    }

    .lead-profile-actions .btn-secondary,
    .lead-profile-actions .btn-primary {
        flex: 1;
        justify-content: center;
    }

    .lead-panel {
        padding: 16px;
    }
}

.layout-wrapper {
  /* Offset for fixed top header incl. safe area on iOS */
  margin-top: calc(60px + env(safe-area-inset-top, 0px));
}

/* Instructions page: use body scrolling, not .main-content */
.page-instructions .main-content {
  height: auto !important;
  min-height: 0 !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: auto !important;
  overscroll-behavior-y: auto !important;
}
@media (max-width: 900px) {
  .page-instructions.has-branch-menu .main-content {
    padding-top: 20px !important; /* neutralize icon-rail padding by default */
  }
}

/* Instructions page: fix the icon rail like the header on mobile */
@media (max-width: 900px) {
  .page-instructions .branch-menu {
    position: fixed !important;
    top: calc(60px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    z-index: 1000; /* under header (1001), above content */
    border-bottom: 1px solid rgba(12, 16, 32, 0.18);
  }
  .page-instructions .branch-menu__scroll {
    overflow: visible !important; /* no inner scrollbar */
  }
  .page-instructions .branch-menu ul {
    flex-wrap: wrap; /* avoid horizontal scrollbar; wrap icons if needed */
    justify-content: center;
  }
  /* Add precise offset so content sits below fixed icon rail */
  .page-instructions.has-branch-menu .main-content {
    padding-top: calc(20px + var(--icon-rail-height, 72px)) !important;
  }
}

/* ——— Hard overrides at end: ensure single scroller and fixed icon rail on Instructions ——— */
@media (max-width: 900px) {
  body.page-instructions .main-content { height: auto !important; min-height: 0 !important; overflow-y: visible !important; }
  body.page-instructions .branch-menu { position: fixed !important; top: calc(60px + env(safe-area-inset-top, 0px)) !important; left: 0; right: 0; width: 100%; height: auto; z-index: 1000; }
  body.page-instructions .branch-menu__scroll { overflow: visible !important; }
  body.page-instructions .branch-menu__scroll::-webkit-scrollbar { display: none !important; }
  body.page-instructions .branch-menu ul { flex-wrap: wrap; justify-content: center; }
  body.page-instructions .instructions-section { scroll-margin-top: calc(60px + var(--icon-rail-height, 72px) + 16px + env(safe-area-inset-top, 0px)) !important; }
  /* Guarantee content starts below fixed icon rail regardless of other paddings */
  body.page-instructions main { padding-top: calc(20px + var(--icon-rail-height, 72px)) !important; }
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.1;
  min-width: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-light);
  white-space: nowrap;
  text-transform: none;
}

.brand-tagline {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-tagline);
  white-space: nowrap;
}

.meta-logo {
  height: 40px;
  width: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
  box-shadow: 0 10px 24px rgba(7, 8, 18, 0.35);
  display: block;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-link,
.header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--header-glass);
  color: var(--text-light);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(15, 16, 32, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.header-icon svg {
  pointer-events: none;
}

.notification-link:hover,
.notification-link:focus-visible,
.header-icon:hover,
.header-icon:focus-visible {
  transform: translateY(-2px);
  background: rgba(81, 208, 214, 0.2);
  border-color: rgba(81, 208, 214, 0.45);
  outline: none;
  box-shadow: 0 16px 32px rgba(15, 16, 32, 0.32);
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.1;
  box-shadow: 0 0 0 3px rgba(27, 27, 53, 0.18);
}

@media (max-width: 600px) {
  .brand-name {
    font-size: 16px;
  }
  .brand-tagline {
    display: none;
  }
  .meta-logo {
    height: 36px;
    width: 36px;
  }
}

.notifications-popover {
  --notif-bg: #f5f8fb;
  --notif-surface: #ffffff;
  --notif-border: #e2e8f0;
  --notif-ink: #0f172a;
  --notif-muted: #6b7280;
  --notif-accent: #1da9b3;
  --notif-accent-soft: #e6f7f9;
  --notif-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  position: absolute;
  top: 60px;
  right: 8px;
  width: min(520px, calc(100vw - 24px));
  max-height: 70svh;
  background: var(--notif-bg);
  border-radius: 16px;
  border: 1px solid var(--notif-border);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  z-index: 1500;
  display: none;
  padding: 0;
}

.notifications-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 28px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--notif-bg);
}

.notifications-content {
  font-size: 14px;
  color: var(--notif-ink);
}

.notifications-content .notification-item {
  border-bottom: 2px solid #ddd;
  padding: 8px 0;
}

.notifications-content .notification-item.unread {
  background: #eef7ff;
}

.notification-timestamp {
  color: #666;
  font-size: 12px;
}


.container {
    padding: 20px;
}

main {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    background-color: var(--primary);
    color: white;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

button[type="submit"],
button[type="button"] {
    padding: 8px 16px;
    font-size: 15px;
}

.flash {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
}
.flash.success { background-color: #d4edda; color: #155724; }
.flash.info { background-color: #d1ecf1; color: #0c5460; }
.flash.warning { background-color: #fff3cd; color: #856404; }
.flash.danger { background-color: #f8d7da; color: #721c24; }

/* Toasts: top-right, non-intrusive notifications */
#toast-container {
  position: fixed;
  top: 72px; /* below fixed header */
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
  pointer-events: none; /* allow clicks to pass except on toasts */
}

.toast {
  min-width: 240px;
  max-width: 360px;
  background: #ffffff;
  color: #333;
  border-left: 4px solid var(--primary);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
  transform: translateX(120%);
  opacity: 0;
  animation: toast-in 180ms ease-out forwards;
  pointer-events: auto; /* enable click on toast */
}

.toast.success { border-left-color: #28a745; }
.toast.info { border-left-color: #17a2b8; }
.toast.warning { border-left-color: #ffc107; }
.toast.danger { border-left-color: #dc3545; }

.toast .toast-close {
  float: right;
  cursor: pointer;
  margin-left: 10px;
  color: #888;
}
.toast .toast-close:hover { color: #333; }

@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

.error-highlight {
  border: 2px solid red;
}

/* Generic keyword highlight (alerts/notes) */
.mh-hl {
  background: #fff2b3;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

/* Temporary focus highlight for navigated items */
.alert-focus {
  box-shadow: 0 0 0 3px rgba(255, 208, 0, 0.6) inset;
  transition: box-shadow 0.3s ease;
}

/* 🌿 Minimal Client Table Style - smaller, not bold */
#clientTable,
#staffTable,
#timesheetTable,
#detailTable,
#teamsColumnTable {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
  color: #000000;
}

#clientTable thead,
#staffTable thead,
#timesheetTable thead,
#detailTable thead,
#teamsColumnTable thead {
  background-color: #dffeff;
}

#clientTable thead th,
#staffTable thead th,
#timesheetTable thead th,
#detailTable thead th,
#teamsColumnTable thead th {
  text-align: left;
  font-weight: 600;
  padding: 12px 16px;
  position: sticky;  /* keep headers visible during scroll */
  top: 0;
  z-index: 1;
}

#clientTable tbody tr,
#staffTable tbody tr,
#timesheetTable tbody tr,
#detailTable tbody tr,
#teamsColumnTable tbody tr {
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

#clientTable tbody tr:hover,
#staffTable tbody tr:hover,
#timesheetTable tbody tr:hover,
#detailTable tbody tr:hover,
#teamsColumnTable tbody tr:hover {
  background-color: #fafafa; /* soft orange tint */
}

#clientTable td,
#staffTable td,
#timesheetTable td,
#detailTable td,
#teamsColumnTable td {
    padding: 5px 5px;
}

/* Layout pills horizontally inside team table cells */
#teamsColumnTable .team-cell-data {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Show full names in team table pills */
#teamsColumnTable .team-pill {
  max-width: none;
  overflow: visible;
  text-overflow: initial;
}

#clientTable td a,
#staffTable td a,
#timesheetTable td a,
#detailTable td a,
#teamsColumnTable td a {
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s;
}

#clientTable td a:hover,
#staffTable td a:hover,
#timesheetTable td a:hover,
#detailTable td a:hover,
#teamsColumnTable td a:hover {
  background-color: #82cccf; /* orange hover */
}

/* Separator rows used in teamsColumnTable to group roles */
#teamsColumnTable tbody tr.section-row {
  background: #dffeff;
  font-weight: 600;
  border-bottom: 1px solid #e0e0e0;
}

#teamsColumnTable tbody tr.section-row .team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 8px 12px;
  background: #dffeff;
  border-bottom: none;
}

#teamsColumnTable tbody tr.section-row .team-card-header .team-id {
  margin-left: 6px;
  font-weight: normal;
  color: #555;
}

#teamsColumnTable tbody tr.section-row .edit-team-link {
  margin-left: 6px;
  color: var(--secondary);
}

#teamsColumnTable tbody tr.section-row .edit-team-link:hover {
  color: #208a96;
}

/* Label column for role names in teams table */
#teamsColumnTable td.role-label {
  width: 20%;
  font-weight: 600;
  color: #666;
  vertical-align: top;
}

/* Wrapper to keep the teams table inside profile card */
.teams-column-wrapper {
  overflow-x: auto;
}

.scroll-client-profile {
  height: calc(100svh - 90px);
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
/* On small screens allow the page content to size naturally and scroll the main container */
@media (max-width: 700px) {
  .scroll-client-profile.dp-detail {
    height: auto !important;
    min-height: calc(100dvh - 90px) !important;
    overflow-y: visible !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

.table-container {
  flex: 1;                 /* fill available height */
  display: flex;
  flex-direction: column;  /* keep controls on top */
  width: 100%;
}

/* New wrapper so only the table scrolls */
.table-scroll {
  height: calc(100svh - 230px);
  overflow-y: auto;        /* vertical scrolling for table */
  overflow-x: auto;        /* keep horizontal scroll */
  overscroll-behavior-y: contain;
}
.table-scroll-client {
  height: calc(100svh - 160px);
  overflow-y: auto;        /* vertical scrolling for table */
  overflow-x: auto;        /* keep horizontal scroll */
  overscroll-behavior-y: contain;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Service Requests List Table */
#srTable { width:100%; border-collapse: collapse; background:#fff; border:1px solid #e0e0e0; border-radius:6px; overflow:hidden; font-size:13px; }
#srTable thead { background: var(--background); }
#srTable thead th { text-align:left; font-weight:600; padding:12px 16px; position: sticky; top:0; z-index:1; }
#srTable tbody td { padding:10px 12px; border-bottom:1px solid #eee; }
#srTable tbody tr:hover { background:#fafafa; }

.sr-input { padding:8px 10px; border:1px solid #d0d5dd; border-radius:8px; background:#fff; }
.sr-select { padding:8px 10px; border:1px solid #d0d5dd; border-radius:8px; background:#fff; }

/* Service Request Tabs */
.sr-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 8px; }
.sr-tab {
  display:inline-flex; align-items:center; gap:8px; text-decoration:none;
  border:1px solid #e0e5f0; border-radius:999px; padding:6px 10px; background:#fff; color:#1b1b35;
}
.sr-tab .sr-tab-badge { min-width:20px; padding:2px 6px; border-radius:999px; background:#eef3ff; color:#47506a; text-align:center; font-size:12px; }
.sr-tab.active { background:#51D0D6; color:#fff; border-color:#42b9c0; }
.sr-tab.active .sr-tab-badge { background:#fff; color:#1b1b35; }

/* Mobile: replace tabs with select */
.sr-tabs-select-wrap { display:none; }
@media (max-width: 700px) {
  .sr-tabs { display:none; }
  .sr-tabs-select-wrap { display:flex; gap:8px; align-items:flex-end; margin:8px 0; }
}

/* Tiny spinner for buttons */
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.spinner { display:inline-block; width:14px; height:14px; border:2px solid currentColor; border-right-color: transparent; border-radius:50%; animation: spin .8s linear infinite; }

/* List headers and controls (clients/staff) */
.list-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:8px 0; }
.list-title { display:flex; align-items:center; gap:8px; font-weight:800; color:#1b1b35; }
.list-title .muted { color:#667085; font-weight:500; }
.list-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.input-with-icon { position:relative; }
.input-with-icon input { padding-left:28px; }
.input-with-icon .bi { position:absolute; left:8px; top:50%; transform:translateY(-50%); color:#98a2b3; }
.status-chip { display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border-radius:999px; font-size:12px; font-weight:600; border:1px solid transparent; }
.status-chip.yes { background:#effdf6; color:#0f7a3b; border-color:#c9f0da; }
.status-chip.no { background:#fff1f1; color:#a4001f; border-color:#ffd8de; }
.action-btns { display:flex; gap:6px; align-items:center; }

/* Compact list table tidy */
.compact { width:100%; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid #eef0f6; border-radius:10px; overflow:hidden; font-size:13px; }
.compact thead th { background:#f8fafc; text-align:left; font-weight:700; padding:10px 12px; color:#101828; }
.compact tbody td { padding:10px 12px; border-top:1px solid #f0f2f7; }
.compact tbody tr:hover { background:#fbfdff; }

/* Staff/client cards reuse */
.client-cards .client-card { border:1px solid #e9edf5; border-radius:10px; background:#fff; padding:10px; box-shadow:0 1px 2px rgba(0,0,0,0.03); }
.client-cards .client-card .client-name { font-weight:700; color:#1b1b35; text-decoration:none; }

/* Service Request Mobile Cards */
.sr-cards { display:none; }
.sr-card { border:1px solid #e0e5f0; border-radius:10px; background:#fff; padding:10px 12px; box-shadow:0 1px 2px rgba(0,0,0,0.04); cursor:pointer; }
.sr-card + .sr-card { margin-top:8px; }
.sr-card:hover { box-shadow:0 2px 10px rgba(0,0,0,0.06); }
.sr-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.sr-card-id { font-weight:700; color:#1b1b35; }
.sr-card-status { display:flex; align-items:center; gap:6px; min-width:0; }
.sr-card-body { display:flex; flex-direction:column; gap:6px; color:#47506a; }
.sr-card-row { display:flex; align-items:center; gap:8px; }
.sr-card-footer { margin-top:8px; font-size:12px; color:#7a8499; }
.sr-card-empty { text-align:center; color:#7a8499; }

/* Keep table view the same on mobile */
@media (max-width: 700px) {
  .table-container { display:block; }
  .sr-cards { display:none; }
}

/* Layout: sidebar under header */
.layout {
    display: flex;
}
  
/* Hamburger icon */
/* Default: hide the hamburger on desktop */
#menu-toggle,
.hamburger-button {
  display: none;
}

.hamburger-button {
  background: var(--header-glass);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 12px 24px rgba(15, 16, 32, 0.24);
}

.hamburger-button .bar {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text-light);
  border-radius: 999px;
  transition:
    opacity 0.12s ease,           /* Fast fade */
    transform 0.28s cubic-bezier(.4,2.2,.5,.95); /* Smooth slide */
}

.hamburger-button:hover,
.hamburger-button:focus-visible {
  transform: translateY(-2px);
  background: rgba(81, 208, 214, 0.18);
  border-color: rgba(81, 208, 214, 0.45);
  box-shadow: 0 16px 32px rgba(15, 16, 32, 0.32);
  outline: none;
}

.hamburger-button.active .bar:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);  /* Match to gap */
  background: var(--primary);
}
.hamburger-button.active .bar:nth-child(2) {
  transform: translateX(-40px); /* Slide to the left */
  opacity: 0;
  background: var(--primary);
}
.hamburger-button.active .bar:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
  background: var(--primary);
}

.sidebar.hidden {
  transform: translateX(-100%);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 999;
  display: none;
}

.sidebar {
    position: fixed;
    top: 60px; /* match height of .top-header */
    left: 0;
    width: 264px;
    height: calc(100svh - 60px); /* full height minus header */
    background: linear-gradient(182deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 18px 0 40px -28px rgba(8, 10, 23, 0.72);
    z-index: 1001; /* ⬅️ Above the overlay */
    padding: 24px 20px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden; /* let inner scroll container handle overflow */
}

.branch-menu {
    position: fixed;
    top: 60px;
    left: 264px;
    width: var(--branch-menu-width);
    height: calc(100svh - 60px);
    background: var(--branch-menu-bg);
    border-right: 1px solid var(--branch-menu-border);
    box-shadow: 14px 0 32px -26px rgba(8, 10, 23, 0.65);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 22px 0;
    box-sizing: border-box;
    z-index: 1000;
    overflow: visible;
}

.branch-menu__scroll {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(81, 208, 214, 0.35) transparent;
    padding: 0 4px;
}

.branch-menu__scroll::-webkit-scrollbar {
    width: 6px;
}

.branch-menu__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.branch-menu__scroll::-webkit-scrollbar-thumb {
    background: rgba(81, 208, 214, 0.32);
    border-radius: 999px;
}

.branch-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.branch-menu li {
    display: flex;
    justify-content: center;
}

.branch-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: rgba(231, 236, 255, 0.78);
    background: transparent;
    position: relative;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.branch-menu a:hover,
.branch-menu a:focus-visible {
    background: rgba(81, 208, 214, 0.2);
    color: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 12px 28px rgba(11, 16, 32, 0.32);
    outline: none;
}

.branch-menu li.active a {
    background: rgba(81, 208, 214, 0.34);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(81, 208, 214, 0.32), 0 16px 36px rgba(11, 16, 32, 0.36);
    transform: translateX(2px);
}

.branch-menu i {
    font-size: 1.2rem;
}

/* Alert dot for branch-menu icons (e.g., Service Requests) */
.branch-menu .menu-alert-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff9f1c;
    box-shadow: 0 0 0 2px rgba(26, 31, 68, 0.95);
}

.branch-menu .branch-badge {
    position: absolute;
    top: 2px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff9f1c;
    color: #1b1b35;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 2px rgba(26, 31, 68, 0.95);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Subtle separator inside branch menus (e.g., Payroll vs Timesheets) */
.branch-menu .branch-separator {
    width: 60%;
    height: 1px;
    background: rgba(231, 236, 255, 0.16);
    border-radius: 1px;
    margin: 8px 0 2px;
}

/* Overdue count pill on Overview */
.overdue-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    background: #ff9f1c; /* orange */
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08), 0 6px 14px rgba(11,16,32,0.18);
    vertical-align: middle;
    cursor: default;
}

/* Cleaner Check-In Overdue Summary styles */
.overdue-summary h3 {
  margin: 0 0 10px;
}
.overdue-summary .table-scroll { max-height: 280px; overflow:auto; }
.overdue-summary table.compact {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}
.overdue-summary thead th {
  font-weight: 600;
  color: #2a335b;
  background: transparent;
  border: none;
}
.overdue-summary tbody tr td {
  border: none;
  background: #eef2ff;
  padding: 10px 12px; 
}
.overdue-summary tbody tr td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}
.overdue-summary tbody tr td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}
.overdue-summary .btn-secondary {
  padding: 6px 10px;
}

/* (Reverted) Remove one-line HP inline styles */

/* (Reverted) Remove HP card styles */

.branch-tooltip {
    position: fixed;
    z-index: 1100;
    pointer-events: none;
    background: var(--branch-tooltip-bg);
    color: var(--branch-tooltip-text);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: var(--branch-tooltip-shadow);
    white-space: nowrap;
    letter-spacing: 0.01em;
    opacity: 0;
    visibility: hidden;
    transform: var(--branch-tooltip-transform, translateY(-50%)) scale(0.94);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.branch-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: var(--branch-tooltip-transform, translateY(-50%)) scale(1);
}

.branch-tooltip::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--branch-tooltip-bg);
    box-shadow: var(--branch-tooltip-shadow);
    transform: rotate(45deg);
}

.stage-tooltip {
    position: fixed;
    z-index: 1105;
    pointer-events: none;
    background: var(--branch-tooltip-bg);
    color: var(--branch-tooltip-text);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: var(--branch-tooltip-shadow);
    white-space: normal;
    line-height: 1.4;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: var(--stage-tooltip-transform, translate(-50%, 0)) scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.stage-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: var(--stage-tooltip-transform, translate(-50%, 0)) scale(1);
}

.stage-tooltip::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--branch-tooltip-bg);
    box-shadow: var(--branch-tooltip-shadow);
    transform: rotate(45deg);
    left: var(--stage-tooltip-caret-left, 50%);
}

.stage-tooltip[data-placement="bottom"]::after {
    top: -4px;
}

.stage-tooltip[data-placement="top"]::after {
    bottom: -4px;
}

.stage-tooltip-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.stage-tooltip-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.stage-tooltip-list li {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-tooltip-list li::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(248, 250, 252, 0.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex: 0 0 auto;
}

.stage-tooltip-list li.is-done {
    text-decoration: line-through;
    color: rgba(148, 163, 184, 0.9);
}

.stage-tooltip-list li.is-done::before {
    content: '✓';
    color: #ffffff;
    background: rgba(34, 197, 94, 0.9);
    border-color: rgba(34, 197, 94, 0.9);
}

.stage-tooltip-list li.is-empty {
    list-style: none;
    margin-left: 0;
    color: rgba(148, 163, 184, 0.85);
    font-style: italic;
}

.stage-tooltip-list li.is-empty::before {
    display: none;
}

.branch-tooltip[data-placement="right"] {
    --branch-tooltip-transform: translateY(-50%);
}

.branch-tooltip[data-placement="right"]::after {
    left: -5px;
    top: var(--branch-tooltip-caret-top, 50%);
    transform: translateY(-50%) rotate(45deg);
}

.branch-tooltip[data-placement="bottom"] {
    --branch-tooltip-transform: translate(-50%, 0);
}

.branch-tooltip[data-placement="bottom"]::after {
    top: -5px;
    /* Allow JS to precisely position caret under tapped icon */
    left: var(--branch-tooltip-caret-left, 50%);
    transform: translateX(-50%) rotate(45deg);
}

.branch-tooltip[data-placement="top"] {
    --branch-tooltip-transform: translate(-50%, -100%);
}

.branch-tooltip[data-placement="top"]::after {
    bottom: -5px;
    /* Allow JS to precisely position caret over tapped icon */
    left: var(--branch-tooltip-caret-left, 50%);
    transform: translateX(-50%) rotate(45deg);
}

.sidebar h2 {
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(231, 236, 255, 0.62);
    margin: 0;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar a {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.sidebar li > a,
.sidebar .dropdown > span {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  position: relative;
  background: transparent;
}

.sidebar li > a:hover,
.sidebar .dropdown > span:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  transform: translateX(4px);
  box-shadow: 0 12px 28px rgba(12, 16, 34, 0.28);
}

.sidebar .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    background: var(--menu-icon-bg);
    color: var(--secondary);
    font-size: 1rem;
}

.sidebar .menu-label {
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
}

.sidebar .menu-alert-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff9f1c;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
    margin-left: auto;
    flex: 0 0 auto;
}

.sidebar li.active {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.sidebar li.active > a {
  background: var(--sidebar-active);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(81, 208, 214, 0.35), 0 12px 32px rgba(11, 16, 32, 0.35);
  transform: translateX(2px);
  padding: 10px 12px;
}

.sidebar li.active > a .menu-icon {
  background: rgba(81, 208, 214, 0.32);
  color: #ffffff;
}

.sidebar .dropdown.current > span {
  background: rgba(81, 208, 214, 0.18);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(81, 208, 214, 0.24);
}

.sidebar .dropdown.current > span .menu-icon {
  background: rgba(81, 208, 214, 0.28);
  color: #ffffff;
}

.sidebar ul ul {
    margin-top: 6px;
    margin-left: 18px;
    gap: 4px;
}

.sidebar li {
    padding: 0;
}

.sidebar .dropdown > span {
    display: flex; /* keep icon, text, chevron aligned */
    align-items: center;
    font-size: 14px;
}

.sidebar .dropdown ul {
    display: none;
    padding-left: 0;
}

.sidebar .dropdown.open ul {
    display: flex;
    flex-direction: column;
}

.sidebar .dropdown > span::after {
    content: '\203A';
    color: rgba(231, 236, 255, 0.62);
    transition: transform 0.2s ease;
    margin-left: auto; /* push chevron to far right */
    padding-left: 10px; /* space between text and chevron */
    font-size: 18px;
}

.sidebar .dropdown.open > span::after {
    transform: rotate(90deg);
    color: var(--secondary);
}

.sidebar ul ul li a {
    display: flex;               /* layout icon + text reliably */
    align-items: center;
    gap: 10px;
    width: 100%;                 /* take available nested width */
    overflow: hidden;            /* allow inner text to ellipsis */
    white-space: nowrap;
    padding-left: 2px;
}

/* Ensure nested menu text can shrink to show at least some characters */
.sidebar ul ul li a .truncate-name {
    flex: 1 1 auto;
    min-width: 0;                /* critical for flex ellipsis */
}

/* Scroll area inside sidebar so footer never overlaps */
.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0; /* allow flex child to shrink for scrolling */
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-right: 8px; /* space for custom scrollbar */
  margin-right: -8px;
}

/* Subtle scrollbar styling */
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 8px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
 
  .sidebar-footer {
    margin-top: auto; /* push footer to bottom without overlapping */
    padding: 20px 0 0;
    box-sizing: border-box;
    background: transparent;
    color: var(--sidebar-text);
    border-top: 1px solid var(--sidebar-border);
  }
  
  .sidebar-user {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.4;
  }

  /* Sidebar: User card */
  .sidebar-user-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 20px 36px rgba(8, 11, 25, 0.32);
    backdrop-filter: blur(12px);
  }
  .sidebar-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0; /* enable truncation inside */
    flex: 1 1 auto; /* take remaining row space */
  }
  .sidebar-user-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary), #7ce7ed);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;         /* readable initials */
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(12, 16, 34, 0.35);
  }
  .sidebar-user-meta {
    min-width: 0; /* enable truncation */
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .sidebar-user-name {
    color: #fff;
    font-weight: 700;
    font-size: 13px;  /* per request */
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sidebar-user-email {
    color: rgba(231, 236, 255, 0.68);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sidebar-gear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 28px rgba(9, 12, 26, 0.28);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  }
  .sidebar-gear-btn:hover { background: rgba(81, 208, 214, 0.2); border-color: rgba(81, 208, 214, 0.4); text-decoration: none; transform: translateY(-2px); }
  .sidebar-gear-btn .bi { font-size: 1.2rem; }
  .sidebar-gear-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(81, 208, 214, 0.4); }

/* Make sure mobile layout triggers at typical iPhone widths */
@media (max-width: 1024px) {
  .brand-name {
    font-size: 17px;
  }
  #menu-toggle,
  .hamburger-button {
    display: flex;         /* or inline-flex, depending on your preference */
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: 264px;
    height: calc(100svh - 60px);
    background: linear-gradient(182deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 24px 0 44px -26px rgba(8, 10, 23, 0.76);
    transform: translateX(-120%);
    transition: transform 0.3s ease;
    z-index: 2000;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 28px 20px 20px;
  }
  .sidebar ul ul {
      margin-top: 4px; /* slightly tighter on mobile */
      margin-left: 12px;
  }
  .sidebar li {
      padding-bottom: 0; /* reduce vertical spacing on mobile */
      padding-top: 0;
  }
  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar.active ~ .sidebar-overlay {
    display: block;
  }
  .sidebar li.active > a {
    display: flex;
    padding: 12px 14px;
  }
  .sidebar a {
    font-size: 15px; /* comfortable tap target */
  }
  .sidebar .dropdown > span {
    font-size: 15px; /* comfortable tap target */
  }
  .sidebar li > a,
  .sidebar .dropdown > span {
    padding: 12px 14px;
    border-radius: 16px;
  }
  .main-content {
    display: flex;
    flex-direction: column;
    margin-left: 0 !important;
    height: calc(100svh - 60px);
  }

  .day-column,
  .day-column.current-day {
    height: auto !important;
    min-height: 120px;
    max-width: 90vw;
    margin-bottom: 18px;
    width: 190px;
    flex: 0 0 190px;
    display: flex;
    flex-direction: column;
  }

  .date_goal {
    width: 50%;
    height: 35px;
    font-size: 16px;
  }

  .week-controls {
    gap: 4px;
    row-gap: 4px;
    font-size: 14px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .week-controls button,
  .week-controls #go-today,
  .week-controls a.button {
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 7px 8px;
    min-width: 42px;
    max-width: 53px;
  }

  .week-totals {
    gap: 8px;
    font-size: 14px;
    margin-top: 8px;
    justify-content: center;
  }

  .layout {
    flex-direction: column;
  }

  .activity-row, .document-row {
    display: block !important;
  }

  form input[type="text"],
  form select {
    margin-bottom: 5px !important;
    margin-top: 5px !important;
 }

  .overview-flex-container {
    flex-direction: column;
    gap: 0;
  }

  .profile-section.activity-overview-section,
  .profile-section.planner-section {
    max-width: 100% !important;
    min-width: 0 !important;
    flex: unset !important;
    padding: 22px 20px 12px 20px;
    height: auto;
  }
  .activity-filter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
  }
  .activity-log-card {
    padding: 10px 6px 8px 8px;
    font-size: 0.97rem;
  }
  .activity-pagination {
    gap: 7px;
  }
  .activity-pagination-label {
    min-width: unset;
    font-size: 12px;
  }
}
  
  .logout-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
  }
  
  .logout-button:hover {
    background-color: var(--secondary);
  }  

.truncate-name {
    display: inline-block;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    min-width: 0; /* allow shrinking in flex parents */
}

main {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main-content {
    display: flex;
    flex-direction: column;
    height: calc(100svh - 60px); /* desktop */
    overscroll-behavior-y: contain;
    overflow-y: auto;
    margin-left: 264px; /* align with sidebar width */
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    background-color: var(--background);
    box-sizing: border-box;
    width: 100%;
}

.has-branch-menu .main-content {
    margin-left: calc(264px + var(--branch-menu-width));
}
@media (max-width: 900px) {
  /* Let the page (body) be the scroller to avoid nested scroll cut-offs */
  .main-content {
    margin-left: 0;
    height: auto;
    min-height: calc(100svh - 60px);
    overflow-y: visible;
  }
  .has-branch-menu .main-content {
    margin-left: 0;
    /* Push content below the horizontal icon rail (approx 72px tall) */
    padding-top: calc(20px + 72px);
  }
  .branch-menu {
    position: sticky;
    top: 60px;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background: var(--branch-menu-bg);
    border-right: none;
    border-bottom: 1px solid rgba(12, 16, 32, 0.18);
    padding: 12px 18px;
    box-shadow: none;
    overflow: visible;
    z-index: 999;
  }
  .branch-menu__scroll {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding: 0;
  }
  .branch-menu__scroll::-webkit-scrollbar {
    display: none;
  }
  .branch-menu ul {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    gap: 10px;
  }
  .branch-menu li {
    flex: 0 0 auto;
  }
  .branch-menu a {
    width: 48px;
    height: 48px;
    transform: none;
  }
  .branch-menu a:hover,
  .branch-menu a:focus-visible,
  .branch-menu li.active a {
    transform: none;
  }
  /* On phones, make the branch separator vertical in the horizontal icon rail */
  .branch-menu .branch-separator {
    width: 1px;
    height: 32px;
    margin: 0 10px;
    background: rgba(231, 236, 255, 0.16);
  }
  /* Ensure generic week containers don't cap height on phones */
  .week-scroll-container { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  /* Make inner content comfortably scrollable with safe bottom space */
  .scroll-client-profile { height: auto !important; min-height: calc(100dvh - 90px) !important; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
/* Smooth scroll on iOS */
.main-content { -webkit-overflow-scrolling: touch; }

/*Week Control Buttons*/
.week-controls {
  display: flex;
  align-items: center;
  gap: 8px;             /* less spacing between buttons */
  justify-content: center;
  row-gap: 8px;
}

.week-controls button,
.week-controls #go-today,
.week-controls a.button {
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 4px;
  margin: 0;
  flex: none;
}

.week-controls button:hover,
.week-controls a.button:hover {
  background-color: var(--secondary);
}

#week-label {
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.week-totals {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 14px;
}

.week-totals span {
  font-weight: 600;
}
  
/* Loader Spinner */
.loader {
  display: inline-block;
  border: 5px solid #eee;
  border-top: 5px solid #51D0D6;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}


/* Schedule card list */
.week-grid {
  display: flex;
  flex: 1 1 0;
  align-items: stretch;
  width: 100%;
  gap: 12px;
  margin-top: 20px;
  padding: 0 0 20px 0;
  box-sizing: border-box;
  overflow-x: auto;
  min-height: 0;
}


.day-column,
.day-column.current-day {
  flex: 1 1 0;
  min-width: 190px;
  background-color: #fff;
  padding: 10px;
  border-radius: 6px;
  background: #fdfdfd;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  height: 100%;      /* Take all vertical space in parent */
  display: flex;
  flex-direction: column;
}
.day-column.current-day {
  background-color: #e9f6fb;
  box-shadow: 0 0 6px rgba(81,208,214,0.18);
  border: 1.5px solid #51D0D6;
}

.day-column h3 {
    text-align: center;
    font-size: 16px;
    margin: 8px 0;
    color: var(--dark);
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}
.day-of-week {
  font-size: 16px;
  font-weight: bold;
  color: var(--dark);
  letter-spacing: 0.02em;
}
.day-of-month {
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
  margin-top: 2px;
  margin-bottom: 2px;
}

.schedule-card {
    background-color: white;
    border-left: 4px solid var(--primary);
    padding: 8px 10px;
    margin: 10px 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.schedule-card h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: var(--dark);
}

.schedule-card .time {
    font-size: 13px;
    color: #666;
}

.schedule-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.schedule-card a:hover {
    text-decoration: underline;
}

.schedule-card .extras {
    margin-top: 8px;
    font-size: 13px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 4px;
}

.no-shifts {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 6px;
}

/* Inputs, labels, textareas */
form label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-top: 16px;
}

#go-today {
  background: #51D0D6;
  color: #ffffff;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: bold;
  transition: background 0.15s;
}
#go-today:hover {
  background: #51D0D6;
  color: #ffffff;
  border-color: #1b1b35;
}


form input[type="text"],
form select,
form textarea {
    box-sizing: border-box;
    max-width: 100%;
    resize: none;
    font-size: 14px;
    padding: 8px 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Grid layout for client profile form */
.form-grid {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.form-grid.two-cols {
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
}

.form-col {
    flex: 1;
    min-width: 280px;
}

/* Repeatable row styling */
.activity-row,
.document-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.activity-row input[type="text"],
.document-row input[type="text"],
.document-row input[type="file"] {
    flex: 1;
}

/* Section background (optional) */
.form-section {
    background-color: #f9f9fc;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Balance row input widths */
.activity-row .activity-name {
    flex: 2;
  }
  
.activity-row .activity-select {
    flex: 1;
    min-width: 140px;
}

.delete-activity {
    background: transparent;
    color: #b00020;
    font-weight: bold;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
  }

.delete-activity:hover {
    color: red;
  }

.client-summary {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
  
.summary-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 15px;
}
  
.summary-row .label {
    font-weight: bold;
    min-width: 140px;
    color: #333;
}

/*goal cards*/
.goal-card {
    background-color: #fff;
    border: 1px solid #e6e7ee;
    border-left: 4px solid var(--primary);
    padding: 0;
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16,24,40,0.04);
    max-width: 100%;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.05s;
}

.goal-card:hover { box-shadow: 0 6px 14px rgba(16,24,40,0.10); transform: translateY(-1px); }

.goal-card h4 { margin: 0; color: var(--dark); font-size: 16px; }

.goal-header { display:grid; grid-template-columns: 1fr auto; align-items:center; gap: 8px 10px; padding: 12px 14px; background:#fffbf8; border-bottom:1px solid #fde7d9; }
.goal-header h4 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.goal-dates { display:flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.goal-dates span { font-size: 12px; color: #8f6a54; background:#ffe7d7; border:1px solid #ffd1b5; border-radius: 999px; padding: 3px 8px; }

.goal-dates { display:flex; gap: 8px; flex-wrap:wrap; }
.goal-dates span { font-size: 12px; color: #8f6a54; background:#ffe7d7; border:1px solid #ffd1b5; border-radius: 999px; padding: 3px 8px; }


.goal-card .goal-desc { padding: 10px 14px; color:#475467; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.goal-card label { display:block; margin-top: 10px; font-weight: 600; color:#333; }

.goal-card input[type="text"],
.goal-card input[type="date"],
.goal-card textarea {
    width: 100%;
    padding: 6px 10px;
    font-size: 14px;
    margin-top: 4px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
}

.goal-card button {
    margin-top: 10px;
    margin-right: 10px;
}

.goal-stats { padding: 8px 12px 12px; font-size: 12px; color:#475467; display:flex; flex-wrap:wrap; align-items:center; gap: 8px; }

/* Compact goals grid */
.goals-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.goals-grid .goal-card { margin: 0; }

.goal-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Client goal experience */
.client-goals-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.goals-hero {
    position: relative;
    border-radius: 18px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(81,208,214,0.14), rgba(20,80,255,0.10));
    border: 1px solid rgba(81,208,214,0.25);
    overflow: hidden;
}

.goals-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(81,208,214,0.25), rgba(20,80,255,0.18));
    opacity: 0.35;
    pointer-events: none;
}

.goals-hero-grid {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
}

.goals-hero-copy {
    max-width: 600px;
}

.goals-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.75);
    color: #0f4c81;
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
}

.goals-hero-copy h1 {
    margin: 16px 0 12px;
    font-size: 30px;
    color: #10203b;
}

.goals-hero-copy p {
    margin: 0;
    font-size: 16px;
    color: #2c3f58;
    line-height: 1.6;
}

.goals-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.btn-tertiary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(16,32,59,0.15);
    background: rgba(255,255,255,0.85);
    color: #10203b;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.btn-tertiary:hover {
    border-color: rgba(16,32,59,0.3);
    box-shadow: 0 4px 12px rgba(16,32,59,0.12);
}

.goals-hero-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.goals-hero-stat {
    background: rgba(255,255,255,0.86);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 8px 22px rgba(16,32,59,0.08);
}

.goals-hero-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #10203b;
}

.goals-hero-stat .stat-label {
    font-size: 13px;
    color: #406080;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.goals-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 28px;
    align-items: start;
}

.goal-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.goal-list-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.goal-list-header h2 {
    margin: 0;
    font-size: 24px;
    color: #12253f;
}

.goal-list-header p {
    margin: 4px 0 0;
    color: #4f6075;
}

.goal-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.goal-tile {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(16,32,59,0.08);
    box-shadow: 0 12px 28px rgba(16,32,59,0.06);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.goal-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(16,32,59,0.12);
}

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

.goal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.goal-title-wrap h3 {
    margin: 0;
    font-size: 20px;
    color: #0f1f39;
}

.goal-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(81,208,214,0.12);
    color: #116573;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 600;
}

.goal-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.goal-cta:hover { color: #0d8ea1; }

.goal-timeline {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: #46586f;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.timeline-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
    color: #7a8aa3;
}

.timeline-value {
    font-weight: 600;
    color: #15294a;
}

.timeline-bar {
    height: 2px;
    background: linear-gradient(90deg, rgba(81,208,214,0.6), rgba(20,80,255,0.35));
    border-radius: 2px;
}

.goal-summary {
    margin: 0;
    color: #364963;
    line-height: 1.6;
}

.goal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 16px;
    background: #f6f8fc;
    border-radius: 14px;
}

.goal-metrics div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.goal-metrics dt {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #607089;
}

.goal-metrics dd {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f1f39;
}

.goals-empty-state {
    padding: 48px 32px;
    background: #fff;
    border-radius: 18px;
    border: 1px dashed rgba(15,31,57,0.2);
    text-align: center;
    box-shadow: 0 12px 28px rgba(16,32,59,0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.goals-empty-state .empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(81,208,214,0.18);
    display: grid;
    place-items: center;
    font-size: 28px;
    color: #0f6e7d;
}

.goals-empty-state p {
    max-width: 420px;
    color: #4b5d75;
}

.goal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 94px;
}

.sidebar-card,
.sidebar-hint {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(16,32,59,0.08);
    box-shadow: 0 10px 24px rgba(16,32,59,0.06);
    padding: 24px;
}

.sidebar-card h2,
.sidebar-card h3,
.sidebar-hint h3 {
    margin-top: 0;
    color: #12253f;
}

.sidebar-card p,
.sidebar-hint p {
    color: #4f6075;
    line-height: 1.55;
}

.sidebar-hint {
    background: linear-gradient(135deg, rgba(255,242,211,0.65), rgba(255,222,171,0.6));
    border: 1px solid rgba(255,187,76,0.35);
}

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

.form-modern textarea {
    resize: vertical;
}

.goal-comment-composer .textarea-wrap textarea {
    min-height: 120px;
}

/* Goal overview */
.goal-overview-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.goal-overview-hero {
    border-radius: 20px;
    padding: 32px;
    background: linear-gradient(120deg, rgba(81,208,214,0.18), rgba(13,110,253,0.12));
    border: 1px solid rgba(81,208,214,0.25);
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: space-between;
}

.goal-hero-left {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-hero-left h1 {
    margin: 0;
    font-size: 28px;
    color: #0f1f39;
}

.goal-hero-left p {
    margin: 0;
    color: #304860;
    line-height: 1.6;
}

.goal-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.82);
    color: #0f4c81;
    border-radius: 999px;
    padding: 5px 12px;
    font-weight: 600;
}

.goal-hero-right {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    align-items: start;
}

.goal-hero-stat {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(16,32,59,0.08);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.goal-hero-stat .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64809e;
}

.goal-hero-stat .value {
    font-weight: 700;
    font-size: 20px;
    color: #0f1f39;
}

.goal-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 28px;
    align-items: start;
}

.goal-overview-main,
.goal-overview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.goal-summary-card,
.goal-edit-card,
.goal-comment-composer,
.goal-comment-section,
.sidebar-card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(16,32,59,0.08);
    box-shadow: 0 14px 28px rgba(16,32,59,0.08);
    padding: 28px;
}

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

.goal-summary-header h2 {
    margin: 0;
    font-size: 22px;
    color: #12253f;
}

.goal-summary-header p {
    margin: 4px 0 0;
    color: #4f6075;
}

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

.goal-summary-body p {
    margin-top: 0;
    margin-bottom: 18px;
    line-height: 1.65;
    color: #364963;
}

.goal-summary-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 18px;
    background: #f7f9fc;
    border-radius: 16px;
}

.goal-summary-meta div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.goal-summary-meta dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #607089;
    display: flex;
    align-items: center;
    gap: 6px;
}

.goal-summary-meta dd {
    margin: 0;
    font-weight: 700;
    font-size: 18px;
    color: #12253f;
}

.goal-edit-card .form-modern {
    margin-top: 4px;
}

.goal-comment-composer header h2,
.goal-comment-section .section-header h2 {
    margin: 0;
    font-size: 20px;
    color: #12253f;
}

.goal-comment-composer header p,
.goal-comment-section .section-header p {
    margin: 6px 0 0;
    color: #4f6075;
}

.goal-comment-composer header {
    margin-bottom: 18px;
}

.goal-comment-section .section-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.goal-comment-section .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.goal-comment-section .filters input[type="text"] {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(16,32,59,0.12);
    min-width: 220px;
}

.goal-comment-section .filter-dates {
    display: flex;
    gap: 12px;
}

.goal-comment-section .filter-dates label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #607089;
}

.goal-comment-section .filter-dates input[type="date"] {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(16,32,59,0.12);
}

.comment-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.comment-card {
    background: #f8fbff;
    border-radius: 16px;
    border: 1px solid rgba(16,32,59,0.08);
    padding: 20px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #10203b;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: grid;
    place-items: center;
}

.comment-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.comment-header .timestamp {
    font-size: 13px;
    color: #6f8098;
    margin-left: 8px;
}

.comment-documents {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-doc {
    background: #fff;
    border: 1px solid rgba(16,32,59,0.12);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.comment-doc .label {
    font-weight: 600;
    color: #12253f;
}

.comment-doc .actions {
    display: flex;
    gap: 12px;
    font-size: 14px;
}

.comment-edit textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(16,32,59,0.16);
}

.empty-timeline {
    border-radius: 18px;
    border: 1px dashed rgba(16,32,59,0.18);
    padding: 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    color: #4f6075;
}

.goal-overview-sidebar .sidebar-card {
    box-shadow: 0 12px 28px rgba(16,32,59,0.08);
}

.insight-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #364963;
}

.insight-list li {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 600;
}

.insight-list i {
    color: var(--primary);
}

.note-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.note-filter label {
    font-size: 13px;
    font-weight: 600;
    color: #4f6075;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.note-filter input[type="text"],
.note-filter input[type="date"] {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(16,32,59,0.12);
}

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

.sidebar-note-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-note {
    border-radius: 14px;
    border: 1px solid rgba(16,32,59,0.12);
    background: #f8fbff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-note .note-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sidebar-note .tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 999px;
    padding: 4px 8px;
    font-weight: 600;
}

.sidebar-note .tag.support { background: rgba(255,196,140,0.28); color: #b46a15; }
.sidebar-note .tag.allied { background: rgba(81,208,214,0.28); color: #116573; }

.sidebar-note .note-date {
    font-size: 12px;
    color: #6f8098;
}

.sidebar-note .note-body strong {
    color: #12253f;
}

.sidebar-note .note-body p {
    margin: 6px 0;
    color: #364963;
    line-height: 1.5;
}

.sidebar-note .note-body footer {
    font-size: 12px;
    color: #6f8098;
}

.sidebar-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #4f6075;
}

.sidebar-pagination form button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 1100px) {
    .goals-layout,
    .goal-overview-layout {
        grid-template-columns: 1fr;
    }

    .goal-sidebar,
    .goal-overview-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .goals-hero,
    .goal-overview-hero {
        padding: 24px;
    }

    .goal-tile,
    .goal-summary-card,
    .goal-edit-card,
    .goal-comment-composer,
    .goal-comment-section,
    .sidebar-card,
    .sidebar-hint {
        padding: 20px;
    }

    .goal-comment-section .filters input[type="text"] {
        min-width: 0;
        flex: 1 1 auto;
    }

    .goal-comment-section .filter-dates {
        width: 100%;
        justify-content: space-between;
    }

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

@media (max-width: 520px) {
    .goals-hero-stats,
    .goal-hero-right {
        grid-template-columns: 1fr;
    }

    .goal-card-grid {
        grid-template-columns: 1fr;
    }

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

    .goal-comment-section .filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/*Progress Note Page*/
  .note-card-clickable {
    cursor: pointer;
    transition: box-shadow 0.13s, background 0.13s;
  }
  .note-card-clickable:hover {
    box-shadow: 0 2px 10px rgba(81,208,214,0.12);
    background: #f7fcff;
  }
  .note-card-selected {
    background: #e2f5fa !important;
    box-shadow: 0 2px 14px rgba(81,208,214,0.20) !important;
    border-left: 4px solid #27a1af;
  }

  .progress-note-list { 
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
  }
  
  .progress-note-card {
    background-color: white;
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    font-size: 14px;
  }
  
  .note-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
  }
  
  .note-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
  }
  
  /* Progress Notes */
  .progress-note-card {
    background-color: white;
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .note-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
  }
  
  .note-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
  }
  
  .filter-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 12px;
  }
  
  .filter-bar input[type="text"],
  .filter-bar input[type="date"] {
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
  }
  
  .filter-bar input[type="text"] {
    flex: 1 1 150px;
    min-width: 0;
  }

  .filter-bar input[type="date"] {
    width: auto;
    min-width: 120px;
  }
  
#commentSearch {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid rgba(16,32,59,0.12);
    margin-bottom: 0;
}

  .date-range {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    margin-top: 0;
  }

  .date-range input[type="date"] {
    padding: 8px 10px;
    font-size: 14px;
    width: auto;
    box-sizing: border-box;
    min-width: 120px;
  }

  .date-range label {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  

/* Goal Overview Sections */
.comment-section {
  background-color: #ffffff;
  padding: 20px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 30px;
}

/* Modern form layout for goal edit */
.form-modern .form-row { margin-bottom: 12px; }
.form-modern label { display:block; font-weight: 600; color:#333; margin-bottom: 6px; }
.form-modern input[type="text"],
.form-modern input[type="date"],
.form-modern textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  box-sizing: border-box;
}
.form-modern .form-row.two { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-modern .inline-actions { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; margin-top: 6px; }

.document-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}

.comment-item {
  list-style: none;
  margin-bottom: 12px;
  background-color: #fff;
  border: 1px solid #e6e7ee;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(16,24,40,0.05);
}

.comment-item small {
  display: block;
  color: #666;
  font-size: 13px;
  margin-top: 10px;
}

/* Comment list: avatar + body */
.comment-row { display:flex; gap:10px; }
.comment-avatar {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 50%; background:#e7effa; color:#1b1b35;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 12px;
}
.comment-body { flex: 1 1 auto; min-width: 0; }
.comment-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom: 4px; }
.comment-text { color:#313153; line-height: 1.5; }
.btn-link { background:none; border:none; color: var(--primary); padding:0; cursor:pointer; font-weight:600; }
.btn-link.small { font-size: 12px; }

.commentListBox {
    padding-inline-start: 0px;
}

.comment-actions button {
  margin-right: 10px;
}

/* Documents page */
.documents-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  background: #f5f7fb;
  min-height: calc(100svh - 90px);
  box-sizing: border-box;
}

.documents-header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e4e7ee;
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.documents-header__text h1 {
  margin: 8px 0 6px;
  font-size: 28px;
  line-height: 1.2;
  color: #121325;
}

.documents-header__text p {
  margin: 0;
  color: #4b5565;
  max-width: 520px;
}

.documents-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.documents-back-link:hover {
  text-decoration: underline;
}

.documents-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.documents-stat {
  min-width: 140px;
  background: linear-gradient(140deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0.02));
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.documents-stat__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f6b7b;
}

.documents-stat__value {
  font-size: 28px;
  font-weight: 700;
  color: #1b1b35;
  line-height: 1;
}

.documents-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #e4e7ee;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

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

.documents-filter-button {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
}

.documents-filter-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.documents-filter-button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 12px 20px rgba(242, 114, 38, 0.28);
}

.documents-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f2f4f7;
  border-radius: 999px;
  padding: 8px 16px;
  border: 1px solid transparent;
  width: 100%;
  max-width: 320px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.documents-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(242, 114, 38, 0.18);
}

.documents-search input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: #1f2933;
}

.documents-search input::placeholder {
  color: #9aa4b2;
}

.documents-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 20px;
  align-items: flex-start;
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.documents-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  background: #fff;
  border: 1px dashed #d0d5dd;
  border-radius: 18px;
  padding: 40px 24px;
  color: #5f6b7b;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.documents-empty i {
  font-size: 40px;
  color: var(--primary);
}

.documents-empty--initial {
  display: flex;
}

.documents-empty--filters {
  display: none;
}

.documents-table-wrapper {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  overflow-x: auto;
  overflow-y: hidden;
}

.documents-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.documents-table thead th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5f6b7b;
  padding: 12px 18px;
  background: #f9fafc;
  border-bottom: 1px solid #e5e9f5;
}

.documents-table__actions-heading {
  text-align: right;
}

.documents-table tbody tr {
  border-bottom: 1px solid #eef1f8;
  transition: background-color 0.18s ease;
}

.documents-table tbody tr:last-child {
  border-bottom: none;
}

.documents-table tbody tr:hover {
  background: #f4f6fb;
}

.documents-table td {
  padding: 10px 18px;
  vertical-align: middle;
  font-size: 14px;
  color: #2f3a4c;
}

.documents-table__name {
  max-width: 100%;
}

.documents-table__label {
  display: block;
  font-weight: 600;
  color: #101828;
}

.documents-table__filename {
  display: block;
  font-size: 12px;
  color: #667085;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.documents-table__type {
  width: 1%;
  white-space: nowrap;
}

.documents-table__date {
  white-space: nowrap;
  color: #667085;
  font-size: 12px;
}

.documents-table__date--empty {
  color: #98a2b3;
}

.documents-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.documents-type-badge--goal {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.2);
  color: rgba(79, 70, 229, 1);
}

.documents-type-badge--general {
  background: rgba(242, 114, 38, 0.12);
  border-color: rgba(242, 114, 38, 0.2);
  color: rgba(242, 114, 38, 1);
}

.documents-type-badge--ndis {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.2);
  color: rgba(16, 185, 129, 1);
}

.documents-table__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.documents-table__action {
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #344054;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(52, 64, 84, 0.18);
  transition: all 0.18s ease-in-out;
}

.documents-table__action:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(242, 114, 38, 0.2);
}

.documents-table__delete {
  display: inline-flex;
  margin: 0;
}

.link-danger {
  border: none;
  background: none;
  color: #d92d20;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
}

.link-danger:hover {
  text-decoration: underline;
}

.documents-upload {
  position: sticky;
  top: 24px;
}

.documents-upload__card {
  background: linear-gradient(180deg, rgba(242, 114, 38, 0.08), rgba(242, 114, 38, 0.02));
  border: 1px solid rgba(242, 114, 38, 0.18);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 18px 30px rgba(242, 114, 38, 0.18);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.documents-upload__card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #7a3417;
}

.documents-upload__card p {
  margin: 0;
  color: #9a4f32;
  font-size: 14px;
  line-height: 1.5;
}

.documents-upload__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.documents-upload__label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a3417;
}

.documents-upload__label span {
  font-weight: 400;
  color: #b86b4a;
  text-transform: none;
  letter-spacing: normal;
}

.documents-upload__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #7a3417;
  cursor: pointer;
}

.documents-upload__checkbox input {
  width: 18px;
  height: 18px;
  accent-color: rgba(79, 70, 229, 1);
}

.documents-upload__checkbox span {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}

.documents-upload__form input[type="file"],
.documents-upload__form input[type="text"] {
  border: 1px solid rgba(79, 70, 229, 0.24);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  color: #101828;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.08);
}

.documents-upload__form input[type="file"]::-webkit-file-upload-button {
  border: none;
  background: rgba(79, 70, 229, 0.18);
  color: rgba(79, 70, 229, 1);
  border-radius: 8px;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: 500;
}

.documents-upload__form input[type="file"]::file-selector-button {
  border: none;
  background: rgba(79, 70, 229, 0.18);
  color: rgba(79, 70, 229, 1);
  border-radius: 8px;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: 500;
}

.documents-upload__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(79, 70, 229, 1);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(79, 70, 229, 0.26);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.documents-upload__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(79, 70, 229, 0.34);
}

.documents-tabs {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}
.documents-tab {
  border: none;
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.documents-tab.active {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 15px 30px rgba(29, 78, 216, 0.3);
}
.documents-tabpanel {
  display: none;
}
.documents-tabpanel.is-active {
  display: block;
}
.documents-tabpanel[hidden] {
  display: none !important;
}

.report-hours-panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e4e8f5;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
.report-hours-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.report-hours-header__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.report-hours-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.report-inline-create {
  margin-left: auto;
}
.report-hours-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-pill--summary {
  flex: 0 0 auto;
  min-width: auto;
  justify-content: space-between;
}
.report-pill--summary strong {
  font-size: 1rem;
}
.report-hours-summary .report-pill[data-summary="remaining"].is-negative {
  background: #fff5f5;
  border: 1px solid #fecaca;
}
.report-hours-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.report-hours-empty {
  border: 2px dashed #cbd5f5;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  color: #475569;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.report-hours-empty i {
  font-size: 40px;
  color: #94a3b8;
}
.report-hours-panel--simple {
  padding: 18px;
  box-shadow: none;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.report-hours-panel--simple .report-hours-summary {
  margin-bottom: 12px;
}
.report-hours-list--stack {
  grid-template-columns: 1fr;
}

.report-card {
  border: 1px solid #dde3f0;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s ease;
}
.report-card.is-expanded {
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}
.report-card--simple {
  box-shadow: none;
}
.report-card--simple.is-expanded {
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}
.report-card__main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.report-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.report-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-card__title-block {
  flex: 0 0 auto;
  min-width: 200px;
}
.report-card__title-block h3 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}
.report-card__title-block p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.85rem;
}
.report-card__status-block {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
}
.report-card__dates {
  font-size: 0.78rem;
  color: #94a3b8;
}
.report-card__invoice {
  font-size: 0.78rem;
  color: #475569;
  font-weight: 600;
}
.report-card__status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  background: #dbeafe;
  color: #1d4ed8;
  text-transform: capitalize;
}
.report-card__status-pill[data-status="in_progress"] {
  background: #e0e7ff;
  color: #3730a3;
}
.report-card__status-pill[data-status="ready_for_billing"] {
  background: #fef3c7;
  color: #b45309;
}
.report-card__status-pill[data-status="billed"] {
  background: #dcfce7;
  color: #166534;
}
.report-card__status-pill[data-status="ready_to_send"] {
  background: #f3e8ff;
  color: #7e22ce;
}
.report-card__status-pill[data-status="closed"],
.report-card__status-pill[data-status="archived"] {
  background: #fee2e2;
  color: #b91c1c;
}
.report-card__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}
.report-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e1b4b;
  font-size: 0.82rem;
  font-weight: 600;
}
.report-pill i {
  color: #4338ca;
}
.report-pill__label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #6366f1;
}
.report-pill__value {
  font-weight: 700;
  color: #0f172a;
}
.report-card.report-card--negative .report-pill[data-field="remaining"] {
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.report-card.report-card--negative .report-pill[data-field="remaining"] i,
.report-card.report-card--negative .report-pill[data-field="remaining"] .report-pill__label,
.report-card.report-card--negative .report-pill[data-field="remaining"] .report-pill__value {
  color: #b91c1c;
}
.report-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.8rem;
  color: #334155;
}
.report-chip__value {
  font-weight: 700;
  color: #111827;
}
.report-card__manage {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.report-card__details-toggle i {
  transition: transform 0.2s ease;
}
.report-card.is-expanded .report-card__details-toggle i {
  transform: rotate(180deg);
}
.report-card--simple .report-card__sections {
  display: none;
}
.report-card--simple.is-expanded .report-card__sections {
  display: grid;
}
.report-card__delete {
  border-color: rgba(185, 28, 28, 0.35);
  color: #b91c1c;
}
.report-card__delete:hover {
  border-color: rgba(185, 28, 28, 0.6);
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.18);
}
.report-card__sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.report-mini-block {
  border: 1px solid #e4e9f6;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fdfefe;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.report-mini-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.report-mini-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.9rem;
}
.report-mini-icon.docs {
  background: #e0f2fe;
  color: #0369a1;
}
.report-mini-icon.hours {
  background: #fef3c7;
  color: #b45309;
}
.report-mini-title {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}
.report-mini-title span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #4b5563;
}
.report-mini-title strong {
  font-size: 1.35rem;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.report-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #0f172a;
}
.report-mini-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #f4f6fb;
}
.report-mini-item span {
  flex: 1 1 auto;
}
.report-doc-more,
.report-task-more {
  color: #64748b;
  font-style: italic;
  font-size: 0.85rem;
}
.report-mini-block .report-doc-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0;
}
.report-mini-block .report-doc-form input[type="file"] {
  max-width: 180px;
}
.report-adjust-form {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px;
}
.report-adjust-form label {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-adjust-form input {
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  padding: 8px 10px;
}
.report-adjust-form__actions {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.report-card__task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-task-chip {
  background: #eef2ff;
  color: #4338ca;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.report-card__task-empty {
  color: #94a3b8;
  font-style: italic;
}
.report-doc-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-doc-form input[type="file"] {
  max-width: 220px;
}
.report-doc-form input[type="text"] {
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  padding: 6px 10px;
}
.report-doc-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-doc-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}
.report-doc-name {
  font-weight: 600;
  color: #0f172a;
}
.report-doc-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.report-doc-empty {
  color: #94a3b8;
  font-style: italic;
}
.report-entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-entry-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 12px;
}
.report-entry-item strong {
  color: #0f172a;
}
.report-entry-empty {
  color: #94a3b8;
  font-style: italic;
}

.report-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 70;
}
.report-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.report-modal[hidden],
.report-modal__backdrop[hidden] {
  display: none !important;
}
.report-modal__panel {
  background: #fff;
  border-radius: 18px;
  width: min(640px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 90px rgba(15, 23, 42, 0.35);
}
.report-modal__header,
.report-modal__footer {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.report-modal__footer {
  border-bottom: none;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
  gap: 12px;
}
.report-modal__body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.report-modal__body .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.report-modal__body label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-modal__body input[type="text"],
.report-modal__body input[type="number"],
.report-modal__body input[type="date"],
.report-modal__body select,
.report-modal__body textarea {
  border: 1px solid #d7deef;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fdfefe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.report-modal__body input:focus,
.report-modal__body select:focus,
.report-modal__body textarea:focus {
  outline: none;
  border-color: #6f7cf3;
  box-shadow: 0 0 0 3px rgba(111, 124, 243, 0.25);
}
.report-modal__body textarea {
  min-height: 110px;
  resize: vertical;
}
.report-modal__body .pill-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbe2f1;
  border-radius: 999px;
  padding: 8px 16px;
  background: #f8f9ff;
  font-weight: 600;
  color: #1e1b4b;
}
.report-modal__body .pill-checkbox input {
  width: 16px;
  height: 16px;
}
.report-modal__close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}
.report-modal__close:hover {
  color: #0f172a;
}
@media (max-width: 1200px) {
  .documents-body {
    grid-template-columns: 1fr;
  }

  .documents-upload {
    position: static;
  }
}

@media (max-width: 900px) {
  .documents-page {
    padding: 20px;
  }

  .documents-header {
    padding: 24px;
  }

  .documents-table {
    min-width: 100%;
  }

  .documents-table thead th,
  .documents-table td {
    padding: 10px 14px;
  }

  .documents-table__actions-heading {
    text-align: left;
  }

  .documents-table__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .documents-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .documents-search {
    max-width: 100%;
  }
}

/* Documents listed inside notes */
.note-documents {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.note-doc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.note-doc-label {
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.doc-actions a {
  margin-left: 8px;
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
}

.doc-actions a:hover {
  text-decoration: underline;
}

.profile-section {
  border: 1.5px solid #f1f4f6;
  border-radius: 12px;
  background: #fcfdfe;
  padding: 22px 20px 12px 20px;
  margin-bottom: 28px;
  box-shadow: 0 2px 7px rgb(125 214 218 / 7%);
  position: relative;
  transition: box-shadow 0.16s;
}

.profile-section.activity-overview-section,
.profile-section.planner-section {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.profile-section h3 {
  margin-top: 0;
}

.profile-section button[type="button"] {
  margin-top: 12px;
  margin-bottom: 6px;
  background: #fff;
  border: 1.5px solid #51D0D6;
  color: #1b1b35;
  border-radius: 5px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border 0.12s;
}
.profile-section button[type="button"]:hover,
.profile-section button[type="submit"]:hover {
  background: #e9f6fb;
  color: #51D0D6;
  border-color: #1b1b35;
}

.profile-section button[type="submit"] {
  background: #51D0D6;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 20px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(81,208,214,0.06);
}

.profile-section .activity-row {
  display: block;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-section input[type="text"],
.profile-section textarea,
.profile-section select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1.2px solid #c8e9ec;
  font-size: 15px;
  margin-top: 5px;
  margin-bottom: 12px;
  box-sizing: border-box;
  background: #fafdff;
  display: block;
}

.profile-section label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.profile-field-card {
  border: 1.2px solid #e5f4f6;
  background: #f8fcfd;
  border-radius: 7px;
  padding: 13px 15px 9px 15px;
  margin-bottom: 13px;
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(81,208,214,0.06);
  word-break: break-word;
}

/* Hide label visually but keep accessible */

.overview-flex-container {
  display: grid;
  grid-auto-rows: min-content;
  gap: 24px;
  align-items: start;
  margin-bottom: 36px;
}

.overview-columns {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}

/* Dashboard stats */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e9eff2;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card .stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f6fd;
  color: var(--secondary);
}
.stat-card .stat-label {
  font-size: 12px; color: #667; margin-bottom: 3px;
}
.stat-card .stat-value { font-size: 18px; font-weight: 700; color: var(--dark); }

.sr-only {
  position: absolute;
  left: -9999px;
}

.activity-log-list,
.planner-task-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  min-height: 0;
  margin: 0;   /* important: remove any extra space */
}

.activity-log-list { display:flex; flex-direction:column; gap: 10px; }

.lead-activity-list {
  max-height: 560px;
  padding-right: 8px;
  position: relative;
}

.lead-activity-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
  box-shadow: 0 0 0 2px #fff, 0 6px 16px -10px rgba(15, 23, 42, 0.5);
}

.lead-activity-list .activity-log-desc {
  margin-left: 58px;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.5;
  -webkit-line-clamp: 3;
}

.lead-activity-list .activity-log-card {
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 14px 16px;
  box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.6);
  border-left-width: 4px;
}

.lead-activity-list .activity-log-header {
  gap: 10px;
  font-size: 0.98rem;
}

.lead-activity-list .activity-summary-text {
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.lead-activity-list .activity-log-time {
  font-size: 0.82rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 999px;
}

.lead-activity-list .activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.activity-log-card { border:1px solid #e9eff2; border-radius: 10px; background:#fff; padding: 10px 12px; box-shadow: 0 1px 6px rgba(16,24,40,0.05); font-size: 0.96rem; word-break: break-word; border-left: 3px solid #c7eef1; }
/* Type accents */
.activity-log-card.type-goal_create,
.activity-log-card.type-goal_edit,
.activity-log-card.type-goal_comment { border-left-color: var(--primary); }
.activity-log-card.type-progress_note { border-left-color: var(--secondary); }
.activity-log-card.type-progress_note_delete { border-left-color: #dc3545; }
.activity-log-card.type-document_upload { border-left-color: #7c3aed; }
.activity-log-card.type-profile_update { border-left-color: #0ea5a9; }
.activity-log-card.type-client_assign { border-left-color: #3b82f6; }
.activity-log-card.type-day_program_create,
.activity-log-card.type-day_program_delete,
.activity-log-card.type-day_program_assign_clients,
.activity-log-card.type-day_program_assign_staff { border-left-color: #8b5cf6; }
.activity-log-card.type-service_request_status_changed { border-left-color: #1b1b35; }
.activity-log-card.type-communication_note { border-left-color: #10b981; }

.activity-log-card.internal-card {
  background: #fffde7;
}

.activity-log-header { display:flex; align-items:center; gap: 8px; font-size: 0.98em; }
.activity-summary-text { flex: 1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space: nowrap; }
.activity-log-header .activity-log-time { margin-left:auto; font-size: 0.85em; color:#718096; white-space: nowrap; }

.activity-summary-text { margin-left: 6px; font-size: 1em; color:#1b1b35; font-weight: 600; }

.internal-tag {
  background: #ffeb3b;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 8px;
}

.activity-log-header strong,
.activity-log-header em {
  font-weight: 600;
  font-style: italic;
}

.activity-icon { font-size: 1.1em; color:#0f172a; display:inline-flex; align-items:center; }

.activity-log-desc { margin: 4px 0 0 24px; color:#475467; font-size: 0.92em; line-height: 1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

.activity-log-time {
  font-size: 0.89em;
  color: #718096;
  margin-top: 2px;
}

/* Activity feed layout */
.activity-feed {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activity-feed-hero {
  background: linear-gradient(135deg, rgba(81,208,214,0.12), rgba(14,165,169,0.08));
  border: 1px solid rgba(81,208,214,0.25);
  border-radius: 18px;
  padding: 22px 26px;
  box-shadow: 0 12px 24px -18px rgba(15,23,42,0.4);
}

.activity-feed-hero h1 {
  font-size: 1.8rem;
  margin: 0 0 6px 0;
  color: #102a43;
}

.activity-feed-hero p {
  margin: 0;
  color: #475467;
  line-height: 1.5;
  max-width: 520px;
}

.activity-filter-form.feed-filter {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 8px 22px -18px rgba(15,23,42,0.55);
}

.feed-filter-search {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border 0.2s ease, background 0.2s ease;
}

.feed-filter-search:focus-within {
  border-color: rgba(81,208,214,0.6);
  background: #fff;
}

.feed-filter-search input[type="text"] {
  border: none;
  background: transparent;
  flex: 1 1 auto;
  font-size: 0.95rem;
  padding: 0;
  outline: none;
}

.activity-filter-form.feed-filter select,
.activity-filter-form.feed-filter input[type="date"] {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 9px 12px;
  font-size: 0.95rem;
  background: #fff;
  color: #1b1b35;
}

.feed-range-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feed-range-group select {
  min-width: 160px;
}

.feed-custom-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-custom-range input[type="date"] {
  min-width: 150px;
}

.feed-custom-range[hidden] {
  display: none !important;
}

.feed-mini-filter {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.feed-mini-filter select,
.feed-mini-filter input[type="date"] {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: #1b1b35;
}

.feed-mini-filter .feed-custom-range {
  gap: 6px;
}

.feed-mini-filter .feed-custom-range input[type="date"] {
  min-width: 140px;
}

.feed-mini-apply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  background: #1e88e5;
  color: #fff;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px -14px rgba(30,136,229,0.9);
}

.feed-mini-apply:hover {
  background: #1665ad;
}

.feed-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: 0 8px 16px -10px rgba(81,208,214,0.8);
  cursor: pointer;
}

.feed-filter-button:hover {
  background: var(--secondary);
}

.feed-filter-button.feed-filter-button--ghost {
  background: transparent;
  color: #1b1b35;
  border: 1px solid rgba(27, 27, 53, 0.25);
  box-shadow: none;
}

.feed-filter-button.feed-filter-button--ghost:hover {
  background: rgba(27, 27, 53, 0.06);
  color: #0c0c1d;
}

.activity-feed-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.activity-feed .activity-log-card {
  border-left: none;
  border-radius: 18px;
  padding: 18px 22px 16px;
  box-shadow: 0 18px 36px -28px rgba(15,23,42,0.7);
  position: relative;
  overflow: hidden;
}

.activity-feed .activity-log-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid rgba(226,232,240,0.7);
}

.feed-post-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.feed-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(59,130,246,0.2), rgba(59,130,246,0.05));
  color: #1b1b35;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  border: 1px solid rgba(59,130,246,0.25);
}

.feed-header-body {
  flex: 1 1 auto;
  min-width: 0;
}

.feed-author-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 1rem;
  color: #0f172a;
}

.feed-author {
  font-weight: 700;
}

.feed-action {
  color: #64748b;
  text-transform: capitalize;
}

.feed-target strong {
  font-weight: 700;
  color: #0f172a;
}

.feed-goal {
  color: #475467;
  font-style: italic;
}

.feed-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #64748b;
}

.feed-type-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: #f1f5f9;
  color: #0f172a;
  flex-shrink: 0;
}

.feed-post-body {
  margin-top: 14px;
  padding-left: 64px;
  color: #1f2937;
}

.feed-post-body p {
  margin: 0;
  line-height: 1.55;
}

.feed-post-footer {
  margin-top: 18px;
  padding-left: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: #475467;
}

.feed-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(81,208,214,0.16);
  color: var(--secondary);
  font-weight: 600;
}

.feed-context {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-weight: 500;
}

.feed-context i {
  color: #94a3b8;
}

.feed-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.feed-metric-card {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.65);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-metric-label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 600;
}

.feed-metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.feed-metric-sub {
  font-size: 0.9rem;
  color: #475467;
}

.feed-reports {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(241, 245, 249, 0.8);
  padding: 6px;
  border-radius: 999px;
  width: max-content;
}

.feed-tab {
  border: none;
  background: transparent;
  color: #475467;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.feed-tab.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 6px 14px -10px rgba(15, 23, 42, 0.4);
}

.feed-tab:focus-visible {
  outline: 2px solid rgba(81, 208, 214, 0.7);
  outline-offset: 2px;
}

.feed-tab-panels {
  display: grid;
  gap: 18px;
}

.feed-report-card {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 16px 32px -28px rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-report-card[hidden] {
  display: none !important;
}

.feed-report-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.feed-report-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 0.85rem;
}

.feed-report-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #0f172a;
}

.feed-report-header span {
  font-size: 0.85rem;
  color: #64748b;
}

.feed-info-wrapper {
  position: relative;
  display: inline-flex;
}

.feed-info-button {
  border: none;
  background: rgba(148, 163, 184, 0.18);
  color: #1d4ed8;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.feed-info-button:hover {
  background: rgba(148, 163, 184, 0.3);
  transform: translateY(-1px);
}

.feed-info-button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
}

.feed-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(260px, 70vw);
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.feed-info-wrapper.is-open .feed-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.feed-tooltip::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 12px;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent #0f172a transparent;
}

.feed-report-standalone {
  margin-top: 8px;
}

.feed-report-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.feed-report-name {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.feed-report-meta {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
}

.feed-report-share {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475467;
}

.feed-progress {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.7);
  overflow: hidden;
  margin-top: 8px;
}

.feed-progress span {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(81, 208, 214, 0.85), rgba(59, 130, 246, 0.85));
  border-radius: inherit;
}


.feed-report-trigger {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  color: inherit;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.feed-report-trigger:hover {
  background: rgba(226, 232, 240, 0.45);
}

.feed-report-trigger:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
}

.feed-report-trigger.is-selected {
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.feed-report-trigger.is-selected .feed-report-share {
  color: #1d4ed8;
}

.feed-report-trigger .feed-progress {
  margin-top: 10px;
}

.feed-report-trigger.is-disabled,
.feed-report-trigger.is-disabled:hover {
  cursor: not-allowed;
  opacity: 0.55;
  background: none;
  box-shadow: none;
  pointer-events: none;
}

.feed-staff-insights {
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.45);
}

.feed-staff-insights-placeholder {
  text-align: center;
  color: #64748b;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.feed-staff-insights-placeholder h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.staff-insights-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.staff-insights-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.staff-insights-back:hover {
  background: rgba(29, 78, 216, 0.18);
  color: #1b3fa7;
}

.staff-insights-back:focus-visible {
  outline: 2px solid rgba(29, 78, 216, 0.45);
  outline-offset: 2px;
}

.staff-insights-back i {
  font-size: 1rem;
}

.staff-insights-loading-wrapper,
.staff-insights-message {
  display: grid;
  gap: 14px;
  align-content: flex-start;
  justify-items: flex-start;
}

.staff-insights-message p {
  margin: 0;
}

.feed-staff-insights.is-loading {
  position: relative;
}

.feed-staff-insights.is-loading .staff-insights-loading {
  display: grid;
  gap: 14px;
}

.feed-staff-insights.is-loading .feed-staff-insights-placeholder {
  display: none;
}

.staff-insights-loading .skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(230, 235, 245, 0.9) 0%, rgba(245, 247, 251, 0.9) 50%, rgba(230, 235, 245, 0.9) 100%);
  background-size: 220% 100%;
  animation: feedSkeletonShimmer 1.3s ease-in-out infinite;
}

.staff-insights-loading .skeleton-line.skeleton-line-lg {
  height: 18px;
  width: 60%;
}

.staff-insights-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.staff-insights-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.staff-insights-title h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #0f172a;
}

.staff-insights-title p {
  margin: 4px 0 0 0;
  color: #64748b;
}

.staff-insights-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.staff-insights-kpi {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.08);
  color: #0f172a;
}

.staff-insights-kpi span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475467;
}

.staff-insights-kpi strong {
  font-size: 1.2rem;
}

.staff-insights-meta {
  font-size: 0.85rem;
  color: #475467;
}

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

.staff-insights-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: rgba(248, 250, 255, 0.7);
  display: grid;
  gap: 12px;
}

.staff-insights-card h4 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.staff-insights-card--wide {
  grid-column: span 2;
}

.staff-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.staff-insights-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.staff-insights-count {
  font-weight: 600;
  color: #1d4ed8;
}

.staff-insights-empty {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.staff-insights-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.9rem;
  text-align: center;
}

.staff-insights-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.staff-insights-timeline li {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
}

.staff-insights-timeline-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #475467;
}

.staff-insights-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  font-weight: 600;
}

.staff-insights-context {
  font-size: 0.85rem;
  color: #0f766e;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.staff-insights-context i {
  color: inherit;
}

@media (max-width: 680px) {
  .staff-insights-grid {
    grid-template-columns: 1fr;
  }

  .staff-insights-card--wide {
    grid-column: span 1;
  }

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

.feed-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 24px -18px rgba(20, 184, 166, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -16px rgba(20, 184, 166, 0.9);
}

.feed-empty-state {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.feed-trend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-trend-list li {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 10px;
  align-items: center;
}

.feed-trend-date {
  font-size: 0.85rem;
  color: #475467;
}

.feed-progress-compact {
  height: 5px;
  margin-top: 0;
}

.feed-trend-count {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
}

.activity-feed-empty {
  border: 2px dashed rgba(148,163,184,0.4);
  border-radius: 18px;
  padding: 40px 24px;
  text-align: center;
  color: #475467;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.activity-feed-empty i {
  font-size: 2.6rem;
  color: #94a3b8;
}

.activity-feed-empty h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #1f2937;
}

.feed-pagination {
  justify-content: space-between;
  gap: 16px;
}

.feed-pagination form {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
}

.feed-pagination button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  padding: 8px 18px;
  background: #fff;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
}

.feed-pagination button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.feed-pagination button:hover:not([disabled]) {
  background: rgba(226,232,240,0.4);
}

.activity-feed.is-loading {
  --feed-skeleton-base: #e6ebf5;
  --feed-skeleton-highlight: #f5f7fb;
}

.activity-feed.is-loading [data-skeleton-root] .feed-skeleton {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.activity-feed.is-loading [data-skeleton-root] .feed-skeleton > * {
  visibility: hidden;
}

.activity-feed.is-loading [data-skeleton-root] .feed-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--feed-skeleton-base) 0%, var(--feed-skeleton-highlight) 50%, var(--feed-skeleton-base) 100%);
  background-size: 220% 100%;
  animation: feedSkeletonShimmer 1.3s ease-in-out infinite;
}

.activity-feed.is-loading [data-skeleton-root] .feed-report-list li.feed-skeleton::after,
.activity-feed.is-loading [data-skeleton-root] .feed-trend-list li.feed-skeleton::after {
  border-radius: 12px;
}

@keyframes feedSkeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 680px) {
  .activity-feed {
    padding: 0 6px;
  }

  .feed-post-body,
  .feed-post-footer {
    padding-left: 0;
  }

  .feed-post-header {
    flex-wrap: wrap;
  }

  .feed-type-icon {
    margin-left: auto;
  }

  .feed-pagination {
    flex-direction: column;
  }

  .feed-pagination form {
    width: 100%;
  }

  .feed-pagination button {
    width: 100%;
    justify-content: center;
  }

  .feed-metrics-grid {
    grid-template-columns: 1fr;
  }

  .feed-tabs {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .feed-tab {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .feed-report-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .feed-range-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .feed-range-group select {
    width: 100%;
  }

  .feed-custom-range {
    width: 100%;
    justify-content: space-between;
  }

  .feed-mini-filter {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .feed-mini-filter select,
  .feed-mini-filter input[type="date"] {
    width: 100%;
  }

  .feed-mini-filter .feed-custom-range {
    justify-content: space-between;
  }

  .feed-mini-apply {
    width: 100%;
    justify-content: center;
  }
}

/* Pagination: clean, wraps on mobile */
.activity-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.activity-pagination-label {
  line-height: 2.2;
  min-width: 80px;
  text-align: center;
}

.activity-pagination button {
  background: #51D0D6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(81,208,214,0.08);
  transition: background 0.12s, color 0.12s, border 0.12s;
}

.activity-pagination button:disabled {
  background: #e4e8ee;
  color: #aaa;
  cursor: not-allowed;
}

/* Filter dropdown styling and stacking on mobile */
.activity-filter-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.activity-filter-form select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #c8e9ec;
  font-size: 16px;
  background: #fafdff;
}

/* microsoft planner */
.planner-task-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  margin: 0; /* No margin to interfere */
  gap: 16px;   /* 👈 Adjust to your preferred spacing */
}

.planner-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.planner-card-header {
  font-weight: 600;
  margin: -12px -12px 8px -12px;
  font-size: 12px;
  padding: 12px 12px 12px;
  border-bottom: 1px solid #e0e0e0;
  background: #ffdeca;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  align-items: center;
}

.planner-card-header .planner-due-circle {
  margin-left: auto;
}

.planner-card-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
  font-size: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}
.planner-card-label {
  width: 30%;
  flex-shrink: 0;
  font-weight: 600;
  color: #666;
}
.planner-card-data {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.planner-task-title {
  font-weight: bold;
  font-size: 12px;
  color: var(--dark);
}

.planner-task-status {
  font-size: 12px;
  color: #555;
}

.planner-task-due {
  font-size: 12px;
  font-weight: 600;
}

.planner-due-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
  position: relative;
}

.planner-due-circle.due-overdue { background: #e53935; }
.planner-due-circle.due-today  { background: #fb8c00; }
.planner-due-circle.due-soon   { background: #fdd835; }
.planner-due-circle.due-future { background: #43a047; }

.planner-due-circle[data-label]:hover::after,
.planner-due-circle.show-tooltip::after {
  content: attr(data-label);
  position: absolute;
  top: 100%;
  right: 0;
  transform: translateX(50%);
  background: #fff;
  color: #222;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  z-index: 10;
}

.week-scroll-container {
  position: relative;
  width: 100%;
  height: calc(100svh - 140px); /* 60px header*/
  flex-direction: column;
}

#schedule-loading-spinner {
  display: none; /* Hidden by default */
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(247,249,252,0.65); /* Light overlay */
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1.15rem;
}

.auth-card {
  max-width: 520px;
  margin: 100px auto;
  padding: 40px;
  background: linear-gradient(to bottom right, #fff, #f8f9ff);
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 6px 28px #0003;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  font-size: 1.1rem;
  padding: 14px 16px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.auth-form button {
  font-size: 1.1rem;
  padding: 14px 28px;
  align-self: center;
  max-width: none;
  border-radius: 6px;
  transition: background 0.2s, box-shadow 0.2s;
}

.auth-links {
  margin-top: 10px;
}

/* ===== Settings Page ===== */
.settings-container {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.settings-container table.compact {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.settings-container table.compact td {
  padding: 4px;
}

.rate-form {
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
}

.rate-form input[type="text"] {
  flex: 1;
}

.invite-table-wrapper {
  overflow-x: auto;
}

.invite-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  font-size: 14px;
  color: #000;
}

.invite-table th {
  background-color: #F27226;
  color: #ffffff;
  font-weight: 500;
  text-align: left;
  padding: 10px 14px;
}

.invite-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.invite-table tbody tr:hover {
  background-color: #fff3ec;
}

/* Toggle Switch */
/* ===== Dashboard (Clients) ===== */
.client-cards { display: none; }
.client-card {
  border: 1px solid #e9eff2;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.client-card + .client-card { margin-top: 10px; }
.client-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.client-card-header .client-name {
  font-weight: 600;
  color: var(--dark);
}
.client-card-team { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 700px) {
  /* Hide large table on small screens, show cards */
  #clientTable { display: none; }
  .table-scroll-client { display: none; }
  #clientCards {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #clientCards .client-card + .client-card { margin-top: 0; }
  /* Tighten dashboard controls on mobile */
  .dashboard-controls { gap: 10px; margin-bottom: 8px; }
  .search_box_dashboard { min-width: 0; }
}

@media (min-width: 701px) {
  /* Desktop: keep table; cards hidden by default */
  #clientCards { display: none; }
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Profile settings layout */
.profile-settings-container {
  max-width: 400px;
  margin: 0 auto 36px auto;
  text-align: center;
}

.profile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.profile-toggle-row:first-child {
  margin-top: 0;
}

.profile-toggle-row span {
  flex: 1;
  text-align: left;
}

.note-icon {
  color: #39ba6e;
  font-size: 16px;
  margin-left: 4px;
  display: inline-block;
}

.unassigned-icon {
    color: white;
    background-color: #51d0d6;
    font-size: 9px;
    font-weight: bold;
    margin-left: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.note-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
}

.worker-icon,
.doc-icon,
.time-icon {
  color: #39ba6e;
  font-size: 16px;
  margin-left: 4px;
  display: inline-block;
}

.worker-icon svg,
.doc-icon svg,
.time-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: middle;
}

.km-icon,
.expense-icon {
  color: #39ba6e;
  font-size: 16px;
  margin-left: 4px;
  display: inline-block;
}

.km-icon svg,
.expense-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: middle;
}

.open-service-btn {
  margin-top: 6px;
  font-size: 13px;
}

/* Modern pill-style checkbox list */
.checkbox-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.checkbox-pills input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-pills label {
  cursor: pointer;
}

.checkbox-pills label span {
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 16px;
  background: #f0f0f0;
  font-size: 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-block;
}

#sync-result {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  color: var(--secondary);
}

/* ===== Pricebook (Settings) ===== */
.pricebook-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.pb-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e9eff2;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  padding: 14px;
}

.pricebook-sidebar {
  align-self: start;
}

.pb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pb-header h3 { margin: 0; font-size: 18px; }

.btn {
  background: #F27226;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.danger { background: #d9534f; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pb-input {
  border: 1px solid #d9e2e8;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
}

.pb-toggle { display: inline-flex; align-items: center; gap: 6px; }

.pb-group-list { list-style: none; padding: 0; margin: 0; }
.pb-group-list li { border-bottom: 1px solid #eef3f6; padding: 10px 0; border-left: 3px solid transparent; }
.pb-group-list li.active { background: #fff7f2; border-left-color: #F27226; }
.pb-group-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pb-group-meta { min-width: 0; }
.pb-group-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-group-sub { font-size: 12px; color: #6a7784; }
.pb-group-actions details > summary { cursor: pointer; color: #2563eb; }
.pb-group-actions .pb-edit-panel { margin-top: 8px; display: grid; gap: 6px; }
.pb-group-actions .select-group { background: transparent; color: #2563eb; border: 1px solid #c7d2fe; }

.pb-inline-form { display: flex; gap: 8px; }
.pb-inline-form input[type="text"],
.pb-inline-form input[type="search"],
.pb-inline-form select { flex: 1; }

.pricebook-main { min-width: 0; }

.pb-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pb-grid-form { border-top: 1px dashed #e6edf2; padding-top: 10px; margin-top: 6px; }
.pb-grid-form .row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pb-grid-form .row.end { align-items: end; }
.pb-grid-form label { font-size: 12px; color: #57636f; display: grid; gap: 4px; }
.pb-grid-form label input,
.pb-grid-form label select { padding: 8px 10px; border: 1px solid #d9e2e8; border-radius: 8px; }
.pb-grid-form .actions { display: flex; justify-content: flex-end; align-items: center; }
.pb-grid-form .align-end { display: flex; align-items: end; gap: 6px; }

.pb-table-wrap { overflow-x: auto; overflow-y: visible; overscroll-behavior-y: contain; margin-top: 10px; }
.pb-hint { padding: 10px; border: 1px dashed #e6edf2; border-radius: 8px; margin-bottom: 8px; color: #6b7280; background: #f9fbfd; }
.pb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pb-table thead th { position: sticky; top: 0; background: #f8fafc; text-align: left; padding: 8px; border-bottom: 1px solid #e9eff2; }
.pb-table td { padding: 8px; border-bottom: 1px solid #f0f4f8; vertical-align: top; position: relative; }
.pb-table-cell { position: relative; }
.pb-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; }
.pb-table .desc { color: #334155; }
.pb-table td.actions { white-space: nowrap; text-align: right; }
.pb-table details summary.link { color: #2563eb; cursor: pointer; }
.pb-edit-panel { background: #f9fbfd; border: 1px solid #e6edf2; border-radius: 8px; padding: 10px; margin-top: 6px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: 12px; }
.badge.success { background: #d1fae5; color: #065f46; }

@media (max-width: 1000px) {
  .pricebook-layout { grid-template-columns: 1fr; }
  .pb-grid-form .row { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Pricebook (Card view) ===== */
.pb-screen { display: grid; gap: 12px; }
.pb-topbar { padding: 10px; }
.pb-add-pricebook { display: flex; gap: 8px; }
.pb-add-pricebook input[type="text"] { flex: 1; padding: 8px 10px; border: 1px solid #d9e2e8; border-radius: 8px; }
.pb-import { display: grid; gap: 6px; margin-top: 10px; }
.pb-import-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pb-import-form input[type="file"] { padding: 6px 0; }
.pb-help { margin: 0; font-size: 12px; color: #6b7280; }

.pricebook-list { display: grid; gap: 12px; }
.pb-group-card { border: 1px solid #e9eff2; border-radius: 8px; overflow: visible; background: #fff; position: relative; }
.pb-group-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.pb-title-area { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pb-title { margin: 0; font-size: 16px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-title-form { display: none; align-items: center; gap: 8px; }
.pb-title-input { min-width: 260px; }
.pb-actions { display: flex; gap: 12px; align-items: center; font-size: 12px; }
.pb-actions .link { color: #2563eb; cursor: pointer; text-transform: uppercase; letter-spacing: .02em; }
.pb-actions .danger { color: #c0392b; }
.pb-edit { display: inline-block; }
.pb-group-card:not(.open) .pb-new-row { display: none; }
.pb-rename-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.pb-rename-form label { display: grid; gap: 4px; font-size: 12px; color: #57636f; }
.pb-rename-form input { padding: 8px 10px; border: 1px solid #d9e2e8; border-radius: 8px; min-width: 260px; }
.pb-add-item-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.pb-add-item-row input, .pb-add-item-row select { padding: 8px 10px; border: 1px solid #d9e2e8; border-radius: 8px; }
.pb-add-item-row .btn { grid-column: span 1; }

/* Inline editing: swap view/edit blocks when group is open */
.pb-table .view { display: block; }
.pb-table .edit { display: none; }
.pb-group-card.open .pb-table .view { display: none; }
.pb-group-card.open .pb-table .edit { display: block; }
.pb-help-text { font-size: 11px; color: #6b7280; margin-top: 4px; }
.pb-funding-view .muted { color: #98a2b3; }
.pb-funding-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pb-funding-list li { background: #eef2ff; color: #3730a3; border-radius: 9999px; padding: 2px 10px; font-size: 12px; }
.pb-funding-list li .section { color: #475467; font-weight: 500; margin-left: 4px; }
.pb-funding-picker { position: relative; width: 100%; z-index: 10; }
.pb-funding-trigger { width: 100%; border: 1px solid #d0d5dd; border-radius: 10px; padding: 6px 10px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: #101828; cursor: pointer; }
.pb-funding-trigger:hover { border-color: #7f56d9; }
.pb-funding-trigger:focus { outline: 2px solid #7f56d9; outline-offset: 2px; }
.pb-funding-summary { flex: 1; min-width: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.pb-funding-caret { font-size: 12px; color: #667085; }
.pb-funding-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  max-height: min(72vh, 640px);
  min-height: 280px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  min-width: 360px;
}
.pb-funding-picker.open .pb-funding-menu { display: block; }
.pb-funding-section + .pb-funding-section { margin-top: 10px; border-top: 1px solid #f2f4f7; padding-top: 10px; }
.pb-funding-section-label { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: #475467; text-transform: uppercase; letter-spacing: .05em; }
.pb-funding-options { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pb-funding-option { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.pb-funding-option:hover { background: #f8fafc; }
.pb-funding-option input { margin-top: 3px; flex-shrink: 0; }
.pb-funding-option .title { font-size: 13px; font-weight: 600; color: #101828; }
.pb-funding-option .subtitle { display: block; font-size: 11px; color: #667085; }

.pb-table.compact thead th { background: #f2f4f7; color: #6b7280; font-weight: 600; }
.pb-table.compact td, .pb-table.compact th { padding: 10px 12px; }
.pb-add-row { background: #fffdfa; }
.pb-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #475467; }
.pb-check input { margin: 0; }
.pb-time-range { display: inline-flex; align-items: center; gap: 6px; }
.pb-time-range .dash { color: #6b7280; }
.pb-row-form input, .pb-row-form select { padding: 6px 8px; border: 1px solid #d9e2e8; border-radius: 6px; }

/* Polished inputs within table */
.pb-table .pb-input,
.pb-table .pb-select {
  width: 100%;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid #d9e2e8;
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
}

.pb-table .pb-input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; }

.pb-table .pb-input:focus, .pb-table .pb-select:focus {
  outline: none;
  border-color: #a3c2f5;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.pb-table input[disabled] {
  color: #6b7280;
  background: #f7fafc;
}

/* Currency prefix */
.pb-affix { position: relative; }
.pb-affix .prefix { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #6b7280; }
.pb-affix .has-prefix { padding-left: 20px; }

/* Time inputs only on the hour */
.pb-table .pb-input.time { text-align: center; }

/* When EDIT is open (CSS-only enhancement) */
@supports selector(.pb-group-card:has(.pb-edit[open])) {
  .pb-group-card:has(.pb-edit[open]) .pb-title { display: none; }
  .pb-group-card:has(.pb-edit[open]) .pb-title-form { display: flex; }
}

/* JS toggle fallback */
.pb-group-card.open .pb-title { display: none; }
.pb-group-card.open .pb-title-form { display: flex; }

/* Batch actions */
.pb-batch-actions {
  display: none;
  padding: 10px 12px;
  justify-content: flex-end;
  gap: 8px;
}
.pb-group-card.has-drafts .pb-batch-actions { display: flex; }

@supports selector(.pb-group-card:has(.pb-edit[open])) {
  .pb-group-card:has(.pb-edit[open]) .pb-batch-actions { display: flex; }
}
.pb-group-card.open .pb-batch-actions { display: flex; }

/* Show inline edit inputs when group edit open */
@supports selector(.pb-group-card:has(.pb-edit[open])) {
  .pb-group-card:has(.pb-edit[open]) .pb-table .view { display: none; }
  .pb-group-card:has(.pb-edit[open]) .pb-table .edit { display: block; }
  .pb-group-card:has(.pb-edit[open]) .pb-new-row { display: inline-block; }
}

/* pay colors for timesheets */
.pay-amount {
  color: green;
}

.expense-amount {
  color: red;
}

.total-pay {
  color: green;
  font-weight: 500;
}

.checkbox-pills input[type="checkbox"]:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

@media (max-width: 700px) {
  .week-grid {
    flex-direction: column;
    overflow-x: hidden;
    /* Allow natural vertical growth without clipping */
    overflow-y: visible;
  }
  .day-column,
  .day-column.current-day {
    width: 100%;
    min-width: auto;
    /* Avoid squashed columns on mobile */
    height: auto;
    min-height: 150px;
    flex: 0 0 auto;
  }
}

/* Communications Page */
.comm-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 8px;
}

.comm-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #e8eef5;
  background: linear-gradient(180deg, #f8fbff 0%, #fdfefe 100%);
  box-shadow: 0 24px 60px -35px rgba(15, 23, 42, 0.35);
}

.comm-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 520px;
}

.comm-hero-main h1 {
  margin: 0;
  font-size: 24px;
}

.comm-hero-main p {
  margin: 6px 0 0;
  color: #556176;
  line-height: 1.45;
}

.comm-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #ecfdf5;
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.comm-hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.comm-stat {
  min-width: 160px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e8eef5;
  box-shadow: inset 0 1px 0 #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comm-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #64748b;
}

.comm-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.comm-stat-sub {
  font-size: 12px;
  color: #64748b;
}

.comm-grid {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  gap: 24px;
  align-items: flex-start;
}

.comm-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.comm-column--narrow {
  position: sticky;
  top: 108px;
}

.comm-card {
  background: #ffffff;
  border: 1px solid #e4ebf5;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 18px 48px -32px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.comm-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.comm-card-header p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.comm-reset {
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  text-decoration: none;
  align-self: center;
}

.comm-reset:hover {
  text-decoration: underline;
}

.comm-composer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comm-editor textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid #d6dee8;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.55;
  resize: vertical;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comm-editor textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  outline: none;
}

textarea.internal-note {
  background: #fff7d6;
  border-color: #f3d777;
}

.comm-composer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.comm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1;
}

.comm-field--split {
  max-width: 180px;
}

.comm-label {
  font-size: 12px;
  font-weight: 600;
  color: #556176;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comm-input-icon,
.comm-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d6dee8;
  border-radius: 10px;
  background: #ffffff;
  padding: 0 14px;
  height: 44px;
}

.comm-input-icon i,
.comm-select-wrap i {
  color: #0f766e;
  font-size: 1.05rem;
}

.comm-input-icon input {
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  font-size: 14px;
  color: #1f2937;
}

.comm-select-wrap select {
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  font-size: 14px;
  color: #1f2937;
  appearance: none;
  padding: 0;
}

.comm-field input[type="date"] {
  border: 1px solid #d6dee8;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
  font-size: 14px;
  color: #1f2937;
}

.comm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.comm-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.comm-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid #d6dee8;
  padding: 0 16px;
  height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: #475467;
  background: #ffffff;
  transition: all 0.2s ease;
}

.comm-toggle-pill.is-active {
  background: #fff6d6;
  border-color: #f3d777;
  color: #92400e;
}

.comm-submit {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 18px 45px -24px rgba(14, 165, 233, 0.45);
  text-transform: none;
}

.comm-filter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.comm-filter-apply {
  justify-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
}

.comm-card--filters .comm-filter {
  margin-top: 8px;
}

.comm-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.comm-entry {
  display: flex;
  gap: 16px;
  padding: 18px 20px 18px 24px;
  border-radius: 18px;
  border: 1px solid #e4ebf5;
  background: #ffffff;
  box-shadow: 0 18px 45px -30px rgba(15, 23, 42, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comm-entry:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px -32px rgba(15, 23, 42, 0.45);
}

.comm-entry.is-internal {
  border-color: #f3d777;
  background: #fff9e7;
}

.comm-entry.is-call {
  border-color: #bae6fd;
  background: #f4fbff;
}

.comm-entry-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.comm-entry-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #e5edff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.comm-entry.is-internal .comm-entry-icon {
  background: #fef6d6;
  color: #92400e;
}

.comm-entry.is-call .comm-entry-icon {
  background: #dbeafe;
  color: #0369a1;
}

.comm-entry-line {
  flex: 1;
  width: 2px;
  background: linear-gradient(180deg, #e2e8f0 0%, rgba(226, 232, 240, 0) 100%);
  margin-top: 6px;
}

.comm-entry:last-child .comm-entry-line {
  display: none;
}

.comm-entry-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comm-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.comm-entry-medium {
  font-weight: 600;
  color: #0f172a;
  font-size: 15px;
}

.comm-entry-direction {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0369a1;
}

.comm-entry-header time {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.comm-entry-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}

.comm-entry-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comm-entry-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  font-size: 13px;
  color: #475467;
}

.comm-entry-details > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.comm-entry-details dt {
  margin: 0;
  font-weight: 600;
  color: #1f2937;
}

.comm-entry-details dd {
  margin: 4px 0 0;
}

.comm-entry-audio audio {
  width: 100%;
}

.comm-entry-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #eef1f5;
}

.comm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
}

.chip-internal {
  background: #fef6d6;
  color: #92400e;
}

.chip-external {
  background: #ecfdf3;
  color: #047857;
}

.comm-empty {
  border: 1px dashed #d6dee8;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  background: #f8fbff;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.comm-empty i {
  font-size: 32px;
  color: #a5b4fc;
}

.comm-pagination {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comm-pagination form {
  display: inline-flex;
}

.comm-pagination button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
}

.comm-pagination button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.comm-pagination-label {
  font-size: 13px;
  color: #556176;
  font-weight: 600;
}

.comm-header-meta {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

@media (max-width: 1080px) {
  .comm-grid {
    grid-template-columns: 1fr;
  }
  .comm-column--narrow {
    position: static;
  }
}

@media (max-width: 720px) {
  .comm-hero-card {
    padding: 20px;
  }
  .comm-hero-main {
    align-items: flex-start;
  }
  .comm-hero-main h1 {
    font-size: 22px;
  }
  .comm-grid {
    gap: 20px;
  }
  .comm-card {
    padding: 18px;
  }
  .comm-composer-controls {
    align-items: stretch;
  }
  .comm-field--split {
    max-width: none;
  }
  .comm-entry {
    flex-direction: column;
    padding: 18px;
  }
  .comm-entry-marker {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .comm-entry-line {
    display: none;
  }
  .comm-entry-header time {
    white-space: normal;
  }
  .comm-pagination {
    flex-direction: column;
    align-items: stretch;
  }
  .comm-pagination form {
    width: 100%;
  }
  .comm-pagination button {
    justify-content: center;
    width: 100%;
  }
}

/* Timesheets chart styling */
.chart-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.chart-inner {
  position: relative;
  width: 100%;
  height: 400px;
}

.chart-inner canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 600px) {
  .chart-inner {
    width: 900px;
    height: 300px;
  }
}

/* ===== Mobile Support Team Cards ===== */
.teams-card-container {
  display: none;
}

.team-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.team-card-header {
  font-weight: 600;
  margin: -12px -12px 8px -12px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 12px 12px 12px;
  border-bottom: 1px solid #e0e0e0;
  background: #dffeff;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.team-card-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
  font-size: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}
.team-card-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.team-card-label {
  width: 20%;
  flex-shrink: 0;
  font-weight: 600;
  color: #666;
  position: relative;
}
.role-name-popup {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #222;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  z-index: 10;
}
.team-card-data {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.clients-data .extra-client {
  display: none;
}
.clients-expanded .extra-client {
  display: inline-block;
}
.view-more-row {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #666;
  font-size: 13px;
  position: relative;
}
.view-more-row::after {
  content: '\203A';
  color: var(--secondary);
  margin-left: 6px;
  transition: transform 0.2s;
}
.view-more-row.open::after {
  transform: rotate(90deg);
}
.view-more-text {
  padding: 6px 0;
}
.view-more-btn {
  margin-top: 6px;
  font-size: 13px;
  background: none;
  color: var(--primary);
  border: none;
  padding: 0;
  cursor: pointer;
}
.team-pill {
  background: var(--secondary);
  color: #fff;
  border-radius: 999px;
  padding: 2px 5px;
  font-size: 12px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


@media (max-width: 700px) {
  #teamsColumnTable {
    display: none;
  }
  .teams-card-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .overview-columns { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}
.back-button{display:inline-block;margin-bottom:10px;color:var(--primary);text-decoration:none;}.back-button:hover{text-decoration:underline;}
/* --- Service Requests modern styling --- */
.sr-header h2 { margin: 0 0 6px 0; }
.sr-header .muted { color: #667085; margin-bottom: 12px; }
.sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.sr-card { display: block; border: 1px solid #e6e7ee; border-radius: 10px; padding: 14px; text-decoration: none; color: inherit; background: #fff; box-shadow: 0 2px 6px rgba(16,24,40,0.04); transition: box-shadow .15s, transform .05s; }
.sr-card:hover { box-shadow: 0 6px 14px rgba(16,24,40,0.10); transform: translateY(-1px); }
.sr-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom: 6px; }
.sr-id { font-weight:600; color:#475467; }
.sr-title { font-weight: 600; margin: 4px 0 8px; color: #101828; }
.sr-meta { font-size: 13px; color:#475467; margin: 2px 0; display:flex; gap:6px; align-items:center; }
.sr-footer { font-size: 12px; margin-top: 8px; }
.status-pill { display:inline-flex; align-items:center; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border:1px solid transparent; background: transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; flex: 0 1 auto; }
.pill-primary { border-color: var(--primary); color: var(--primary); }
.pill-secondary { border-color: var(--secondary); color: var(--secondary); }
.pill-dark { border-color: var(--dark); color: var(--dark); }
.pill-status-new { --sr-status-color:#4338ca; background:#eef2ff; border-color:rgba(79,70,229,0.3); color:#4338ca; }
.pill-status-in-progress { --sr-status-color:#047857; background:#ecfdf5; border-color:rgba(5,150,105,0.35); color:#047857; }
.pill-status-unable { --sr-status-color:#c2410c; background:#fff7ed; border-color:rgba(234,88,12,0.35); color:#c2410c; }
.pill-status-booked { --sr-status-color:#15803d; background:#f0fdf4; border-color:rgba(22,163,74,0.3); color:#15803d; }
.pill-status-cancel-no-charge { --sr-status-color:#4b5563; background:#f5f5f5; border-color:rgba(107,114,128,0.3); color:#4b5563; }
.pill-status-cancel-with-charge { --sr-status-color:#b91c1c; background:#fef2f2; border-color:rgba(248,113,113,0.35); color:#b91c1c; }
.pill-status-completed { --sr-status-color:#047857; background:#ecfdf3; border-color:rgba(34,197,94,0.35); color:#047857; }

/* Generic pill tags used across columns */
.sr-pill { display:inline-flex; align-items:center; gap:4px; padding:3px 8px; border:1px solid #e5e7eb; border-radius:999px; background:#f8fafc; color:#344054; font-size:12px; line-height:1; flex: 0 0 auto; white-space: nowrap; }
.sr-pill-list { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.sr-pill-list-nowrap { flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.sr-pill-sep { color:#98a2b3; margin:0 2px; }
.sr-pill-muted { opacity:0.7; }
.sr-pill-id { font-weight:600; background:#eef2ff; border-color:#e0e7ff; color:#3730a3; }

/* Counter circle for overflowed pills */
.sr-pill-counter { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:999px; border:1px solid #e5e7eb; background:#eef2f7; color:#475467; font-size:12px; font-weight:700; flex: 0 0 auto; }
.sr-pill-counter:hover { filter: brightness(0.98); }

#srTable th.sr-col-services,
#srTable td.sr-col-services {
  width: 200px;
  max-width: 210px;
}

#srTable td.sr-col-services {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-services-text {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: #1f2937;
}

.sr-last-comment {
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-last-comment-author {
  font-weight: 600;
  color: #1d4ed8;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-last-comment-type {
  margin-left: 4px;
  color: #64748b;
  font-weight: 500;
  font-size: 12px;
}

.sr-last-comment-text {
  font-size: 13px;
  color: #475467;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-last-comment-mobile {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-last-comment-mobile .sr-last-comment-text {
  flex: 1 1 auto;
  min-width: 0;
}

.sr-last-comment-mobile .sr-last-comment-type {
  margin-left: 0;
}

.sr-last-comment-mobile .sr-last-comment-author {
  color: #1d4ed8;
  font-weight: 600;
}

#srTable tbody tr[class*='sr-flag-'] td:nth-child(2) {
  position: relative;
  padding-left: 14px;
}

#srTable tbody tr[class*='sr-flag-'] td:nth-child(2)::before {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 6px;
  border-radius: 3px;
}

#srTable tbody tr.sr-flag-day-program td:nth-child(2)::before { background: #0ea5e9; }
#srTable tbody tr.sr-flag-cancel-no-charge td:nth-child(2)::before { background: #f59e0b; }
#srTable tbody tr.sr-flag-cancel-with-charge td:nth-child(2)::before { background: #ef4444; }

.sr-card.sr-flag-day-program {
  border-left: 5px solid #0ea5e9;
  box-shadow: 0 0 0 1px rgba(14,165,233,0.15), 0 6px 14px rgba(14,165,233,0.15);
}

.sr-card.sr-flag-cancel-no-charge {
  border-left: 5px solid #f59e0b;
  box-shadow: 0 0 0 1px rgba(245,158,11,0.15), 0 6px 14px rgba(245,158,11,0.12);
}

.sr-card.sr-flag-cancel-with-charge {
  border-left: 5px solid #ef4444;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.15), 0 6px 14px rgba(239,68,68,0.12);
}

.sr-timing-legend { display:none; }
/* Timing highlights for Service Requests */
.sr-card.sr-urgent,
.sr-info-card.sr-urgent { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.12); }
.sr-card.sr-soon,
.sr-info-card.sr-soon { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.14); }
.sr-card.sr-past,
.sr-info-card.sr-past { color:#475467; background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.35); }

.sr-activity-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#f59e0b; margin-left:6px; box-shadow: 0 0 0 2px #fff; vertical-align: middle; flex: 0 0 auto; }

/* --- Service requests ticketing layout refresh --- */
.sr-page { display:flex; flex-direction:column; gap:24px; }
.sr-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:22px 26px; border:1px solid #d9e2f0; border-radius:18px; background: linear-gradient(135deg, #f8fbff 0%, #ffffff 65%, #f2f7ff 100%); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); }
.sr-page-heading { display:flex; flex-direction:column; gap:6px; max-width: min(520px, 100%); }
.sr-page-title { margin:0; font-size:26px; font-weight:700; color:#0f172a; letter-spacing:-0.01em; }
.sr-page-description { margin:0; font-size:15px; color:#475467; line-height:1.45; }
.sr-page-action { display:inline-flex; align-items:center; gap:8px; font-weight:600; padding:10px 18px; border-radius:12px; }
.sr-page-action i { font-size:18px; }
.sr-layout-toggle { display:inline-flex; align-items:center; gap:12px; margin-top:-4px; margin-bottom:-8px; }
.sr-layout-toggle-btn { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:999px; border:1px solid #d9e2f0; background:#f8fafc; color:#0f172a; font-size:13px; font-weight:600; text-decoration:none; transition:all .2s ease; }
.sr-layout-toggle-btn:hover { border-color: var(--primary); color: var(--primary); background:#ecfdf5; box-shadow:0 6px 18px rgba(15,118,110,0.12); }
.sr-layout-toggle-btn.active { background: var(--primary); color:#fff; border-color: var(--primary); box-shadow:0 8px 22px rgba(13,148,136,0.22); }
.sr-layout-toggle-btn i { font-size:16px; }

.sr-highlights { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:16px; }
.sr-highlight-card { display:flex; flex-direction:column; gap:6px; padding:18px 20px; border:1px solid #d9e2f0; border-radius:16px; background:#fff; box-shadow:0 6px 16px rgba(15,23,42,0.06); transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.sr-highlight-card:hover { border-color: var(--primary); box-shadow:0 12px 28px rgba(15,23,42,0.12); transform: translateY(-2px); }
.sr-highlight-card.active { border-color: var(--primary); box-shadow:0 14px 30px rgba(8,145,178,0.16); transform: translateY(-3px); }
.sr-highlight-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:#1d4ed8; }
.sr-highlight-value { font-size:34px; font-weight:700; color:#0f172a; line-height:1.1; }
.sr-highlight-caption { font-size:12px; color:#64748b; }

.sr-controls { display:flex; flex-direction:column; gap:18px; padding:20px 22px; border:1px solid #d9e2f0; border-radius:18px; background:#fff; box-shadow:0 4px 16px rgba(15,23,42,0.07); }
.sr-filters-modern { display:flex; flex-wrap:wrap; gap:18px; align-items:flex-end; }
.sr-filter { display:flex; flex-direction:column; gap:8px; min-width:200px; }
.sr-filter.search { flex:1 1 280px; }
.sr-filter.sort { flex:0 0 200px; }
.sr-filter.actions { flex-direction:row; align-items:center; gap:10px; }
.sr-filter.actions .btn { flex:0 0 auto; }

.sr-input-wrap,
.sr-select-wrap { position:relative; display:flex; align-items:center; }
.sr-input-wrap i,
.sr-select-wrap i { position:absolute; left:12px; color:#98a2b3; pointer-events:none; font-size:16px; }
.sr-input-wrap .sr-input { width:100%; padding-left:38px; box-shadow:none; }
.sr-select-wrap .sr-select { width:100%; padding-left:38px; box-shadow:none; }
.sr-select-wrap .sr-select:focus,
.sr-input-wrap .sr-input:focus { border-color: var(--primary); box-shadow:0 0 0 3px rgba(16,185,129,0.12); outline:none; }

.sr-status-chips { display:flex; flex-wrap:wrap; gap:10px; }
.sr-status-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border-radius:999px; border:1px solid #e2e8f0; background:#f8fafc; color:#475467; font-size:13px; font-weight:600; transition:all .15s ease; text-decoration:none; }
.sr-status-chip:hover { background:#eef2ff; border-color:#cbd5f5; color:#1d4ed8; }
.sr-status-chip.active { background:var(--primary); border-color:var(--primary); color:#fff; box-shadow:0 6px 18px rgba(13,148,136,0.25); }
.sr-status-chip-count { display:inline-flex; align-items:center; justify-content:center; min-width:16px; padding:2px 6px; border-radius:999px; background:rgba(15,118,110,0.12); color:inherit; font-size:12px; font-weight:600; }
.sr-status-chip.active .sr-status-chip-count { background:rgba(255,255,255,0.2); }
.sr-calendar { display:flex; flex-direction:column; gap:16px; padding:20px 22px; border:1px solid #d9e2f0; border-radius:18px; background:#fff; box-shadow:0 6px 20px rgba(15,23,42,0.08); }
.sr-calendar-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.sr-calendar-nav { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:10px; border:1px solid #d9e2f0; background:#f8fafc; color:#0f172a; font-size:13px; font-weight:600; text-decoration:none; transition:all .2s ease; }
.sr-calendar-nav:hover { border-color:var(--primary); color:var(--primary); background:#ecfdf5; box-shadow:0 6px 18px rgba(15,118,110,0.12); }
.sr-calendar-title { font-size:18px; font-weight:700; color:#0f172a; letter-spacing:-0.01em; }
.sr-calendar-grid { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); border:1px solid #e2e8f0; border-radius:14px; overflow:hidden; }
.sr-calendar-dayname { padding:10px 12px; background:#f1f5f9; color:#475467; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; text-align:center; }
.sr-calendar-dayname:nth-child(n+8) { border-top:1px solid #e2e8f0; }
.sr-calendar-cell { min-height:140px; padding:12px 10px; border-left:1px solid #e2e8f0; border-top:1px solid #e2e8f0; background:#fff; display:flex; flex-direction:column; gap:10px; position:relative; }
.sr-calendar-cell:nth-child(7n+1) { border-left:none; }
.sr-calendar-dayname:nth-child(7n+1) { border-left:none; }
.sr-calendar-cell.is-outside { background:#f8fafc; color:#94a3b8; }
.sr-calendar-cell.is-today { box-shadow:inset 0 0 0 2px rgba(16,185,129,0.45); }
.sr-calendar-cell.is-today .sr-calendar-date { color:var(--primary); }
.sr-calendar-date { font-size:14px; font-weight:700; color:inherit; }
.sr-calendar-events { display:flex; flex-direction:column; gap:6px; flex:1 1 auto; overflow-y:auto; padding-right:4px; }
.sr-calendar-events::-webkit-scrollbar { width:6px; }
.sr-calendar-events::-webkit-scrollbar-thumb { background:#cbd5f5; border-radius:999px; }
.sr-calendar-event { display:flex; align-items:flex-start; gap:8px; padding:6px 8px; border-radius:10px; background:#f8fafc; border:1px solid #e2e8f0; color:#0f172a; text-decoration:none; transition:all .2s ease; }
.sr-calendar-event:hover { border-color:var(--primary); background:#ecfdf5; color:#047857; box-shadow:0 6px 18px rgba(15,118,110,0.15); }
.sr-calendar-event-dot { width:10px; height:10px; border-radius:999px; margin-top:4px; flex-shrink:0; background:var(--sr-status-color, #1f2937); border:1px solid var(--sr-status-color, #1f2937); box-shadow:0 0 0 2px rgba(255,255,255,0.8); }
.sr-calendar-event-body { display:flex; flex-direction:column; gap:2px; min-width:0; }
.sr-calendar-event-title { font-size:13px; font-weight:600; color:inherit; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sr-calendar-event-meta { font-size:12px; color:#64748b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sr-calendar-empty { display:inline-flex; align-items:center; font-size:12px; color:#cbd5f5; font-style:italic; }
.sr-calendar-cell.is-outside .sr-calendar-event { background:#f1f5f9; color:#64748b; }
.sr-calendar-cell.is-outside .sr-calendar-event-dot { box-shadow:0 0 0 2px rgba(241,245,249,0.9); }
.sr-calendar-cell.is-outside .sr-calendar-event-meta { color:#94a3b8; }

.sr-ticket-list { border:1px solid #d9e2f0; border-radius:18px; background:#fff; box-shadow:0 6px 20px rgba(15,23,42,0.08); }
.sr-table-wrapper { overflow:auto; border-radius:inherit; }
.sr-table { width:100%; border-collapse:separate; border-spacing:0; min-width:880px; }
.sr-table thead th { background:#f8fbff; color:#475467; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; padding:6px 8px; border-bottom:1px solid #d9e2f0; text-align:left; }
.sr-table thead th.is-sortable { padding-right:28px; position:relative; }
.sr-sortable { display:inline-flex; align-items:center; gap:6px; color:inherit; font-weight:inherit; text-decoration:none; }
.sr-sortable:focus-visible { outline:2px solid var(--primary); outline-offset:2px; border-radius:6px; }
.sr-sort-icon { font-size:16px; color:#94a3b8; transition:color .15s ease, transform .15s ease; }
.sr-table thead th.is-sortable[aria-sort="ascending"] .sr-sort-icon { color:var(--primary); transform:rotate(180deg); }
.sr-table thead th.is-sortable[aria-sort="descending"] .sr-sort-icon { color:var(--primary); }
.sr-table thead th.is-sortable:hover .sr-sort-icon { color:var(--primary); }
.sr-table thead th.is-sortable.is-active span { color:var(--primary); }
.sr-table thead th.is-sortable.is-active .sr-sort-icon { color:var(--primary); }
.sr-table thead th:first-child { border-top-left-radius:18px; }
.sr-table thead th:last-child { border-top-right-radius:18px; }
.sr-table tbody tr:last-child td:first-child { border-bottom-left-radius:18px; }
.sr-table tbody tr:last-child td:last-child { border-bottom-right-radius:18px; }
.sr-bulk-form { display:flex; flex-direction:column; }
.sr-bulk-form--has-actions .sr-table-wrapper { border-top-left-radius:0; border-top-right-radius:0; }
.sr-bulk-form--has-actions .sr-table thead th:first-child { border-top-left-radius:0; }
.sr-bulk-form--has-actions .sr-table thead th:last-child { border-top-right-radius:0; }
.sr-bulk-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:16px 22px 12px; border-bottom:1px solid #d9e2f0; background:#f8fbff; border-top-left-radius:18px; border-top-right-radius:18px; }
.sr-bulk-actions .btn { display:inline-flex; align-items:center; gap:8px; }
.sr-bulk-count { margin-left:auto; font-size:13px; color:#475467; font-weight:600; }
.sr-cell-select { width:48px; max-width:52px; text-align:center; padding:0 12px; }
.sr-cell-select input { width:18px; height:18px; cursor:pointer; margin:0; }
.sr-cell-select input:disabled { cursor:default; opacity:0.6; }
.sr-table tbody td { padding:6px 8px; font-size:14px; color:inherit; vertical-align:middle; background:transparent; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sr-table tbody tr.sr-empty-row td { white-space:normal; overflow:visible; text-overflow:clip; }
.sr-table tbody tr { position:relative; transition:background-color .15s ease, color .15s ease; background:var(--sr-row-bg, #fff); color:var(--sr-row-text, #0f172a); }
.sr-table tbody tr::after { content:""; position:absolute; left:0; right:0; bottom:0; height:1px; background:#eef2f6; pointer-events:none; }
.sr-table tbody tr:last-child::after { display:none; }
.sr-table tbody tr:hover { background:var(--sr-row-hover-bg, #f8fafc); }
.sr-table tbody tr:hover td { background:transparent; }

.sr-feedback-controls .sr-filter.search { flex:1 1 280px; }
.sr-feedback-controls .sr-helper { display:block; margin-top:6px; font-size:12px; color:#94a3b8; }
.sr-feedback-list { overflow:hidden; }
.sr-feedback-header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:18px 22px; border-bottom:1px solid #d9e2f0; background:#f8fbff; }
.sr-feedback-header h2 { margin:0; font-size:18px; font-weight:700; color:#0f172a; }
.sr-feedback-header p { margin:4px 0 0; font-size:13px; color:#475467; }
.sr-feedback-list .sr-table-wrapper { border-top:1px solid #d9e2f0; border-bottom-left-radius:18px; border-bottom-right-radius:18px; }
.sr-feedback-list .sr-table { min-width:960px; }
.sr-cell-feedback { min-width:260px; }
.sr-feedback-inline { display:flex; align-items:center; gap:10px; flex-wrap:nowrap; white-space:nowrap; }
.sr-feedback-note { font-size:12px; color:#94a3b8; }
.sr-feedback-note--type { font-weight:600; color:#0f766e; text-transform:uppercase; letter-spacing:0.04em; }
.sr-rating-pill { display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:999px; background:rgba(250,204,21,0.16); color:#92400e; font-weight:700; font-size:13px; border:1px solid rgba(250,204,21,0.4); box-shadow:0 2px 6px rgba(251,191,36,0.35); }
.sr-rating-pill i { color:#f59e0b; font-size:14px; }
.sr-cell-worker { min-width:160px; }
.sr-cell-scores { min-width:360px; }
.sr-score-inline { display:flex; align-items:center; gap:8px; flex-wrap:nowrap; white-space:nowrap; overflow-x:auto; padding-bottom:2px; }
.sr-score-inline::-webkit-scrollbar { height:4px; }
.sr-score-inline::-webkit-scrollbar-thumb { background:#cbd5f5; border-radius:999px; }
.sr-score-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:999px; border:1px solid #e2e8f0; background:#f8fafc; font-size:12px; font-weight:600; color:#475467; }
.sr-score-chip .sr-score-label { font-size:12px; font-weight:600; color:#475467; text-transform:none; letter-spacing:0; }
.sr-score-chip .sr-score-value { font-size:13px; font-weight:700; color:#0f172a; }
.sr-feedback-list .sr-pagination { padding:18px 22px; border-top:1px solid #d9e2f0; background:#f8fbff; border-bottom-left-radius:18px; border-bottom-right-radius:18px; }
.sr-feedback-list .sr-pagination-form { margin:0; }
.sr-feedback-list .sr-pagination .muted { font-size:13px; }

.sr-ticket-row { --sr-row-bg:#fff; --sr-row-hover-bg:#f8fafc; --sr-row-text:#0f172a; }
.sr-ticket-row td { transition:color .15s ease; }
.sr-ticket-row.sr-urgent { --sr-row-bg:rgba(239, 68, 68, 0.16); --sr-row-hover-bg:rgba(239, 68, 68, 0.22); --sr-row-text:#7f1d1d; }
.sr-ticket-row.sr-soon { --sr-row-bg:rgba(251, 191, 36, 0.14); --sr-row-hover-bg:rgba(251, 191, 36, 0.2); --sr-row-text:#92400e; }
.sr-ticket-row.sr-past { --sr-row-bg:rgba(148, 163, 184, 0.14); --sr-row-hover-bg:rgba(148, 163, 184, 0.2); --sr-row-text:#475467; }
.sr-ticket-row.sr-past .sr-ticket-id,
.sr-ticket-row.sr-past .sr-client-name,
.sr-ticket-row.sr-past .sr-schedule-text,
.sr-ticket-row.sr-past .sr-created-date { color:#475467; }
.sr-ticket-row.sr-past .sr-comment-text,
.sr-ticket-row.sr-past .sr-comment-empty { color:#64748b; }
.sr-ticket-row.sr-past .status-pill { border-color:rgba(148,163,184,0.5); color:#64748b; }

.sr-ticket-row td:nth-child(2) { position:relative; padding-left:24px; }
.sr-ticket-row td:nth-child(2)::before { content:""; position:absolute; left:10px; top:6px; bottom:6px; width:4px; border-radius:999px; background:#e2e8f0; }
.sr-ticket-row:hover td:nth-child(2)::before { background:var(--primary); }
.sr-ticket-row.sr-urgent td:nth-child(2)::before { background:#ef4444; }
.sr-ticket-row.sr-soon td:nth-child(2)::before { background:#fbbf24; }
.sr-ticket-row.sr-past td:nth-child(2)::before { background:#94a3b8; }
.sr-ticket-row.sr-flag-day-program td:nth-child(2)::before { background:#0ea5e9; }
.sr-ticket-row.sr-flag-cancel-no-charge td:nth-child(2)::before { background:#f59e0b; }
.sr-ticket-row.sr-flag-cancel-with-charge td:nth-child(2)::before { background:#ef4444; }
.sr-ticket-row.sr-urgent:hover td:nth-child(2)::before { background:#ef4444; }
.sr-ticket-row.sr-soon:hover td:nth-child(2)::before { background:#fbbf24; }
.sr-ticket-row.sr-past:hover td:nth-child(2)::before { background:#94a3b8; }
.sr-ticket-row.sr-flag-day-program:hover td:nth-child(2)::before { background:#0ea5e9; }
.sr-ticket-row.sr-flag-cancel-no-charge:hover td:nth-child(2)::before { background:#f59e0b; }
.sr-ticket-row.sr-flag-cancel-with-charge:hover td:nth-child(2)::before { background:#ef4444; }

.sr-table tbody td.sr-cell-ticket {
  white-space: nowrap;
  overflow: visible;
  text-overflow: initial;
}

.sr-cell-ticket {
  min-width: 240px;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: initial;
}
.sr-cell-ticket,
.sr-cell-ticket * {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: initial !important;
}
.sr-cell-ticket > span + span { margin-left:8px; }
.sr-cell-ticket .status-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  max-width: none;
}
.sr-ticket-id { font-size:15px; font-weight:700; color:#0f172a; letter-spacing:-0.01em; }

.sr-cell-client { min-width:140px; max-width:180px; }
.sr-client-name { font-weight:600; color:#101828; display:block; text-overflow:ellipsis; overflow:hidden; white-space:nowrap; }

.sr-cell-services { min-width:120px; max-width:150px; }
.sr-services-text { display:block; font-size:13px; color:#1f2937; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sr-cell-muted { font-size:13px; color:#94a3b8; }
.sr-services-pills { display:flex; align-items:center; gap:4px; max-width:100%; overflow:hidden; flex:0 1 150px; width:100%; }
.sr-service-pill { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:6px; font-size:12px; background:linear-gradient(140deg, rgba(242,114,38,0.22), rgba(242,114,38,0.08)); color:#c2410c; border:1px solid rgba(242,114,38,0.35); box-shadow:0 1px 4px rgba(242,114,38,0.18); flex:0 0 22px; transition:transform .15s ease, box-shadow .15s ease; }
.sr-service-pill:hover { transform:translateY(-1px); box-shadow:0 3px 8px rgba(242,114,38,0.2); }
.sr-service-pill[data-accent="secondary"] { background:linear-gradient(140deg, rgba(81,208,214,0.22), rgba(81,208,214,0.08)); color:#0f6b74; border:1px solid rgba(81,208,214,0.4); box-shadow:0 1px 4px rgba(14,116,144,0.18); }
.sr-service-pill[data-accent="secondary"]:hover { box-shadow:0 3px 8px rgba(14,116,144,0.22); }
.sr-service-pill[data-accent="dark"] { background:linear-gradient(140deg, rgba(27,27,53,0.2), rgba(27,27,53,0.08)); color:#1b1b35; border:1px solid rgba(27,27,53,0.32); box-shadow:0 1px 4px rgba(15,23,42,0.24); }
.sr-service-pill[data-accent="dark"]:hover { box-shadow:0 3px 8px rgba(15,23,42,0.32); }
.sr-service-pill i { font-size:12px; line-height:1; color:currentColor; }
.sr-service-pill-count { display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:22px; padding:0 6px; border-radius:999px; background:rgba(81,208,214,0.18); color:#0f6b74; border:1px solid rgba(81,208,214,0.32); font-size:10px; font-weight:700; flex:0 0 auto; }

.sr-cell-schedule { min-width:150px; max-width:200px; }
.sr-schedule-text { display:block; font-size:13px; font-weight:600; color:#1f2937; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.sr-cell-comment { min-width:160px; max-width:240px; display:flex; align-items:center; gap:6px; overflow:hidden; }
.sr-comment-pill { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; background:#e2e8f0; color:#475467; flex:0 0 auto; }
.sr-comment-pill.is-client { background:#ecfdf5; color:#047857; }
.sr-comment-pill.is-staff { background:#eff6ff; color:#1d4ed8; }
.sr-comment-pill.is-internal { background:#fef3c7; color:#92400e; }
.sr-comment-text { display:block; font-size:13px; color:#1f2937; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1 1 auto; min-width:0; max-width:28ch; }
.sr-comment-empty { display:block; font-size:13px; color:#94a3b8; white-space:nowrap; flex:1 1 auto; min-width:0; max-width:32ch; }

.sr-cell-created { min-width:140px; max-width:180px; }
.sr-created-date { display:block; font-size:13px; font-weight:600; color:#475467; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.sr-empty-state { margin:32px auto; padding:48px 44px; max-width:420px; text-align:center; border:1px dashed #cbd5f5; border-radius:18px; background:#f8fbff; box-shadow:0 4px 18px rgba(15,23,42,0.05); display:flex; flex-direction:column; gap:18px; align-items:center; }
.sr-empty-inline { margin:16px auto; padding:36px 30px; max-width:360px; }
.sr-empty-icon { width:62px; height:62px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:#e0e7ff; color:#3730a3; font-size:26px; }

@media (max-width: 900px) {
  .sr-page-header { flex-direction:column; align-items:flex-start; padding:18px; }
  .sr-page-action { width:100%; justify-content:center; }
  .sr-controls { padding:18px; }
  .sr-filters-modern { flex-direction:column; align-items:stretch; }
  .sr-filter { width:100%; min-width:0; }
  .sr-filter.actions { justify-content:flex-end; }
  .sr-status-chips { overflow-x:auto; padding-bottom:4px; }
  .sr-status-chip { flex:0 0 auto; }
  .sr-table { min-width:100%; }
  .sr-feedback-list .sr-table { min-width:100%; }
  .sr-score-grid { grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); }
}

@media (max-width: 640px) {
  .sr-highlights { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .sr-table-wrapper { overflow-x:auto; }
  .sr-cell-services, .sr-cell-comment { min-width:150px; }
  .sr-comment-text, .sr-comment-empty { max-width:100%; }
  .sr-feedback-header { flex-direction:column; align-items:flex-start; }
  .sr-score-grid { grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); }
}

.btn-primary { background: var(--primary); color:#fff; border:none; border-radius:8px; padding:8px 12px; cursor:pointer; transition: filter .2s ease; }
.btn-primary:hover { filter: brightness(0.95); }
.btn-secondary { background:#e7effa; color:#1b1b35; border:1px solid #cdd3e0; border-radius:8px; padding:8px 12px; cursor:pointer; transition: filter .2s ease; }
.btn-secondary:hover { filter: brightness(0.98); }
.btn-danger { background: var(--dark); color:#fff; border:none; border-radius:8px; padding:8px 12px; cursor:pointer; transition: filter .2s ease; }
.btn-danger:hover { filter: brightness(0.95); }
.card { border:1px solid #e6e7ee; border-radius:10px; background:#fff; box-shadow: 0 2px 6px rgba(16,24,40,0.04); }
.card-header { font-weight:600; padding:12px 14px; border-bottom:1px solid #eef2f6; color:#101828; }
.card-body { padding:12px 14px; }

.sr-detail-page { display:flex; flex-direction:column; gap:20px; }
.sr-detail-page h1 { margin:4px 0 8px; font-size:24px; color:#0f172a; }
.sr-detail-page .card { border-radius:16px; border:1px solid rgba(148,163,184,0.18); box-shadow:0 16px 36px -32px rgba(15,23,42,0.35); }

.sr-hero-card { position:relative; border-radius:20px; padding:22px 24px; background:linear-gradient(135deg, #f8fbff 0%, #ffffff 48%, #f3f4ff 100%); border:1px solid rgba(56,78,126,0.12); box-shadow:0 22px 48px -36px rgba(11,37,76,0.42); overflow:hidden; }
.sr-hero-top { display:flex; gap:16px; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; }
.sr-hero-title { max-width: 480px; }
.sr-hero-eyebrow { display:inline-flex; align-items:center; gap:6px; text-transform:uppercase; letter-spacing:0.08em; font-weight:600; font-size:12px; color:#475467; }
.sr-hero-subtext { margin:0; color:#475467; font-size:13px; }
.sr-hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.sr-detail-page .btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.sr-detail-page .btn,
.sr-detail-page .btn-primary,
.sr-detail-page .btn-secondary,
.sr-detail-page .btn-danger { border-radius:9px; font-weight:600; padding:9px 14px; box-shadow:none; }
.sr-detail-page .btn-secondary { background:rgba(255,255,255,0.85); border:1px solid rgba(56,78,126,0.18); color:#1f2937; transition:transform .18s ease, box-shadow .22s ease; }
.sr-detail-page .btn-secondary:hover { transform:translateY(-1px); box-shadow:0 6px 16px -12px rgba(15,23,42,0.35); }
.sr-detail-page .btn { background: var(--primary); color:#fff; border:none; transition:transform .18s ease, box-shadow .22s ease; }
.sr-detail-page .btn:hover { transform:translateY(-1px); box-shadow:0 8px 18px -14px rgba(16,185,129,0.4); }

.sr-hero-footer { display:flex; gap:16px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin-top:16px; }
.sr-hero-meta { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.sr-hero-meta-item { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; background:rgba(255,255,255,0.9); border:1px solid rgba(148,163,184,0.24); color:#1f2937; font-weight:500; box-shadow:0 6px 14px -12px rgba(15,23,42,0.32); }
.sr-detail-page .status-pill { display:inline-flex; align-items:center; gap:5px; padding:5px 14px; border-radius:999px; font-weight:600; font-size:12px; text-transform:capitalize; background:rgba(255,255,255,0.9); border:1px solid currentColor; }

.sr-detail-layout { display:grid; grid-template-columns: minmax(0,2.1fr) minmax(0,1fr); gap:20px; align-items:flex-start; }
@media (max-width: 1100px) { .sr-detail-layout { grid-template-columns: 1fr; } }
.sr-col-side { display:flex; flex-direction:column; gap:18px; }

.sr-highlights { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:16px; margin-bottom:18px; }
@media (max-width: 640px) { .sr-highlights { grid-template-columns: 1fr; } }
.sr-highlights-side { display:flex; flex-direction:column; gap:12px; margin-bottom:0; }

.sr-highlight-card { position:relative; display:flex; align-items:flex-start; gap:14px; padding:18px; border:1px solid rgba(148,163,184,0.16); border-radius:16px; background:#fff; box-shadow:0 16px 32px -30px rgba(15,23,42,0.32); transition:transform .2s ease, box-shadow .2s ease; }
.sr-highlight-card:hover { transform: translateY(-1px); box-shadow:0 20px 40px -32px rgba(15,23,42,0.36); }
.sr-highlight-icon { width:40px; height:40px; border-radius:12px; background:linear-gradient(135deg, rgba(80,205,255,0.2), rgba(37,99,235,0.25)); color:#1d4ed8; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.sr-highlight-services .sr-highlight-icon { background:linear-gradient(135deg, rgba(16,185,129,0.18), rgba(45,212,191,0.35)); color:#0f766e; }
.sr-highlight-date .sr-highlight-icon { background:linear-gradient(135deg, rgba(99,102,241,0.18), rgba(129,140,248,0.3)); color:#4338ca; }
.sr-highlight-route .sr-highlight-icon { background:linear-gradient(135deg, rgba(236,72,153,0.18), rgba(244,114,182,0.28)); color:#be185d; }
.sr-highlight-label { font-size:11px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:#667085; }
.sr-highlight-value { display:block; margin-top:4px; font-size:15px; color:#101828; font-weight:600; }
.sr-highlight-meta { display:inline-flex; align-items:center; gap:6px; margin-top:6px; font-size:13px; color:#475467; }
.sr-highlight-hint { display:block; margin-top:6px; font-size:12px; font-weight:500; color:#f97316; }
.sr-highlight-card.sr-soon .sr-highlight-hint { color:#fb923c; }
.sr-highlight-card.sr-past .sr-highlight-hint { color:#e11d48; }
.sr-highlight-card.sr-urgent { border-color: rgba(239, 68, 68, 0.55); box-shadow:0 20px 36px -24px rgba(239, 68, 68, 0.35); }
.sr-highlight-card.sr-urgent .sr-highlight-icon { background:linear-gradient(135deg, rgba(239,68,68,0.24), rgba(248,113,113,0.32)); color:#991b1b; }
.sr-highlight-card.sr-soon { border-color: rgba(245, 158, 11, 0.28); }
.sr-highlight-card.sr-past { border-color: rgba(239, 68, 68, 0.35); box-shadow:0 18px 36px -28px rgba(220, 38, 38, 0.4); }
.sr-highlight-empty { display:block; margin-top:6px; font-size:13px; color:#98a2b3; font-style:italic; }
.sr-chip-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.sr-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px; background:#eef2ff; color:#312e81; font-size:12px; font-weight:600; }
.sr-route { display:flex; gap:6px; align-items:center; flex-wrap:wrap; font-weight:600; color:#0f172a; margin-top:6px; }
.sr-route-point { max-width: 220px; text-overflow:ellipsis; overflow:hidden; white-space:nowrap; }
@media (max-width: 640px) { .sr-route-point { max-width:100%; } }

.sr-panel .card-header { padding:16px 20px; border-bottom:1px solid rgba(226,232,240,0.7); background:linear-gradient(135deg, rgba(248,250,252,0.9), rgba(255,255,255,0.8)); }
.sr-panel .card-body { padding:18px 20px; display:flex; flex-direction:column; gap:16px; }
.sr-panel-header h3 { margin:4px 0 0; font-size:17px; color:#101828; }
.sr-panel-eyebrow { display:inline-flex; align-items:center; gap:6px; font-size:10px; letter-spacing:0.12em; text-transform:uppercase; font-weight:700; color:#667085; }
.sr-panel-body-text { margin:0; font-size:14px; line-height:1.55; color:#344054; }
.sr-panel { border-radius:16px; overflow:hidden; }
.sr-panel.sr-comments { overflow:visible; position:relative; }
.sr-panel.sr-comments .card-body { overflow:visible; }
.sr-status-card .card-header { background:linear-gradient(135deg, rgba(236,253,245,0.88), rgba(255,255,255,0.9)); }
.sr-status-card .card-header h3 { color:#0f766e; }
.sr-actions-card .card-header { background:linear-gradient(135deg, rgba(254,242,242,0.9), rgba(255,255,255,0.9)); }
.sr-actions-card .card-header h3 { color:#b91c1c; }
.sr-actions-card .btn-danger { box-shadow:0 12px 26px -18px rgba(239,68,68,0.6); transition:transform .18s ease, box-shadow .22s ease; }
.sr-actions-card .btn-danger:hover { transform:translateY(-1px); box-shadow:0 16px 32px -18px rgba(220,38,38,0.65); }

.sr-comments .card-body { gap:14px; position:relative; overflow:visible; }
.sr-comments .sr-chat { background:linear-gradient(180deg, #f8fafc 0%, #edf2fb 100%); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:10px; }
.sr-comments-list { display:flex; flex-direction:column; gap:10px; max-height:320px; overflow-y:auto; overscroll-behavior:contain; padding-right:6px; }
.sr-comments-footer { display:flex; justify-content:flex-end; }
.sr-activity-card .card-body { gap:0; }
.sr-activity-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:16px; }
.sr-activity-item { display:flex; gap:12px; position:relative; padding-left:6px; }
.sr-activity-item:not(:last-child)::after { content:""; position:absolute; left:21px; top:36px; bottom:-6px; width:2px; background:linear-gradient(180deg, rgba(148,163,184,0.35), rgba(148,163,184,0.05)); }
.sr-activity-marker { width:38px; height:38px; border-radius:12px; background:linear-gradient(135deg, rgba(209, 213, 219, 0.3), rgba(226, 232, 240, 0.7)); display:flex; align-items:center; justify-content:center; color:#1d4ed8; flex-shrink:0; box-shadow:0 10px 18px -14px rgba(15,23,42,0.4); }
.sr-activity-marker i { font-size:18px; }
.sr-activity-content { flex:1; display:flex; flex-direction:column; gap:6px; padding-bottom:6px; }
.sr-activity-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.sr-activity-label { font-weight:600; font-size:14px; color:#0f172a; }
.sr-activity-time { font-size:12px; color:#667085; font-weight:500; }
.sr-activity-description { margin:0; color:#344054; font-size:14px; line-height:1.5; }
.sr-activity-meta { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#475467; font-weight:500; }
.sr-activity-meta i { color:#94a3b8; }
.sr-activity-footer { margin-top:18px; display:flex; justify-content:flex-end; }
.sr-comment-form { display:flex; flex-direction:column; gap:10px; margin-top:4px; position:relative; }
.sr-comment-form textarea { width:100%; border-radius:10px; border:1px solid rgba(148,163,184,0.35); min-height:96px; padding:10px 12px; font-size:14px; line-height:1.45; transition:border-color .2s ease, box-shadow .2s ease; }
.sr-comment-form textarea:focus { outline:none; border-color:rgba(59,130,246,0.6); box-shadow:0 0 0 3px rgba(59,130,246,0.15); }
.sr-quick-replies { position:relative; align-self:flex-end; display:flex; flex-direction:column; gap:8px; z-index:1; }
.sr-quick-replies-toggle { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border-radius:999px; border:1px solid rgba(14,165,233,0.35); background:rgba(14,165,233,0.08); color:#0c4a6e; font-weight:600; font-size:13px; cursor:pointer; transition:background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.sr-quick-replies-toggle i { font-size:15px; }
.sr-quick-replies-toggle:hover { background:rgba(14,165,233,0.16); }
.sr-quick-replies.open .sr-quick-replies-toggle { background:linear-gradient(135deg, #0284c7, #0ea5e9); color:#fff; border-color:transparent; box-shadow:0 12px 28px -16px rgba(14,165,233,0.6); }
.sr-quick-replies-panel { position:absolute; right:0; top:calc(100% + 10px); width:min(520px, calc(100vw - 56px)); display:flex; flex-direction:column; gap:16px; padding:18px 20px; border-radius:16px; border:1px solid rgba(148,163,184,0.32); background:#fff; box-shadow:0 24px 48px -24px rgba(15,23,42,0.45); z-index:40; }
.sr-quick-replies-panel[hidden] { display:none !important; }
.sr-quick-replies-panel.align-top { top:auto; bottom:calc(100% + 10px); }
.sr-quick-replies-header { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.sr-quick-replies-title { font-size:12px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:#1f2937; }
.sr-quick-replies-close { border:none; background:transparent; color:#475569; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; padding:6px; border-radius:50%; transition:background-color .18s ease, color .18s ease; }
.sr-quick-replies-close:hover { background:rgba(148,163,184,0.16); color:#0f172a; }
.sr-quick-replies-groups { display:flex; flex-direction:column; gap:12px; max-height:260px; overflow:auto; padding-right:4px; }
.sr-quick-replies-group { border:1px solid rgba(203,213,225,0.7); border-radius:12px; background:linear-gradient(180deg, rgba(248,250,252,0.96) 0%, #f1f5f9 100%); }
.sr-quick-replies-group summary { list-style:none; cursor:pointer; padding:12px 14px; font-weight:600; font-size:13px; color:#0f172a; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.sr-quick-replies-group summary::-webkit-details-marker { display:none; }
.sr-quick-replies-group summary::after { content:"\f282"; font-family:"bootstrap-icons"; font-size:12px; transition:transform .2s ease; color:#0f172a; }
.sr-quick-replies-group[open] { border-color:rgba(14,165,233,0.35); box-shadow:0 12px 28px -24px rgba(15,23,42,0.35); }
.sr-quick-replies-group[open] summary { color:#0c4a6e; }
.sr-quick-replies-group[open] summary::after { transform:rotate(180deg); }
.sr-quick-replies-buttons { display:flex; flex-direction:column; gap:10px; padding:0 12px 14px; }
.sr-quick-replies-builder { border:1px dashed rgba(148,163,184,0.45); border-radius:12px; padding:12px 14px; background:rgba(248,250,252,0.9); margin-top:6px; }
.sr-quick-replies-builder summary { list-style:none; cursor:pointer; padding:0; font-weight:600; font-size:13px; color:#0f172a; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.sr-quick-replies-builder summary::-webkit-details-marker { display:none; }
.sr-quick-replies-builder summary::after { content:"\f282"; font-family:"bootstrap-icons"; font-size:12px; transition:transform .2s ease; color:#0f172a; }
.sr-quick-replies-builder[open] summary::after { transform:rotate(180deg); }
.sr-quick-replies-form { display:flex; flex-direction:column; gap:10px; padding-top:10px; }
.sr-quick-replies-form label { font-size:11px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:#475467; }
.sr-quick-replies-form input,
.sr-quick-replies-form textarea { border:1px solid rgba(148,163,184,0.4); border-radius:10px; padding:8px 10px; font-size:13px; line-height:1.4; transition:border-color .2s ease, box-shadow .2s ease; }
.sr-quick-replies-form input:focus,
.sr-quick-replies-form textarea:focus { outline:none; border-color:rgba(14,165,233,0.6); box-shadow:0 0 0 3px rgba(14,165,233,0.12); }
.sr-quick-replies-actions { display:flex; justify-content:flex-end; }
.sr-quick-replies-hint { margin:0; font-size:12px; color:#667085; }
.sr-quick-reply { border:1px solid rgba(148,163,184,0.35); background:#f8fafc; color:#0f172a; font-size:14px; padding:14px 18px; border-radius:14px; cursor:pointer; transition:background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease; text-align:left; box-shadow:0 12px 26px -18px rgba(15,23,42,0.38); width:100%; display:flex; justify-content:flex-start; align-items:flex-start; line-height:1.55; min-height:54px; }
.sr-quick-reply:hover { background:#e2e8f0; border-color:rgba(148,163,184,0.6); }
.sr-quick-reply:focus { outline:none; box-shadow:0 0 0 3px rgba(14,165,233,0.28); background:#e0f2fe; }
.sr-quick-reply:active { background:#dbeafe; border-color:rgba(14,165,233,0.45); }
.sr-comment-actions { display:flex; justify-content:flex-end; }

.sr-quick-replies-group[open] .sr-quick-replies-buttons { animation: srQuickRepliesFade .18s ease; }

@keyframes srQuickRepliesFade {
  from { opacity:0; transform:translateY(-4px); }
  to { opacity:1; transform:translateY(0); }
}

@media (max-width: 640px) {
  .sr-quick-replies { align-self:stretch; }
  .sr-quick-replies-panel { position:static; width:100%; margin-top:4px; box-shadow:0 20px 36px -28px rgba(15,23,42,0.35); }
}

.sr-status-form { display:flex; flex-direction:column; gap:10px; }
.sr-status-select { padding:10px 12px; border-radius:10px; border:1px solid rgba(148,163,184,0.35); background:#f9fafb; font-size:14px; transition:border-color .2s ease, box-shadow .2s ease; }
.sr-status-select:focus { outline:none; border-color:rgba(59,130,246,0.6); box-shadow:0 0 0 4px rgba(59,130,246,0.12); }
.sr-label { font-size:12px; font-weight:600; color:#475467; text-transform:uppercase; letter-spacing:0.08em; }
.sr-block-action { width:100%; justify-content:center; display:inline-flex; align-items:center; gap:8px; padding:10px 14px; font-weight:600; }

.sr-chat { display:flex; flex-direction:column; gap:9px; }
.sr-message { display:flex; flex-direction:column; gap:8px; width:100%; }
.sr-message.sent {
  align-self:flex-end;
  align-items:flex-end;
  justify-content:flex-end;
  gap:8px;
  max-width:72%;
}
.sr-message.received { align-self:flex-start; align-items:flex-start; max-width:72%; }
.sr-bubble { padding:10px 12px; border-radius:18px; line-height:1.4; word-wrap:break-word; white-space:pre-wrap; box-shadow:0 6px 16px -14px rgba(15,23,42,0.28); position:relative; }
.sr-message.sent .sr-bubble {
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  padding:8px 16px;
  background:#0A84FF;
  color:#fff;
  border-radius:20px;
  border-bottom-right-radius:12px;
  font-family:'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size:17px;
  line-height:22px;
  letter-spacing:-0.408px;
  box-shadow:0 16px 32px -22px rgba(10,132,255,0.75);
  max-width:100%;
}
.sr-message.sent .sr-bubble::after {
  content:"";
  position:absolute;
  right:-8px;
  bottom:6px;
  width:0;
  height:0;
  border-left:12px solid #0A84FF;
  border-top:10px solid transparent;
  border-bottom:10px solid transparent;
}
.sr-message.received .sr-bubble {
  background:#E9E9EB;
  border:1px solid #E9E9EB;
  color:#101828;
  border-radius:20px;
  border-bottom-left-radius:12px;
  font-family:'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size:17px;
  line-height:22px;
  letter-spacing:-0.408px;
  padding:8px 16px;
  box-shadow:none;
}
.sr-message.received .sr-bubble::after {
  content:"";
  position:absolute;
  left:-8px;
  bottom:6px;
  width:0;
  height:0;
  border-right:12px solid #E9E9EB;
  border-top:10px solid transparent;
  border-bottom:10px solid transparent;
}
.sr-message-meta { margin-top:4px; font-size:12px; color:#475467; display:flex; gap:6px; align-items:center; }
.sr-message.sent .sr-message-meta {
  margin-top:0;
  font-size:11px;
  line-height:13px;
  letter-spacing:0.066px;
  color:rgba(60,60,67,0.6);
  justify-content:center;
  width:100%;
  text-align:center;
  gap:6px;
}
.sr-message-meta .dot { opacity:0.5; }
.sr-comments .sr-message { width:auto; max-width:100%; }
.sr-comments .sr-message.received { max-width:72%; }
@media (max-width: 640px) {
  .sr-comments .sr-message.received,
  .sr-comments .sr-message.sent { max-width:96%; }
}

.sr-typing { color:#667085; font-size: 12px; margin: 4px 8px 8px; }
.sr-message.typing .sr-bubble { background: #e9edf3; color:#101828; min-width: 48px; display: inline-flex; align-items: center; justify-content:center; box-shadow:none; }
.typing-dots { display:inline-flex; gap:6px; align-items:center; }
.typing-dots span { width:6px; height:6px; background:#8a94a6; border-radius:50%; display:inline-block; opacity:0.4; animation: srBlink 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes srBlink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.goal-display-desc { margin-top: 10px; color:#475467; }

/* Check-In overdue highlight for client names */
.checkin-overdue {
  color: #d32f2f !important;
  font-weight: 600;
}

/* Activity feed depth theme */
.activity-feed.depth-ui {
  --depth-ff: "Manrope", sans-serif;
  --depth-h1: 700 1.5rem/1.2 var(--depth-ff);
  --depth-h2: 700 1.25rem/1.4 var(--depth-ff);
  --depth-h3: 700 1.125rem/1.4 var(--depth-ff);
  --depth-p: 400 1rem/1.6 var(--depth-ff);
  --depth-small: 400 0.75rem/1.6 var(--depth-ff);
  --depth-transition: 0.2s ease-in-out;
  --depth-primary: oklch(0.74 0.12 246);
  --depth-bg-dark: oklch(0.96 0.02 260);
  --depth-bg: oklch(0.99 0.01 250);
  --depth-bg-light: #ffffff;
  --depth-outline: rgba(15, 23, 42, 0.08);
  --depth-text: #101828;
  --depth-text-muted: #667085;
  --depth-shadow-s: inset 0 1px 2px #ffffff30, 0 1px 2px #00000030, 0 2px 4px #00000015;
  --depth-shadow-m: inset 0 1px 2px #ffffff50, 0 2px 4px #00000030, 0 4px 8px #00000015;
  --depth-shadow-l: inset 0 1px 2px #ffffff70, 0 4px 6px #00000030, 0 6px 10px #00000015;
  width: 100%;
  max-width: min(92vw, 1200px);
  margin: 1.5rem auto 3.5rem auto;
  padding: 1.75rem;
  border-radius: 2rem;
  background: var(--depth-bg);
  color: var(--depth-text-muted);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 24px 48px -32px rgba(15, 23, 42, 0.2);
  gap: 28px;
}

.activity-feed.depth-ui h1 {
  font: var(--depth-h1);
  color: var(--depth-text);
  margin: 0;
}

.activity-feed.depth-ui h2 {
  font: var(--depth-h2);
  color: var(--depth-text);
}

.activity-feed.depth-ui h3,
.activity-feed.depth-ui h4 {
  font: var(--depth-h3);
  color: var(--depth-text);
}

.activity-feed.depth-ui p {
  font: var(--depth-p);
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui small,
.activity-feed.depth-ui .small {
  font: var(--depth-small);
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui a {
  color: var(--depth-text);
}

.activity-feed.depth-ui .depth-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--depth-bg-light);
  padding: 1.75rem 2rem;
  border-radius: 1.75rem;
  border: 1px solid var(--depth-outline);
  box-shadow: var(--depth-shadow-m);
}

.activity-feed.depth-ui .depth-hero-copy {
  display: grid;
  gap: 0.75rem;
  max-width: 640px;
}

.activity-feed.depth-ui .depth-hero-copy h1 {
  line-height: 1.2;
}

.activity-feed.depth-ui .depth-hero-copy p {
  max-width: 540px;
}

.activity-feed.depth-ui .activity-filter-form.feed-filter {
  background: var(--depth-bg);
  border: 1px solid var(--depth-outline);
  box-shadow: var(--depth-shadow-m);
  padding: 1.1rem 1.25rem;
  border-radius: 1.5rem;
  gap: 16px;
}

.activity-feed.depth-ui .feed-filter-search {
  background: var(--depth-bg-light);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--depth-text);
}

.activity-feed.depth-ui .feed-filter-search i {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .feed-filter-search input[type="text"] {
  color: var(--depth-text);
}

.activity-feed.depth-ui .activity-filter-form.feed-filter select,
.activity-feed.depth-ui .activity-filter-form.feed-filter input[type="date"],
.activity-feed.depth-ui .feed-mini-filter select,
.activity-feed.depth-ui .feed-mini-filter input[type="date"] {
  background: var(--depth-bg-light);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--depth-text);
}

.activity-feed.depth-ui .activity-filter-form.feed-filter select:focus,
.activity-feed.depth-ui .feed-mini-filter select:focus,
.activity-feed.depth-ui .feed-mini-filter input[type="date"]:focus,
.activity-feed.depth-ui .activity-filter-form.feed-filter input[type="date"]:focus {
  border-color: var(--depth-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(116, 140, 255, 0.18);
}

.activity-feed.depth-ui .feed-custom-range {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .feed-custom-range input[type="date"] {
  min-width: 140px;
}


.activity-feed.depth-ui .feed-filter-button {
  background: var(--depth-primary);
  color: #fff;
  border: none;
  border-radius: 1rem;
  box-shadow: 0 12px 20px -12px rgba(56, 89, 247, 0.6);
  transition: var(--depth-transition);
}

.activity-feed.depth-ui .feed-filter-button:hover {
  background: #4350da;
  color: #fff;
}

.activity-feed.depth-ui .feed-filter-button i {
  color: inherit;
}


.activity-feed.depth-ui .feed-metrics-grid.shadows {
  background: var(--depth-bg-dark);
  border-radius: 1.75rem;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: var(--depth-shadow-l);
  padding: 1.5rem;
  gap: 1.25rem;
}

.activity-feed.depth-ui .feed-metric-card {
  background: var(--depth-bg-light);
  border: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--depth-text);
}

.activity-feed.depth-ui .shadow-none {
  box-shadow: none;
}

.activity-feed.depth-ui .shadow-s {
  box-shadow: var(--depth-shadow-s);
}

.activity-feed.depth-ui .shadow-m {
  box-shadow: var(--depth-shadow-m);
}

.activity-feed.depth-ui .shadow-l {
  box-shadow: var(--depth-shadow-l);
}

.activity-feed.depth-ui .feed-metric-label,
.activity-feed.depth-ui .feed-metric-sub {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .feed-metric-value {
  color: var(--depth-text);
}


.activity-feed.depth-ui .feed-tabs {
  background: var(--depth-bg-light);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--depth-shadow-s);
}

.activity-feed.depth-ui .feed-tab {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .feed-tab.is-active {
  background: rgba(67, 97, 238, 0.12);
  color: var(--depth-text);
  box-shadow: 0 10px 18px -14px rgba(67, 97, 238, 0.8);
}

.activity-feed.depth-ui .feed-tab:focus-visible {
  outline: 2px solid var(--depth-primary);
  outline-offset: 2px;
}

.activity-feed.depth-ui .feed-report-card,
.activity-feed.depth-ui .feed-report-standalone,
.activity-feed.depth-ui .feed-staff-insights,
.activity-feed.depth-ui .feed-staff-insights .staff-insights-panel,
.activity-feed.depth-ui .activity-log-card {
  background: var(--depth-bg-light);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--depth-shadow-m);
}

.activity-feed.depth-ui .feed-report-header span,
.activity-feed.depth-ui .feed-report-meta,
.activity-feed.depth-ui .feed-report-share,
.activity-feed.depth-ui .feed-context,
.activity-feed.depth-ui .feed-meta,
.activity-feed.depth-ui .activity-log-desc,
.activity-feed.depth-ui .activity-log-time,
.activity-feed.depth-ui .feed-goal,
.activity-feed.depth-ui .feed-staff-insights-placeholder p,
.activity-feed.depth-ui .staff-insights-message p,
.activity-feed.depth-ui .feed-trend-date,
.activity-feed.depth-ui .feed-trend-count {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .feed-report-name,
.activity-feed.depth-ui .feed-author,
.activity-feed.depth-ui .feed-target strong,
.activity-feed.depth-ui .staff-insights-panel h3,
.activity-feed.depth-ui .staff-insights-kpi strong,
.activity-feed.depth-ui .feed-trend-list li strong {
  color: var(--depth-text);
}

.activity-feed.depth-ui .feed-info-button {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .feed-info-button:hover {
  color: var(--depth-text);
}

.activity-feed.depth-ui .feed-tooltip {
  background: var(--depth-bg-light);
  color: var(--depth-text);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 20px -16px rgba(15, 23, 42, 0.3);
}

.activity-feed.depth-ui .feed-report-list li {
  border: none;
}

.activity-feed.depth-ui .feed-report-trigger {
  background: var(--depth-bg-light);
  border: 1px solid transparent;
  color: inherit;
  transition: var(--depth-transition);
}

.activity-feed.depth-ui .feed-report-trigger:hover {
  background: var(--depth-bg-dark);
  border-color: rgba(15, 23, 42, 0.08);
}

.activity-feed.depth-ui .feed-report-trigger.is-selected {
  background: rgba(67, 97, 238, 0.12);
  box-shadow: 0 0 0 1px rgba(67, 97, 238, 0.25);
}

.activity-feed.depth-ui .feed-report-trigger.is-selected .feed-report-share {
  color: var(--depth-text);
}

.activity-feed.depth-ui .feed-progress {
  background: rgba(15, 23, 42, 0.08);
}

.activity-feed.depth-ui .feed-progress span {
  background: linear-gradient(90deg, var(--depth-primary) 0%, rgba(15, 23, 42, 0.1) 100%);
}

.activity-feed.depth-ui .feed-staff-insights-placeholder {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .staff-insights-actions .staff-insights-back {
  background: rgba(67, 97, 238, 0.1);
  border: 1px solid rgba(67, 97, 238, 0.2);
  color: #2f3a8f;
}

.activity-feed.depth-ui .staff-insights-actions .staff-insights-back:hover {
  background: rgba(67, 97, 238, 0.18);
}

.activity-feed.depth-ui .feed-chip {
  background: rgba(67, 97, 238, 0.1);
  color: #2f3a8f;
  border: 1px solid rgba(67, 97, 238, 0.16);
}

.activity-feed.depth-ui .feed-chip:hover {
  background: rgba(67, 97, 238, 0.18);
}

.activity-feed.depth-ui .feed-post-header {
  align-items: flex-start;
}

.activity-feed.depth-ui .feed-avatar {
  background: linear-gradient(145deg, rgba(67, 97, 238, 0.16), rgba(67, 97, 238, 0.05));
  border: 1px solid rgba(67, 97, 238, 0.2);
  color: #2f3a8f;
}

.activity-feed.depth-ui .feed-type-icon {
  background: rgba(67, 97, 238, 0.12);
  color: #2f3a8f;
}

.activity-feed.depth-ui .feed-post-body,
.activity-feed.depth-ui .feed-post-footer {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .feed-post-body p {
  color: inherit;
}

.activity-feed.depth-ui .feed-tag {
  background: rgba(67, 97, 238, 0.12);
  color: #2f3a8f;
}

.activity-feed.depth-ui .feed-context i {
  color: var(--depth-text-muted);
}

.activity-feed.depth-ui .activity-feed-empty {
  background: var(--depth-bg-light);
  border-radius: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--depth-shadow-m);
}

.activity-feed.depth-ui .feed-pagination button {
  background: var(--depth-bg-light);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--depth-text);
  border-radius: 0.85rem;
  transition: var(--depth-transition);
}

.activity-feed.depth-ui .feed-pagination button:hover:not([disabled]) {
  background: var(--depth-bg-dark);
}

.activity-feed.depth-ui .feed-pagination button[disabled] {
  opacity: 0.4;
}

/* Developer AI assistant · refreshed layout */
.dev-ai-shell {
  width: 100%;
  margin: 24px 0;
  position: relative;
}

.dev-ai-chat-panel {
  border: 1px solid #dde4f4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 22, 55, 0.12);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dev-ai-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6c7390;
}

.dev-ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dev-ai-chat-header h4 {
  margin: 0;
  font-size: 18px;
  color: #111a32;
}

.dev-ai-chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dev-ai-icon-button {
  border: none;
  background: rgba(15, 27, 66, 0.08);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f1b42;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dev-ai-icon-button:hover,
.dev-ai-icon-button:focus {
  transform: translateY(-1px);
  background: rgba(47, 83, 214, 0.18);
  box-shadow: 0 8px 18px rgba(15, 22, 55, 0.14);
}

.dev-ai-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #1f2e5c;
  border: 1px solid rgba(47, 83, 214, 0.3);
  background: rgba(47, 83, 214, 0.12);
}

.dev-ai-status-chip[data-tone="loading"] { color: #2645b7; border-color: rgba(38, 69, 183, 0.35); }
.dev-ai-status-chip[data-tone="success"] { color: #1f6c41; border-color: rgba(31, 108, 65, 0.35); }
.dev-ai-status-chip[data-tone="error"] { color: #b02a1b; border-color: rgba(176, 42, 27, 0.35); }
.dev-ai-status-chip[data-tone="warning"] { color: #a15c04; border-color: rgba(161, 92, 4, 0.35); }

.dev-ai-footnote {
  font-size: 12px;
  color: #5b6175;
  margin: 0;
}

.dev-ai-thread-container {
  border: 1px solid #eef2fb;
  border-radius: 14px;
  padding: 16px;
  background: #f9fbff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
}

.dev-ai-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
}

.dev-ai-empty {
  text-align: center;
  color: #4d5875;
  padding: 24px 8px;
}

.dev-ai-empty-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: #101a32;
  font-size: 16px;
}

.dev-ai-empty-footnote {
  margin: 0;
  font-size: 13px;
  color: #5c6582;
}

.dev-ai-thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #1b2f63;
}

.dev-ai-thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3c56d9;
  animation: devAiThinking 1.2s ease-in-out infinite;
}

.dev-ai-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.dev-ai-thinking-dot:nth-child(3) { animation-delay: 0.4s; }

.dev-ai-thinking[hidden] { display: none; }

.dev-ai-message { display: flex; }
.dev-ai-message--user { justify-content: flex-end; }
.dev-ai-message--assistant,
.dev-ai-message--thinking { justify-content: flex-start; }

.dev-ai-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef2ff;
  color: #142048;
  box-shadow: 0 10px 26px rgba(17, 25, 60, 0.12);
  max-width: 100%;
  line-height: 1.5;
}

.dev-ai-message--user .dev-ai-bubble {
  background: linear-gradient(135deg, #315efb, #1f3cc9);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.dev-ai-message--assistant .dev-ai-bubble {
  border-bottom-left-radius: 6px;
}

.dev-ai-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dev-ai-input {
  border: 1px solid #d6ddf0;
  border-radius: 14px;
  min-height: 110px;
  padding: 14px 16px;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  line-height: 1.5;
  position: relative;
}

.dev-ai-input:focus {
  outline: none;
  border-color: #4460ff;
  box-shadow: 0 0 0 2px rgba(68, 96, 255, 0.18);
}

.dev-ai-input.is-disabled { opacity: 0.5; pointer-events: none; }

.dev-ai-input.is-empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 14px;
  left: 16px;
  color: rgba(15, 27, 63, 0.45);
  pointer-events: none;
}

.dev-ai-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dev-ai-form-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dev-ai-send,
.dev-ai-cancel {
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.dev-ai-send {
  background: linear-gradient(135deg, #2f66ff, #4251ff);
  color: #fff;
  box-shadow: 0 12px 28px rgba(47, 102, 255, 0.25);
}

.dev-ai-cancel {
  background: #fff;
  border: 1px solid #d6ddf0;
  color: #1f2c58;
}

.dev-ai-mention-menu {
  position: absolute;
  z-index: 40;
  background: #fff;
  border: 1px solid rgba(17, 25, 60, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(13, 20, 43, 0.2);
  padding: 6px 0;
  max-height: 240px;
  overflow-y: auto;
}

.dev-ai-mention-item {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: #111a32;
  cursor: pointer;
}

.dev-ai-mention-line {
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-ai-mention-item.is-active,
.dev-ai-mention-item:hover,
.dev-ai-mention-item:focus {
  background: rgba(47, 102, 255, 0.12);
}

.dev-ai-mention-empty {
  padding: 10px 16px;
  font-size: 13px;
  color: #4a5572;
}

.dev-ai-mention-pill,
.dev-ai-inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(47, 102, 255, 0.16);
  border: 1px solid rgba(47, 102, 255, 0.3);
  color: #172146;
  font-weight: 600;
  margin: 1px 2px;
}

.dev-ai-loader-card {
  position: absolute;
  right: 20px;
  bottom: 20px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(11, 17, 34, 0.92);
  color: #f2f4ff;
  box-shadow: 0 18px 34px rgba(5, 9, 24, 0.45);
  min-width: 220px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.dev-ai-loader-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dev-ai-loader-card[hidden] {
  display: none;
}

.dev-ai-loader {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dev-ai-loader-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #8ba6ff;
  animation: devAiSpin 0.75s linear infinite;
}

.dev-ai-loader-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.dev-ai-loader-pulse {
  display: inline-flex;
  gap: 4px;
}

.dev-ai-loader-pulse span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8ba6ff;
  animation: devAiPulse 1s ease-in-out infinite;
}

@media (max-width: 720px) {
  .dev-ai-chat-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dev-ai-form-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .dev-ai-form-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}

@keyframes devAiThinking {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(-3px); opacity: 1; }
}

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

@keyframes devAiPulse {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1); }
}
.report-popover-toggle {
  border: none;
  background: transparent;
  color: #4f46e5;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.report-popover-toggle:hover {
  color: #312e81;
}
.report-popover-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, 90vw);
  background: #fff;
  border: 1px solid #dbe2f1;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  padding: 12px;
  z-index: 20;
}
.report-popover-panel form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-popover-panel input[type="file"],
.report-popover-panel input[type="text"],
.report-popover-panel input[type="number"] {
  width: 100%;
  border: 1px solid #d7deef;
  border-radius: 8px;
  padding: 6px 8px;
}
.report-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* === Onboarding Board === */
.lead-board-page {
  padding: 32px 24px 48px;
  background: linear-gradient(180deg, rgba(81, 208, 214, 0.12) 0%, rgba(241, 246, 253, 0.6) 45%, #f8f9fb 100%);
  min-height: calc(100vh - 60px);
}

.lead-board-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.lead-board-hero h1 {
  font-size: 2rem;
  margin: 8px 0;
  color: var(--dark);
}

.lead-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(27, 27, 53, 0.65);
}

.lead-board-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lead-board-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.lead-board-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 53, 0.1);
  min-width: 240px;
  flex: 1;
}

.lead-board-search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 0.95rem;
}

.lead-board-filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(27, 27, 53, 0.1);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: rgba(27, 27, 53, 0.75);
}

.lead-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.lead-board-column {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border: 1px solid rgba(27, 27, 53, 0.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
  max-width: 320px;
  flex: 0 0 280px;
}

.lead-board-column-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.lead-board-column-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--dark);
}

.lead-board-column-header p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: rgba(27, 27, 53, 0.6);
}

.lead-board-count {
  background: rgba(242, 114, 38, 0.15);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.lead-board-column-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
}

.lead-board-column-body.is-drop-target {
  border: 2px dashed rgba(81, 208, 214, 0.65);
  border-radius: 14px;
  padding: 8px;
  background: rgba(81, 208, 214, 0.08);
}

.lead-empty {
  color: rgba(27, 27, 53, 0.5);
  font-size: 0.9rem;
  text-align: center;
  padding: 12px;
}

.lead-card {
  position: relative;
  background: linear-gradient(140deg, #ffffff 0%, #f3f8ff 70%, #ffffff 100%);
  border-radius: 12px;
  border: 1px solid rgba(27, 27, 53, 0.18);
  padding: 10px 10px 10px 14px;
  box-shadow: 0 12px 24px rgba(27, 27, 53, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  color: inherit;
  text-decoration: none;
}

.lead-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(81, 208, 214, 0.95), rgba(242, 114, 38, 0.95));
}

.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(27, 27, 53, 0.12);
  border-color: rgba(27, 27, 53, 0.2);
}

.lead-card.is-dragging {
  opacity: 0.6;
}

.lead-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.lead-card-title {
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
}

.lead-card-sub {
  display: block;
  font-size: 0.7rem;
  color: rgba(27, 27, 53, 0.55);
}

.lead-card-source {
  font-size: 0.7rem;
  background: rgba(81, 208, 214, 0.15);
  color: #136a70;
  padding: 4px 8px;
  border-radius: 999px;
}

.lead-card-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: rgba(27, 27, 53, 0.75);
}

.lead-card-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: rgba(241, 246, 253, 0.6);
  border-radius: 10px;
  padding: 6px 8px;
}

.lead-card-next-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: rgba(27, 27, 53, 0.5);
}

.lead-card-next-value {
  font-weight: 600;
  display: block;
}

.lead-card-next-date {
  font-size: 0.7rem;
  color: rgba(27, 27, 53, 0.6);
}

.lead-card-edit {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.lead-card-next-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px;
}

.lead-card-next-form input {
  border: 1px solid rgba(27, 27, 53, 0.15);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.lead-card-next-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.lead-card-owner select {
  width: 100%;
  border: 1px solid rgba(27, 27, 53, 0.15);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 0.8rem;
}

.lead-card-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lead-badge {
  font-size: 0.65rem;
  padding: 3px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.lead-badge--warn {
  background: rgba(242, 114, 38, 0.15);
  color: var(--primary);
}

.lead-badge--ok {
  background: rgba(46, 204, 113, 0.15);
  color: #1d8a4a;
}

@media (max-width: 760px) {
  .lead-board-hero {
    align-items: flex-start;
  }
  .lead-board {
    gap: 12px;
  }
  .lead-board-column {
    flex: 0 0 85vw;
    max-width: 85vw;
  }
}

.lead-card[data-overdue="1"] {
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.12);
}

/* Lead profile restyle */
.lead-detail-page {
  position: relative;
  overflow: visible;
  min-height: 100vh;
  height: auto;
  background: linear-gradient(180deg, #edf7ff 0%, #f6fbff 45%, #e9f4ff 100%);
  margin: 0;
  width: 100%;
  overflow-x: hidden;
}

.lead-detail-body {
  overflow-x: hidden;
  background: linear-gradient(180deg, #e4f0ff 0%, #e9f4ff 45%, #dcecff 100%);
}

.lead-detail-body .lead-detail-page {
  background: linear-gradient(180deg, #edf7ff 0%, #f6fbff 45%, #e9f4ff 100%);
}

.lead-detail-body .main-content {
  padding: 0 !important;
  overflow-x: hidden;
  background: linear-gradient(180deg, #edf7ff 0%, #f6fbff 45%, #e9f4ff 100%);
  margin-left: 264px !important;
  width: auto !important;
  max-width: none !important;
  flex: 1 1 auto;
  box-sizing: border-box;
}

.lead-detail-body.has-branch-menu .main-content {
  margin-left: calc(264px + var(--branch-menu-width)) !important;
  width: auto !important;
  max-width: none !important;
}

/* Hide the scroll gutter on the lead profile page (still scrollable). */
.lead-detail-body,
.lead-detail-body .main-content {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
.lead-detail-body .lead-profile-left,
.lead-detail-body .lead-profile-main,
.lead-detail-body .lead-profile-sidebar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
.lead-detail-body::-webkit-scrollbar,
.lead-detail-body .main-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.lead-detail-body .lead-profile-left::-webkit-scrollbar,
.lead-detail-body .lead-profile-main::-webkit-scrollbar,
.lead-detail-body .lead-profile-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

@media (max-width: 900px) {
  .lead-detail-body .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.lead-detail-page::before,
.lead-detail-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.lead-detail-page::before {
  width: 380px;
  height: 380px;
  top: -140px;
  right: -120px;
  background: radial-gradient(circle, rgba(81, 208, 214, 0.22), transparent 70%);
}

.lead-detail-page::after {
  width: 460px;
  height: 460px;
  top: 260px;
  left: -180px;
  background: radial-gradient(circle, rgba(242, 114, 38, 0.12), transparent 72%);
}

.lead-detail-page .lead-shell {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.lead-detail-page .lead-stagebar {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 16px 32px -24px rgba(15, 23, 42, 0.45);
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  padding: 12px 16px;
  width: 100%;
}

.lead-detail-page .lead-stagebar-scroll {
  max-width: 100%;
}

.lead-detail-page .lead-stagebar-link {
  padding: 10px 16px;
  font-size: 0.85rem;
}

.lead-detail-page .lead-stagebar-icon {
  width: 26px;
  height: 26px;
  font-size: 0.8rem;
}

.lead-detail-page .lead-profile-hero {
  border-radius: 26px;
  padding: 28px 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 248, 250, 0.95) 55%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid rgba(203, 213, 225, 0.6);
  box-shadow: 0 30px 60px -44px rgba(15, 23, 42, 0.5);
}

.lead-detail-page .lead-profile-hero::before {
  width: 240px;
  height: 240px;
  opacity: 0.35;
}

.lead-detail-page .lead-profile-hero::after {
  width: 200px;
  height: 200px;
  opacity: 0.25;
}

.lead-detail-page .lead-profile-identity h1 {
  letter-spacing: -0.02em;
  font-weight: 700;
}

.lead-detail-page .lead-profile-actions .btn-primary,
.lead-detail-page .lead-profile-actions .btn-secondary {
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  box-shadow: 0 12px 22px -16px rgba(15, 23, 42, 0.45);
}

.lead-detail-page .lead-profile-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.4);
}

.lead-detail-page .lead-profile-facts {
  margin-top: 20px;
  gap: 14px;
}

.lead-detail-page .lead-profile-fact {
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 28px -26px rgba(15, 23, 42, 0.45);
}

.lead-detail-page .lead-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.lead-detail-page .lead-profile-grid {
  margin-top: 0;
  gap: 0;
  align-items: stretch;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 2.1fr) minmax(0, 0.65fr);
  min-height: 0;
  flex: 1 1 auto;
  height: auto;
  overflow: hidden;
  width: 100%;
}

.lead-detail-page .lead-profile-card {
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 14px 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.95);
}

.lead-detail-page .lead-card-header {
  padding-bottom: 8px;
  border-bottom: none;
}

.lead-detail-page .lead-card-header h2 {
  font-size: 1.25rem;
}

.lead-detail-page .lead-card-kicker {
  color: #64748b;
}

.lead-detail-page .lead-form--compact {
  gap: 14px;
}

.lead-detail-page .lead-profile-left,
.lead-detail-page .lead-profile-main,
.lead-detail-page .lead-profile-sidebar {
  gap: 0;
  padding: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: transparent;
  border: none;
  border-radius: 0;
}

.lead-detail-page .lead-profile-left .lead-profile-card,
.lead-detail-page .lead-profile-sidebar .lead-profile-card {
  position: relative;
  z-index: 0;
}

.lead-detail-page .lead-profile-card--link {
  z-index: 5;
}

.lead-detail-page .lead-profile-sidebar .lead-profile-card--assign {
  z-index: 12;
}

.lead-detail-page .lead-profile-card--link .lead-link-menu {
  z-index: 10;
}

.lead-detail-page .lead-profile-left,
.lead-detail-page .lead-profile-sidebar {
  background: #ffffff;
  padding: 10px 12px;
}

.lead-detail-page .lead-profile-main {
  background: linear-gradient(180deg, #e4f0ff 0%, #e9f4ff 45%, #dcecff 100%);
}

.lead-detail-page .lead-profile-main {
  padding: 10px 12px;
  border-left: 1px solid rgba(226, 232, 240, 0.9);
  border-right: 1px solid rgba(226, 232, 240, 0.9);
}

.lead-detail-page .lead-profile-main .lead-form-section {
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.lead-detail-page .lead-profile-main .lead-form-section + .lead-form-section {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.lead-detail-page .lead-profile-left .lead-form-grid,
.lead-detail-page .lead-profile-sidebar .lead-form-grid,
.lead-detail-page .lead-profile-left .lead-form-grid--stretch,
.lead-detail-page .lead-profile-sidebar .lead-form-grid--stretch {
  grid-template-columns: 1fr !important;
  gap: 6px;
}

.lead-detail-page .lead-profile-left .lead-profile-card,
.lead-detail-page .lead-profile-sidebar .lead-profile-card {
  padding: 8px 0;
}

.lead-detail-page .lead-profile-left .lead-form-field--wide,
.lead-detail-page .lead-profile-sidebar .lead-form-field--wide {
  grid-column: 1 / -1;
}

.lead-detail-page .lead-profile-sidebar .lead-definition-list {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 12px;
}

.lead-detail-page .lead-profile-sidebar .lead-definition-list dt {
  font-size: 0.65rem;
}

.lead-detail-page .lead-profile-sidebar .lead-definition-list dd {
  font-size: 0.85rem;
}

.lead-call-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lead-call-form .btn-secondary {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lead-detail-page .lead-profile-left::-webkit-scrollbar,
.lead-detail-page .lead-profile-main::-webkit-scrollbar,
.lead-detail-page .lead-profile-sidebar::-webkit-scrollbar {
  width: 8px;
}

.lead-detail-page .lead-profile-left::-webkit-scrollbar-thumb,
.lead-detail-page .lead-profile-main::-webkit-scrollbar-thumb,
.lead-detail-page .lead-profile-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.lead-detail-page .lead-profile-left::-webkit-scrollbar-track,
.lead-detail-page .lead-profile-main::-webkit-scrollbar-track,
.lead-detail-page .lead-profile-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.lead-detail-page .lead-form--compact .lead-form-section {
  background: transparent;
  border: none;
  padding-bottom: 0;
  gap: 10px;
}

.lead-form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.lead-form-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lead-form-tab-btn.is-active {
  background: rgba(242, 114, 38, 0.12);
  color: var(--primary);
  border-color: rgba(242, 114, 38, 0.35);
}

.lead-form-tab {
  display: none;
}

.lead-form-tab.is-active {
  display: block;
}

.lead-detail-page .lead-form--compact .lead-form-section + .lead-form-section {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding-top: 12px;
  margin-top: 0;
}

.lead-detail-page .lead-profile-main .lead-form--compact .lead-form-section {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  padding: 12px 14px;
}

.lead-detail-page .lead-profile-main .lead-form--compact .lead-form-section + .lead-form-section {
  border-top: none;
  margin-top: 12px;
  padding-top: 12px;
}

.lead-detail-page .lead-form--compact .lead-form-section__header h3 {
  margin-bottom: 4px;
}

.lead-detail-page .lead-form--compact .lead-form-grid {
  gap: 8px 12px;
}

.lead-detail-page .lead-form--compact .lead-form-field {
  gap: 4px;
  font-size: 0.9rem;
}

.lead-detail-page .lead-form--compact .lead-form-field span {
  color: rgba(71, 85, 105, 0.8);
  font-size: 0.72rem;
}

/* Lead support schedule builder */
.lead-support-schedule {
  --lead-schedule-border: rgba(226, 232, 240, 0.9);
  --lead-schedule-muted: #6b7280;
  --lead-schedule-time-width: 52px;
  --lead-schedule-day-width: 110px;
  --lead-schedule-height: 0px;
}
.lead-support-portal {
  position: fixed;
  inset: 0;
  z-index: 3500;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.lead-support-portal[hidden] {
  display: none !important;
}
.lead-support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}
.lead-support-backdrop[hidden] {
  display: none !important;
}
.lead-support-fullscreen {
  overflow: hidden;
}
.lead-support-schedule.is-fullscreen {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 0;
  padding: 16px;
  width: 100%;
  height: 100%;
  box-shadow: none;
  overflow: auto;
}
.lead-support-schedule.is-fullscreen .schedule-toolbar {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.lead-support-schedule .schedule-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--lead-schedule-border);
  border-radius: 10px;
  background: #fbfdff;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.lead-support-schedule .toolbar-left,
.lead-support-schedule .toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.lead-support-schedule .muted {
  color: var(--lead-schedule-muted);
  font-size: 13px;
}
.lead-support-schedule .select {
  border: 1px solid var(--lead-schedule-border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-size: 14px;
}
.lead-support-schedule .schedule-input {
  border: 1px solid var(--lead-schedule-border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-size: 14px;
  min-width: 140px;
}
.lead-support-schedule .btn {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #1f2937;
}
.lead-support-schedule .btn.primary {
  background: var(--primary);
  color: #fff;
}
.lead-support-schedule .btn.primary:hover { filter: brightness(0.95); }
.lead-support-schedule .btn.outline {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.45);
  color: #1f2937;
}
.lead-support-schedule .btn.outline:hover { background: #f8fafc; }
.lead-support-schedule .btn.danger {
  color: #b91c1c;
  border-color: rgba(252, 165, 165, 0.7);
  background: #fff;
}
.lead-support-schedule .btn.xs { padding: 6px 8px; font-size: 12px; }

.lead-support-schedule .schedule-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff7ed;
  border: 1px solid rgba(251, 146, 60, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.lead-support-schedule .schedule-selected[hidden] {
  display: none !important;
}
.lead-support-schedule .schedule-selected .selected-label {
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lead-support-schedule .schedule-selected .selected-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.lead-support-schedule .schedule-selected .selected-time {
  font-weight: 600;
  color: #7c2d12;
}
.lead-support-schedule .schedule-drag-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  padding: 6px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #334155;
}
.lead-support-schedule .schedule-drag-preview .preview-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: #64748b;
}
.lead-support-schedule .schedule-drag-preview .preview-time {
  font-weight: 600;
}

.lead-support-schedule .weeks-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.lead-support-schedule .lead-support-week {
  border: 1px solid var(--lead-schedule-border);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lead-support-schedule .week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lead-support-schedule .week-summary,
.lead-support-schedule .fortnight-summary {
  font-size: 14px;
  color: #1f2937;
}

.lead-support-schedule .lead-support-timeline {
  overflow: visible;
}
.lead-support-schedule .lead-support-day-headers {
  display: grid;
  grid-template-columns: var(--lead-schedule-time-width) repeat(7, minmax(0, 1fr));
  gap: 0;
  min-width: 100%;
  padding: 2px 0;
  border-bottom: 1px solid var(--lead-schedule-border);
  background: #f8fafc;
}
.lead-support-schedule .lead-support-time-header,
.lead-support-schedule .lead-support-day-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  padding: 4px 6px;
}
.lead-support-schedule .lead-support-time-header {
  position: sticky;
  left: 0;
  background: #f8fafc;
  z-index: 2;
}
.lead-support-schedule .lead-support-timeline-grid {
  display: grid;
  grid-template-columns: var(--lead-schedule-time-width) repeat(7, minmax(0, 1fr));
  gap: 0;
  min-width: 100%;
  position: relative;
}
.lead-support-schedule .lead-support-time-column {
  position: sticky;
  left: 0;
  background: #fff;
  border-right: 1px solid var(--lead-schedule-border);
  z-index: 2;
}
.lead-support-schedule .lead-support-time-label {
  position: absolute;
  left: 4px;
  transform: translateY(-50%);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--lead-schedule-muted);
}
.lead-support-schedule .lead-support-day-column {
  position: relative;
  border-right: 1px solid var(--lead-schedule-border);
  border-bottom: 1px solid var(--lead-schedule-border);
  background: #fff;
  min-height: 0;
}
.lead-support-schedule .lead-support-day-column:last-child {
  border-right: none;
}
.lead-support-schedule .lead-support-day-lines,
.lead-support-schedule .lead-support-day-events {
  position: absolute;
  inset: 0 6px;
}
.lead-support-schedule .lead-support-day-lines {
  pointer-events: none;
}
.lead-support-schedule .lead-support-day-events {
  overflow: hidden;
}
.lead-support-schedule .lead-support-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(226, 232, 240, 0.9);
}
.lead-support-schedule .lead-support-line.major {
  border-top-style: solid;
  border-top-color: rgba(203, 213, 225, 0.9);
}
.lead-support-schedule .lead-support-line.minor {
  border-top-style: dashed;
}

.lead-support-schedule .lead-support-event {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 10px;
  padding: 4px 6px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: #eff6ff;
  color: #1e3a8a;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
  cursor: grab;
  user-select: none;
  z-index: 1;
  box-sizing: border-box;
}
.lead-support-schedule .lead-support-event.selected {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4), 0 10px 18px rgba(15, 23, 42, 0.18);
  z-index: 3;
}
.lead-support-schedule .lead-support-event.conflict {
  border-color: rgba(239, 68, 68, 0.6);
  background: #fee2e2;
  color: #991b1b;
}
.lead-support-schedule .lead-support-event.ghost {
  background: rgba(148, 163, 184, 0.2);
  border: 1px dashed rgba(148, 163, 184, 0.8);
  box-shadow: none;
  cursor: grabbing;
}
.lead-support-schedule .lead-support-event-time {
  font-size: 0.62rem;
  font-weight: 700;
}
.lead-support-schedule .lead-support-event-title {
  font-size: 0.72rem;
  font-weight: 600;
}
.lead-support-schedule .lead-support-event-ratio {
  font-size: 0.62rem;
  font-weight: 600;
  color: #475569;
}
.lead-support-schedule .lead-support-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
}
.lead-support-schedule .lead-support-resize-handle.top { top: -4px; }
.lead-support-schedule .lead-support-resize-handle.bottom { bottom: -4px; }

.lead-support-schedule .lead-support-event.service-support_work {
  background: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.35);
  color: #0c4a6e;
}
.lead-support-schedule .lead-support-event.service-occupational_therapy {
  background: #ecfdf3;
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;
}
.lead-support-schedule .lead-support-event.service-physiotherapy {
  background: #fef3c7;
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}
.lead-support-schedule .lead-support-event.service-exercise_physiology {
  background: #ede9fe;
  border-color: rgba(139, 92, 246, 0.35);
  color: #5b21b6;
}
.lead-support-schedule .lead-support-event.service-speech_pathology {
  background: #ffe4e6;
  border-color: rgba(244, 63, 94, 0.35);
  color: #9f1239;
}

.lead-support-schedule .schedule-help {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
}

.dragging-schedule {
  user-select: none;
}
.dragging-schedule .lead-support-event {
  cursor: grabbing;
}

.lead-detail-page .lead-form--compact .lead-form-field input,
.lead-detail-page .lead-form--compact .lead-form-field select,
.lead-detail-page .lead-form--compact .lead-form-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0;
  padding: 0.35rem 0.1rem 0.45rem;
  font-size: 0.95rem;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.lead-detail-page .lead-form--compact .lead-form-field input:hover,
.lead-detail-page .lead-form--compact .lead-form-field select:hover,
.lead-detail-page .lead-form--compact .lead-form-field textarea:hover {
  border-bottom-color: rgba(100, 116, 139, 0.6);
}

.lead-detail-page .lead-form--compact .lead-form-field input:focus,
.lead-detail-page .lead-form--compact .lead-form-field select:focus,
.lead-detail-page .lead-form--compact .lead-form-field textarea:focus {
  outline: none;
  border-bottom: 2px solid var(--primary);
}

.services-multi {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.services-multi-trigger {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  font-size: 0.95rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.services-multi-trigger::after {
  content: '';
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: var(--primary) transparent transparent transparent;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.services-multi.is-open .services-multi-trigger::after {
  transform: rotate(180deg);
}

.services-multi-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid rgba(27, 27, 53, 0.12);
  border-radius: 14px;
  box-shadow: 0 20px 38px rgba(27, 27, 53, 0.18);
  z-index: 300;
  overflow: hidden;
}

.services-multi-menu.is-portal {
  position: fixed;
  z-index: 4000;
}

.services-multi-options {
  max-height: 320px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.services-multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1f2937;
}

.services-multi-option:hover {
  background: rgba(148, 163, 184, 0.18);
}

.services-multi-option input {
  accent-color: var(--primary);
}

.services-multi-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.services-multi-chip {
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #0f172a;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
}

.lead-detail-page .lead-form--compact .lead-form-field input::placeholder,
.lead-detail-page .lead-form--compact .lead-form-field textarea::placeholder {
  color: #94a3b8;
}

.lead-detail-page .lead-form--compact .lead-form-field textarea {
  min-height: 100px;
}

.lead-detail-page .lead-form--compact .lead-contact-row {
  padding: 10px 0 6px;
  border: none;
  border-top: 1px dashed rgba(203, 213, 225, 0.8);
  border-radius: 0;
  background: transparent;
  gap: 10px;
}

.lead-detail-page .lead-form--compact .lead-contact-row:first-child {
  border-top: none;
}

.lead-detail-page .lead-form--compact .lead-contact-actions {
  justify-content: flex-start;
}

.lead-detail-page .lead-form--compact .lead-form-footer {
  background: transparent;
  border-radius: 0;
  padding: 8px 0 0;
}

.lead-profile-preview {
  padding: 16px;
}

.lead-profile-preview__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-profile-preview__header h1 {
  margin: 0;
  font-size: 1.55rem;
  color: #0f172a;
}

.lead-profile-preview__meta {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #64748b;
}

.lead-profile-preview__facts {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
}

.lead-profile-preview__facts span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
  color: rgba(100, 116, 139, 0.75);
}

.lead-profile-preview__facts strong {
  font-weight: 600;
  color: #0f172a;
}

.lead-profile-preview__actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-profile-overview .lead-form-section {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.lead-profile-overview .lead-form-section__header {
  margin-bottom: 2px;
}

.lead-profile-overview .lead-form-grid {
  gap: 6px;
}

.lead-profile-overview .lead-form-field {
  gap: 2px;
}

.lead-profile-overview .lead-form-field input,
.lead-profile-overview .lead-form-field select {
  padding: 0.2rem 0.1rem 0.3rem;
}

.lead-profile-preview__subtle {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(100, 116, 139, 0.7);
}

@media (max-width: 900px) {
  .lead-detail-page {
    margin: 0;
    min-height: 100%;
    height: auto;
  }

  .lead-detail-page .lead-shell {
    padding: 0;
  }

  .lead-detail-page .lead-stagebar {
    margin: 0;
  }
}
