/* ==========================================================================
   NxSpot Relationship System — Contacts & Dashboard Styles
   Matches client design mockups precisely
   ========================================================================== */

/* ==========================================================================
   Loading & Empty States
   ========================================================================== */

.nxspot-rel-loading {
    text-align: center;
    padding: 60px 24px;
    color: #888;
}

.nxspot-rel-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: nxspot-rel-spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

@keyframes nxspot-rel-spin {
    to { transform: rotate(360deg); }
}

.nxspot-rel-empty-state {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nxspot-rel-empty-state svg { margin-bottom: 16px; }
.nxspot-rel-empty-state h3 { font-size: 18px; font-weight: 600; color: #555; margin: 0 0 8px; }
.nxspot-rel-empty-state p { font-size: 14px; color: #999; margin: 0 0 20px; }

/* ==========================================================================
   Search & Filter Bars
   ========================================================================== */

.nxspot-rel-search-bar { margin-bottom: 12px; }

.nxspot-rel-search-input {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #e8e0d6;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    color: #1a1a1a;
}

.nxspot-rel-search-input::placeholder { color: #bbb; }
.nxspot-rel-search-input:focus { border-color: #f5a623; box-shadow: 0 0 0 2px rgba(245,166,35,0.15); }

.nxspot-rel-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.nxspot-rel-filter-select {
    padding: 8px 14px;
    padding-right: 34px;
    border: 1px solid #e8e0d6;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    background-color: #fff;
    color: #555;
    outline: none;
    cursor: pointer;
    height: 40px;
    line-height: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: all 0.2s;
}

.nxspot-rel-filter-select:focus { border-color: #f5a623; box-shadow: 0 0 0 2px rgba(245,166,35,0.15); }

/* ==========================================================================
   Header — "Contacts" title + search/filter icons
   Icons have light cream rounded-square background per mockup
   ========================================================================== */

.nxspot-rel-header-bar__count {
    font-size: 16px;
    color: #aaa;
    font-weight: 400;
    margin-top: 4px;
}

.nxspot-rel-header-bar .nxspot-rel-btn--icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: #fef3e2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #888;
    transition: all 0.2s;
}

.nxspot-rel-header-bar .nxspot-rel-btn--icon:hover {
    background: #fde8c8;
}

/* ==========================================================================
   Toolbar — Task / Select / + New
   Task: cream fill bg. Select + New: orange border only.
   ========================================================================== */

.nxspot-rel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.nxspot-rel-toolbar__left,
.nxspot-rel-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Task button — cream/peach fill background, orange text */
.nxspot-rel-toolbar__task-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #f5a623;
    border: none;
    background: #fef3e2;
    cursor: pointer;
    position: relative;
    font-family: inherit;
}

.nxspot-rel-toolbar__task-btn:hover { background: #fde8c8; }

.nxspot-rel-toolbar__task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f5a623;
    position: absolute;
    top: -1px;
    right: -1px;
}

/* Select button — orange border, transparent bg */
.nxspot-rel-toolbar__select-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #f5a623;
    border: 1.5px solid #f5a623;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.nxspot-rel-toolbar__select-btn:hover { background: rgba(245, 166, 35, 0.06); }

/* ==========================================================================
   Contacts List — Contact Row
   Light cream background per mockup, orange status dot, cloud-arrow icon
   ========================================================================== */

.nxspot-rel-contact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nxspot-rel-contact-list::-webkit-scrollbar {
    display: none;
}

.nxspot-rel-contact-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
    background: #fdf8f1;
    border-radius: 0;
    border-bottom: 1px solid #f0e8dc;
    outline: none;
}

.nxspot-rel-contact-row:focus,
.nxspot-rel-contact-row:focus-visible,
.nxspot-rel-contact-row:active {
    outline: none;
    box-shadow: none;
}

.nxspot-rel-contact-row:hover {
    background: #fdf0e0;
}

/* Avatar wrapper */
.nxspot-rel-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.nxspot-rel-avatar-wrap .nxspot-rel-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    background: #f5a623;
    overflow: hidden;
}

/* Orange status dot — bottom-left of avatar (matching mockup) */
.nxspot-rel-status-dot {
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f5a623;
    border: 2px solid #fdf8f1;
}

.nxspot-rel-contact-row__info {
    flex: 1;
    min-width: 0;
}

.nxspot-rel-contact-row__name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.nxspot-rel-contact-row__subtitle {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nxspot-rel-contact-row__tags {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* Right icon — cloud-upload style, orange */
.nxspot-rel-contact-row__action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f5a623;
    flex-shrink: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.nxspot-rel-form { display: flex; flex-direction: column; gap: 16px; }
.nxspot-rel-form__row { display: flex; flex-direction: column; gap: 16px; }
.nxspot-rel-form__row--half { flex-direction: row; gap: 12px; }
.nxspot-rel-form__row--half .nxspot-rel-form__group { flex: 1; }
.nxspot-rel-form__group { display: flex; flex-direction: column; gap: 4px; }
.nxspot-rel-form__label { font-size: 13px; font-weight: 600; color: #333; }

.nxspot-rel-form__input {
    padding: 9px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    color: #1a1a1a;
}

.nxspot-rel-form__input:focus { border-color: #f5a623; }

select.nxspot-rel-form__input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
}

.nxspot-rel-form__textarea { min-height: 70px; resize: vertical; }
.nxspot-rel-form__hint { font-size: 11px; color: #999; margin-top: 4px; }
.nxspot-rel-form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ==========================================================================
   Contact Detail — Hero Header
   ========================================================================== */

.nxspot-rel-hero {
    background: #f5a623;
    border-radius: 16px;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
    position: relative;
}

.nxspot-rel-hero .nxspot-rel-avatar--xl {
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    font-size: 36px;
    overflow: hidden;
    flex-shrink: 0;
}

.nxspot-rel-hero__info { flex: 1; }

.nxspot-rel-hero__name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nxspot-rel-hero__subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.nxspot-rel-hero__back {
    position: absolute; top: 12px; left: 12px;
    color: #fff; cursor: pointer; background: none; border: none; padding: 4px;
}

/* ==========================================================================
   Quick Actions — Email / Call / Text
   ========================================================================== */

/* Quick actions — INSIDE the orange hero card, white text + semi-transparent white border */
.nxspot-rel-quick-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.nxspot-rel-quick-action {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 16px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.nxspot-rel-quick-action:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.7); }
.nxspot-rel-quick-action__icon { width: 22px; height: 22px; color: #fff; }

/* ==========================================================================
   Next Step Banner
   ========================================================================== */

.nxspot-rel-next-step {
    background: #fffbf2;
    border: 1px solid #f5e6c8;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 16px;
}

.nxspot-rel-next-step__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #f5a623; margin-bottom: 4px; }
.nxspot-rel-next-step__title { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.nxspot-rel-next-step__due { font-size: 12px; color: #888; margin-top: 2px; }

/* ==========================================================================
   Tabs
   ========================================================================== */

.nxspot-rel-tabs {
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    margin-top: 20px;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.nxspot-rel-tab {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #aaa;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.nxspot-rel-tab:hover { color: #666; background: #faf6f0; }
.nxspot-rel-tab--active { color: #1a1a1a; font-weight: 600; border-bottom-color: #f5a623; background: #f5f0e8; border-radius: 6px 6px 0 0; }

/* ==========================================================================
   Contact Info Grid — with orange circle icons
   ========================================================================== */

.nxspot-rel-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px 0 16px;
}

.nxspot-rel-info-item { display: flex; align-items: flex-start; gap: 12px; }

.nxspot-rel-info-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(245, 166, 35, 0.12);
    color: #f5a623;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.nxspot-rel-info-item__label { font-size: 14px; font-weight: 600; color: #1a1a1a; margin-bottom: 2px; }
.nxspot-rel-info-item__value { font-size: 13px; color: #999; }

.nxspot-rel-info-item__value--clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    position: relative;
}

.nxspot-rel-info-item__value--clamp {
    cursor: pointer;
}

/* Tooltip for clamped values */
.nxspot-rel-info-item--has-tooltip {
    position: relative;
}

.nxspot-rel-info-item--has-tooltip .nxspot-rel-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 300px;
    width: max-content;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    word-wrap: break-word;
    white-space: normal;
}

.nxspot-rel-info-item--has-tooltip .nxspot-rel-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-bottom-color: #1a1a1a;
}

.nxspot-rel-info-item--has-tooltip:hover .nxspot-rel-tooltip {
    display: block;
}

/* ==========================================================================
   Notes, Timeline, Tasks, Snippets
   ========================================================================== */

.nxspot-rel-note-item { padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
.nxspot-rel-note-item:last-child { border-bottom: none; }
.nxspot-rel-note-item__content { font-size: 14px; color: #333; line-height: 1.5; margin-bottom: 6px; white-space: pre-wrap; }
.nxspot-rel-note-item__meta { font-size: 12px; color: #999; display: flex; gap: 12px; align-items: center; }
.nxspot-rel-note-item__delete { color: #ccc; cursor: pointer; font-size: 12px; border: none; background: none; padding: 0; font-family: inherit; }
.nxspot-rel-note-item__delete:hover { color: #f44336; }

.nxspot-rel-timeline-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.nxspot-rel-timeline-item:last-child { border-bottom: none; }
.nxspot-rel-timeline-item__dot { width: 10px; height: 10px; border-radius: 50%; background: #f5a623; margin-top: 5px; flex-shrink: 0; }
.nxspot-rel-timeline-item__dot--sent { background: #1976D2; }
.nxspot-rel-timeline-item__dot--received { background: #43A047; }
.nxspot-rel-timeline-item__dot--nxkit { background: #8B5CF6; }

/* RC31/RC33: Source badges on timeline entries — "You" vs "Contact" */
.nxspot-rel-timeline-item__source {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: 1px;
}
.nxspot-rel-timeline-item__source--you {
    background: #fff3e0;
    color: #f5a623;
}
.nxspot-rel-timeline-item__source--contact {
    background: #ede9fe;
    color: #7c3aed;
}
.nxspot-rel-timeline-item__content { flex: 1; }
.nxspot-rel-timeline-item__label { font-size: 14px; font-weight: 500; color: #1a1a1a; margin-bottom: 2px; }
.nxspot-rel-timeline-item__time { font-size: 12px; color: #999; }
.nxspot-rel-msg-status { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-left: 6px; text-transform: capitalize; }
.nxspot-rel-msg-content { font-size: 13px; color: #555; font-style: italic; margin: 4px 0 2px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nxspot-rel-msg-trigger { font-size: 12px; color: #999; margin-top: 2px; }
.nxspot-rel-company-logo { border-radius: 4px; vertical-align: middle; object-fit: contain; background: #fff; }
.nxspot-rel-company-logo--sm { width: 16px; height: 16px; margin-right: 4px; }
.nxspot-rel-company-logo--lg { width: 24px; height: 24px; margin-right: 6px; }

.nxspot-rel-task-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: #fff; border-radius: 10px; border: 1px solid #eee; margin-bottom: 8px; transition: box-shadow 0.15s; }
.nxspot-rel-task-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.nxspot-rel-task-item--completed { opacity: 0.6; }
.nxspot-rel-task-item__checkbox { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #ddd; cursor: pointer; flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; background: none; padding: 0; }
.nxspot-rel-task-item__checkbox:hover { border-color: #4caf50; background: #e8f5e9; }
.nxspot-rel-task-item__checkbox--done { background: #4caf50; border-color: #4caf50; color: #fff; }
.nxspot-rel-task-item__body { flex: 1; min-width: 0; }
.nxspot-rel-task-item__title { font-size: 14px; font-weight: 500; color: #1a1a1a; margin-bottom: 4px; }
.nxspot-rel-task-item--completed .nxspot-rel-task-item__title { text-decoration: line-through; color: #999; }
.nxspot-rel-task-item__meta { font-size: 12px; color: #999; display: flex; gap: 12px; flex-wrap: wrap; }
.nxspot-rel-task-item__meta--overdue { color: #f44336; font-weight: 500; }
.nxspot-rel-task-item__next-step { display: inline-flex; padding: 2px 8px; background: #fff3e0; color: #e65100; border-radius: 8px; font-size: 11px; font-weight: 600; }
.nxspot-rel-task-item__actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.nxspot-rel-task-item__action-btn { padding: 5px 12px; border: 1px solid #ddd; background: #fff; color: #888; cursor: pointer; font-size: 12px; font-family: inherit; border-radius: 6px; font-weight: 500; transition: all 0.15s; }
.nxspot-rel-task-item__action-btn:hover { color: #555; background: #f5f5f5; border-color: #ccc; }
.nxspot-rel-task-item__action-btn--success { border-color: #a5d6a7; color: #388e3c; }
.nxspot-rel-task-item__action-btn--success:hover { color: #2e7d32; background: #e8f5e9; border-color: #81c784; }
.nxspot-rel-task-item__action-btn--danger { border-color: #f5c6c6; color: #e57373; }
.nxspot-rel-task-item__action-btn--danger:hover { color: #d32f2f; background: #fff5f5; border-color: #ef9a9a; }

.nxspot-rel-snippet-card {
    background: #fdf8f1;
    border: 1px solid #f0e4d4;
    border-radius: 14px;
    padding: 0;
    margin-bottom: 14px;
    transition: all 0.2s;
    overflow: hidden;
}
.nxspot-rel-snippet-card:hover { box-shadow: 0 4px 16px rgba(245, 166, 35, 0.1); border-color: #e8d5bc; }

.nxspot-rel-snippet-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 0;
}
.nxspot-rel-snippet-card__title { font-size: 17px; font-weight: 700; color: #1a1a1a; }
.nxspot-rel-snippet-card__actions { display: flex; gap: 6px; }
.nxspot-rel-snippet-card__actions .nxspot-rel-task-item__action-btn { padding: 5px 14px; font-size: 13px; }

.nxspot-rel-snippet-card__content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    background: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    margin: 14px 24px 0;
    border: 1px solid #f0ebe3;
}

.nxspot-rel-snippet-card__meta {
    font-size: 12px;
    color: #b8a88a;
    padding: 12px 24px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nxspot-rel-snippet-card__meta::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d4c4a8;
}

/* ==========================================================================
   Tab Content, Empty, Tags
   ========================================================================== */

.nxspot-rel-tab-content { display: none; padding: 20px 24px; background: #faf6f0; border-radius: 0 0 12px 12px; }
.nxspot-rel-tab-content--active { display: block; }
.nxspot-rel-empty-inline { text-align: center; padding: 32px 16px; color: #999; font-size: 14px; }

.nxspot-rel-tag--removable { cursor: pointer; position: relative; padding-right: 22px; }
.nxspot-rel-tag--removable::after { content: '\00d7'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: 0.5; }
.nxspot-rel-tag--removable:hover::after { opacity: 1; color: #f44336; }

/* ==========================================================================
   Linked NxSpot Page Card
   ========================================================================== */

.nxspot-rel-linked-card { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #f5a623; border-radius: 14px; margin-top: 20px; }
.nxspot-rel-linked-card__info { flex: 1; }
.nxspot-rel-linked-card__name { font-size: 15px; font-weight: 700; color: #fff; }
.nxspot-rel-linked-card__subtitle { font-size: 13px; color: rgba(255, 255, 255, 0.85); margin-top: 2px; }

/* ==========================================================================
   Integration Row, Pro Badge, Dropdown
   ========================================================================== */

.nxspot-rel-integration-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border: 1px solid #f0e4d4; border-radius: 12px; background: #fdf8f1; }
.nxspot-rel-integration-row__left { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: #555; }

.nxspot-rel-pro-badge { display: inline-flex; align-items: center; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #f5a623; color: #fff; letter-spacing: 0.3px; }

.nxspot-rel-dropdown-item:hover { background: #f5f5f5; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .nxspot-rel-form__row--half { flex-direction: column; }
    .nxspot-rel-info-grid { grid-template-columns: 1fr !important; }
    .nxspot-rel-quick-actions { flex-direction: column; }
    .nxspot-rel-hero { padding: 20px 16px 18px; }
    .nxspot-rel-hero .nxspot-rel-avatar--xl { width: 90px; height: 100px; }
}

/* ==========================================================================
   UI & Metrics Spec — Momentum Summary, Focus Mode, Status Indicators (RC7/RC19)
   ========================================================================== */

/* Momentum Summary Counters */
.nxspot-rel-momentum-summary { display: flex; gap: 12px; margin: 12px 0 16px; flex-wrap: wrap; }
.nxspot-rel-momentum-counter { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px; border: 1px solid transparent; background: #fff; cursor: pointer; transition: all 0.15s; flex: 1; min-width: 140px; font-family: inherit; }
.nxspot-rel-momentum-counter:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.nxspot-rel-momentum-counter--at-risk { border-color: #fde68a; background: #fffbeb; }
.nxspot-rel-momentum-counter--new { border-color: #bfdbfe; background: #eff6ff; }
.nxspot-rel-momentum-counter--engaged { border-color: #bbf7d0; background: #f0fdf4; }
.nxspot-rel-momentum-counter__icon { font-size: 18px; line-height: 1; }
.nxspot-rel-momentum-counter--at-risk .nxspot-rel-momentum-counter__icon { color: #f59e0b; }
.nxspot-rel-momentum-counter--new .nxspot-rel-momentum-counter__icon { color: #3b82f6; }
.nxspot-rel-momentum-counter--engaged .nxspot-rel-momentum-counter__icon { color: #10b981; }
.nxspot-rel-momentum-counter__label { font-size: 13px; font-weight: 500; color: #555; flex: 1; text-align: left; }
.nxspot-rel-momentum-counter__count { font-size: 18px; font-weight: 700; color: #1a1a1a; }

/* RC33: State Tabs (replaces Focus Mode + Momentum Counters) */
.nxspot-rel-state-tabs { display: flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid #eee; border-radius: 10px; margin-bottom: 8px; overflow-x: auto; }
.nxspot-rel-state-tab { padding: 7px 14px; border-radius: 8px; border: none; background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: #666; transition: all 0.15s; font-family: inherit; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nxspot-rel-state-tab:hover { color: #1a1a1a; background: #f5f5f5; }
.nxspot-rel-state-tab--active { background: #f5a623; color: #fff; font-weight: 600; }
.nxspot-rel-state-tab--active:hover { background: #e69a1f; color: #fff; }
.nxspot-rel-state-tab__count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 600; background: rgba(0,0,0,0.06); }
.nxspot-rel-state-tab--active .nxspot-rel-state-tab__count { background: rgba(255,255,255,0.3); color: #fff; }

/* RC33: Priority Filter */
.nxspot-rel-priority-filter { margin-bottom: 12px; }
.nxspot-rel-priority-filter__label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; cursor: pointer; user-select: none; }
.nxspot-rel-priority-filter__label input { accent-color: #f5a623; cursor: pointer; }

/* RC33: Priority Star */
.nxspot-rel-priority-star { border: none; background: none; cursor: pointer; padding: 4px; display: inline-flex; align-items: center; opacity: 0.4; transition: opacity 0.2s, transform 0.2s; }
.nxspot-rel-priority-star:hover { opacity: 1; transform: scale(1.15); }
.nxspot-rel-priority-star--active { opacity: 1; }

/* Sectioned Contacts List */
.nxspot-rel-contact-section { margin-bottom: 16px; }
.nxspot-rel-contact-section:last-child { margin-bottom: 0; }
.nxspot-rel-contact-section__header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #fff; border-bottom: 1px solid #eee; cursor: pointer; user-select: none; }
.nxspot-rel-contact-section__header:hover { background: #fff; }
.nxspot-rel-contact-section__title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #333; text-transform: uppercase; letter-spacing: 0.5px; }
.nxspot-rel-contact-section__badge { background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 600; color: #666; }
.nxspot-rel-contact-section__toggle { font-size: 18px; color: #999; transition: transform 0.2s; }
.nxspot-rel-contact-section--collapsed .nxspot-rel-contact-section__toggle { transform: rotate(-90deg); }
.nxspot-rel-contact-section--collapsed .nxspot-rel-contact-section__list { display: none; }
.nxspot-rel-contact-section__view-all { display: block; padding: 10px 16px; text-align: center; font-size: 12px; font-weight: 500; color: #f5a623; background: #fff; border-top: 1px solid #f5f5f5; cursor: pointer; }
.nxspot-rel-contact-section__view-all:hover { background: #fff9f0; }

/* Status indicators per contact row */
.nxspot-rel-status-indicator { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; flex-shrink: 0; }
.nxspot-rel-status-indicator--at-risk { background: #fef3c7; color: #b45309; }
.nxspot-rel-status-indicator--new-connection { background: #dbeafe; color: #1e40af; }
.nxspot-rel-status-indicator--conversation-started { background: #f3f4f6; color: #4b5563; }
.nxspot-rel-status-indicator--engaged { background: #d1fae5; color: #065f46; }
.nxspot-rel-status-indicator--converted { background: #f3f4f6; color: #6b7280; }

/* Contact Detail — Momentum Block */
.nxspot-rel-momentum-block { padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid #eee; margin-bottom: 16px; }
.nxspot-rel-momentum-block__header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.nxspot-rel-momentum-block__status { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.nxspot-rel-momentum-block__message { font-size: 13px; color: #666; line-height: 1.5; }
.nxspot-rel-momentum-block--at-risk { background: #fffbeb; border-color: #fde68a; }
.nxspot-rel-momentum-block--at-risk .nxspot-rel-momentum-block__status { color: #b45309; }
.nxspot-rel-momentum-block--new-connection { background: #eff6ff; border-color: #bfdbfe; }
.nxspot-rel-momentum-block--new-connection .nxspot-rel-momentum-block__status { color: #1e40af; }
.nxspot-rel-momentum-block--conversation-started { background: #fff; border-color: #e5e7eb; }
.nxspot-rel-momentum-block--conversation-started .nxspot-rel-momentum-block__status { color: #4b5563; }
.nxspot-rel-momentum-block--engaged { background: #f0fdf4; border-color: #bbf7d0; }
.nxspot-rel-momentum-block--engaged .nxspot-rel-momentum-block__status { color: #065f46; }
.nxspot-rel-momentum-block--converted { background: #fff; border-color: #d1d5db; }
.nxspot-rel-momentum-block--converted .nxspot-rel-momentum-block__status { color: #6b7280; }

/* Follow-up Toggle Row + Switch */
.nxspot-rel-followup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
}
.nxspot-rel-followup-row__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}
.nxspot-rel-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.nxspot-rel-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    margin: 0;
}
.nxspot-rel-switch__track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.25s ease;
}
.nxspot-rel-switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease;
}
.nxspot-rel-switch input:checked + .nxspot-rel-switch__track {
    background: #f5a623;
}
.nxspot-rel-switch input:checked + .nxspot-rel-switch__track .nxspot-rel-switch__thumb {
    transform: translateX(20px);
}
.nxspot-rel-switch:hover .nxspot-rel-switch__track {
    opacity: 0.92;
}

/* =============================================
   NEXT STEP PICKER (Section 10+12)
   ============================================= */
.nxspot-rel-ns-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nxspot-rel-ns-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #fdf8f1;
    border: 1px solid #e8ddd0;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.nxspot-rel-ns-chip:hover {
    background: #fff3e0;
    border-color: #f5a623;
    color: #d97706;
}
.nxspot-rel-ns-chip--selected {
    background: #f5a623;
    border-color: #f5a623;
    color: #fff;
    font-weight: 600;
}
.nxspot-rel-ns-chip--selected:hover {
    background: #e69a1f;
    border-color: #e69a1f;
    color: #fff;
}
.nxspot-rel-ns-chip__timing {
    font-size: 11px;
    color: #999;
    margin-left: 6px;
}
.nxspot-rel-ns-chip--selected .nxspot-rel-ns-chip__timing {
    color: rgba(255, 255, 255, 0.8);
}

/* =============================================
   NOTE → NEXT STEP SUGGESTIONS (Section 11)
   ============================================= */
.nxspot-rel-note-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0e8dc;
}
.nxspot-rel-note-suggestion:last-child {
    border-bottom: none;
}
.nxspot-rel-note-suggestion__text {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}
.nxspot-rel-note-suggestion__timing {
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}
.nxspot-rel-note-suggestion__actions {
    display: flex;
    gap: 6px;
}
.nxspot-rel-note-suggestion__btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}
.nxspot-rel-note-suggestion__btn--confirm {
    background: #f5a623;
    border-color: #f5a623;
    color: #fff;
    font-weight: 600;
}
.nxspot-rel-note-suggestion__btn--confirm:hover {
    background: #e69a1f;
}
.nxspot-rel-note-suggestion__btn:hover {
    border-color: #bbb;
}

/* =============================================
   RC33: Relationship Summary (detail page)
   ============================================= */
.nxspot-rel-relationship-summary { padding: 12px 16px; background: #fff; border: 1px solid #eee; border-radius: 12px; }
.nxspot-rel-relationship-summary__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nxspot-rel-relationship-summary__status { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.nxspot-rel-status-badge--at-risk { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.nxspot-rel-status-badge--new-connection { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.nxspot-rel-status-badge--conversation-started { background: #fff; color: #4b5563; border: 1px solid #e5e7eb; }
.nxspot-rel-status-badge--engaged { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.nxspot-rel-status-badge--converted { background: #fff; color: #6b7280; border: 1px solid #d1d5db; }
.nxspot-rel-relationship-summary__activity { font-size: 13px; color: #888; flex: 1; }

/* =============================================
   RC33: Elevated Next Step (detail page — most prominent)
   ============================================= */
.nxspot-rel-next-step-elevated--set { padding: 14px 18px; background: #fff; border: 2px solid #f5a623; border-radius: 12px; }
.nxspot-rel-next-step-elevated__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #f5a623; margin-bottom: 4px; }
.nxspot-rel-next-step-elevated__title { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.nxspot-rel-next-step-elevated--warning { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: #fff4e5; border: 2px solid #f5a623; border-radius: 12px; }
.nxspot-rel-next-step-elevated__warning-text { font-size: 14px; color: #92400e; }
.nxspot-rel-next-step-elevated__warning-text strong { color: #b45309; }
