/* ========================================
   Customer Tab - Complete Styling
   ======================================== */

/* ── Toolbar (Search + Filter) ── */
.customer-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.customer-search {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.customer-search__icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    stroke: var(--color-text-muted);
    pointer-events: none;
}

.customer-search__input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.customer-search__input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.customer-search__input::placeholder {
    color: var(--color-text-muted);
}

.customer-search__clear {
    position: absolute;
    right: 10px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-error);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.customer-search__clear:hover {
    background: rgba(239, 68, 68, 0.2);
}

.customer-source-filter {
    padding: 12px 36px 12px 14px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 150px;
    transition: all 0.2s ease;
}

.customer-source-filter:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* ── Count Bar ── */
.customer-count {
    margin-bottom: 16px;
}

.customer-count__text {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ── Empty State ── */
.customer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.customer-empty__icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    opacity: 0.3;
}

.customer-empty__icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--color-text-muted);
}

.customer-empty__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.customer-empty__subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.customer-empty__btn {
    padding: 12px 32px;
}

/* ── Customer Card Grid ── */
.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    animation: customer-fade-in 0.3s ease;
}

@keyframes customer-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.customer-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.customer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), #6366f1);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.customer-card:hover {
    border-color: rgba(13, 148, 136, 0.4);
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(13, 148, 136, 0.1);
    transform: translateY(-2px);
}

.customer-card:hover::before {
    opacity: 1;
}

/* Card Header */
.customer-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.customer-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.customer-card__info {
    flex: 1;
    min-width: 0;
}

.customer-card__name {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-card__email {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contact line */
.customer-card__contact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.customer-card__contact svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: var(--color-primary);
}

.customer-card__phone-extra {
    font-size: 11px;
    font-weight: 600;
    background: rgba(13, 148, 136, 0.15);
    color: var(--color-primary);
    padding: 1px 6px;
    border-radius: 10px;
}

/* Source badge */
.customer-card__source {
    margin-bottom: 12px;
}

.customer-card__source-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
}

/* Divider */
.customer-card__divider {
    height: 1px;
    background: var(--color-border);
    margin-bottom: 12px;
}

/* Stats row */
.customer-card__stats {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
}

.customer-card__stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.customer-card__stat svg {
    width: 15px;
    height: 15px;
}

.customer-card__stat:first-child svg {
    stroke: #3b82f6;
}

.customer-card__stat:nth-child(2) svg {
    stroke: #22c55e;
}

/* Actions row - icon-based */
.customer-card__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.customer-card__action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.customer-card__action-icon svg {
    width: 15px;
    height: 15px;
}

/* Call */
.customer-card__action-icon--call:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* SMS */
.customer-card__action-icon--sms:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

/* WhatsApp */
.customer-card__action-icon--whatsapp:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.3);
    color: #25d366;
}

.customer-card__action-icon--whatsapp svg {
    width: 16px;
    height: 16px;
}

/* Edit - pushed right */
.customer-card__action-icon--edit {
    margin-left: auto;
}

.customer-card__action-icon--edit:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

/* ── Property Mini Badges (on card) ── */
.customer-card__properties {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.customer-card__prop-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.08);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-card__prop-badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.customer-card__prop-badge:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.35);
}

.customer-card__prop-more {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.08);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* Property hover popover */
.customer-card__prop-popover {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 12px;
    z-index: 50;
    cursor: default;
}

.customer-card__prop-badge:hover .customer-card__prop-popover {
    display: block;
}

.customer-card__prop-popover__addr {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.customer-card__prop-popover__type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.customer-card__prop-popover__type svg {
    width: 14px;
    height: 14px;
    stroke: #3b82f6;
}

.customer-card__prop-popover__link {
    font-size: 11px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.customer-card__prop-popover__link:hover {
    text-decoration: underline;
}

/* ── FAB ── */
.customer-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #6366f1);
    border: none;
    box-shadow:
        0 6px 20px rgba(13, 148, 136, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.customer-fab svg {
    width: 24px;
    height: 24px;
    stroke: white;
    transition: transform 0.3s ease;
}

.customer-fab:hover {
    transform: scale(1.08);
    box-shadow:
        0 8px 28px rgba(13, 148, 136, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.customer-fab:active {
    transform: scale(0.96);
}

/* ── Detail View ── */
.customer-detail__header {
    margin-bottom: 28px;
}

.customer-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.15s ease;
}

.customer-detail__back svg {
    width: 18px;
    height: 18px;
}

.customer-detail__back:hover {
    opacity: 0.8;
    transform: translateX(-2px);
}

.customer-detail__name {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.2;
}

/* Section blocks */
.customer-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
    animation: customer-fade-in 0.3s ease;
}

.customer-section--properties {
    border-color: rgba(59, 130, 246, 0.2);
}

.customer-section--properties .customer-section__header {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.08),
        rgba(99, 102, 241, 0.04)
    );
}

.customer-section--attachments {
    border-color: rgba(34, 197, 94, 0.2);
}

.customer-section--attachments .customer-section__header {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.08),
        rgba(13, 148, 136, 0.04)
    );
}

.customer-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(51, 65, 85, 0.15);
    border-bottom: 1px solid var(--color-border);
}

.customer-section__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.customer-section__action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(13, 148, 136, 0.04);
    border: 2px dashed rgba(13, 148, 136, 0.3);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-section__action svg {
    width: 15px;
    height: 15px;
}

.customer-section__action:hover {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.5);
}

.customer-section__body {
    padding: 20px;
}

/* Detail fields */
.customer-detail__field {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.customer-detail__field:last-child {
    border-bottom: none;
}

.customer-detail__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    min-width: 100px;
}

.customer-detail__value {
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
}

/* Phones in detail view */
.customer-detail__phones {
    margin-top: 8px;
}

.customer-detail__phones-header {
    margin-bottom: 8px;
}

.customer-detail__phone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    background: rgba(51, 65, 85, 0.15);
    transition: all 0.15s ease;
}

.customer-detail__phone--primary {
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.customer-detail__phone-star {
    color: var(--color-primary);
    font-size: 14px;
}

.customer-detail__phone-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.customer-detail__phone-label {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 10px;
}

.customer-detail__no-data {
    font-size: 13px;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 12px 0;
}

/* ── Property Cards ── */
.customer-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.customer-property-card {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
}

.customer-property-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}

.customer-property-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.customer-property-card__type-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-property-card__type-icon svg {
    width: 18px;
    height: 18px;
    stroke: #3b82f6;
}

.customer-property-card__type {
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.customer-property-card__address {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.customer-property-card__location {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

/* Instructions */
.customer-property-card__instructions {
    margin: 10px 0;
    padding: 10px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-md);
}

.customer-property-card__instructions-title {
    font-size: 11px;
    font-weight: 600;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.customer-property-card__instruction {
    font-size: 12px;
    color: var(--color-text);
    padding: 3px 0 3px 14px;
    position: relative;
}

.customer-property-card__instruction::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f59e0b;
    transform: translateY(-50%);
}

/* Property card actions */
.customer-property-card__actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.customer-property-card__btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
    text-decoration: none;
}

.customer-property-card__btn svg {
    width: 15px;
    height: 15px;
}

.customer-property-card__btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.customer-property-card__btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--color-error);
}

/* ── Attachments ── */
.customer-attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.customer-attachment-card {
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all 0.2s ease;
}

.customer-attachment-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.1);
}

.customer-attachment-card__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(34, 197, 94, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.customer-attachment-card__icon svg {
    width: 18px;
    height: 18px;
    stroke: #22c55e;
}

.customer-attachment-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
    word-break: break-word;
}

.customer-attachment-card__size {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.customer-attachment-card__actions {
    display: flex;
    gap: 6px;
}

.customer-attachment-card__btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
}

.customer-attachment-card__btn svg {
    width: 14px;
    height: 14px;
}

.customer-attachment-card__btn:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.customer-attachment-card__btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--color-error);
}

/* Upload progress */
.customer-upload-progress {
    margin-bottom: 14px;
}

.customer-upload-bar {
    height: 32px;
    background: rgba(13, 148, 136, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.customer-upload-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), #6366f1);
    border-radius: var(--radius-md);
    transition: width 0.3s ease;
}

.customer-upload-bar__text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}

/* Drop zone */
.customer-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 20px;
    border: 2px dashed rgba(34, 197, 94, 0.25);
    border-radius: var(--radius-md);
    background: rgba(34, 197, 94, 0.03);
    transition: all 0.25s ease;
    cursor: pointer;
}

.customer-dropzone svg {
    width: 32px;
    height: 32px;
    stroke: rgba(34, 197, 94, 0.4);
    transition: all 0.25s ease;
}

.customer-dropzone span {
    font-size: 13px;
    color: var(--color-text-muted);
}

.customer-dropzone__browse {
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.customer-dropzone--active,
.customer-dropzone:hover {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.08);
}

.customer-dropzone--active svg,
.customer-dropzone:hover svg {
    stroke: #22c55e;
    transform: translateY(-2px);
}

/* ── Delete Button ── */
.customer-detail__danger {
    margin-top: 32px;
    padding: 20px;
}

.customer-detail__delete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.04);
    border: 2px dashed rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--color-error);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-detail__delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.6);
}

/* ── Customer Form Modal Additions ── */

/* Phone rows in form */
.customer-phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.customer-phone-row__input {
    flex: 1;
}

.customer-phone-row__label {
    width: 72px;
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    background: transparent;
    border-color: transparent;
    text-align: right;
}

.customer-phone-row__label:focus {
    border-color: var(--color-border);
    background: var(--color-bg-input);
}

.customer-phone-row__primary {
    color: var(--color-primary);
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.customer-phone-row__set-primary {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.customer-phone-row__set-primary:hover {
    color: var(--color-primary);
}

.customer-phone-row__remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.customer-phone-row__remove:hover {
    color: var(--color-error);
}

.customer-add-phone-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.customer-add-phone-btn svg {
    width: 14px;
    height: 14px;
}

.customer-add-phone-btn:hover {
    opacity: 0.8;
}

/* Source radio group in form */
.customer-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.customer-source-option {
    position: relative;
}

.customer-source-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.customer-source-option label {
    display: block;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-source-option input:checked + label {
    border-color: var(--color-primary);
    background: rgba(13, 148, 136, 0.1);
    color: var(--color-primary);
}

.customer-source-option label:hover {
    border-color: rgba(13, 148, 136, 0.3);
}

/* Property type grid */
.property-type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.property-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
}

.property-type-option__icon {
    width: 28px;
    height: 28px;
}

.property-type-option__icon svg {
    width: 100%;
    height: 100%;
}

.property-type-option__label {
    font-size: 11px;
    font-weight: 500;
}

.property-type-option--active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.property-type-option:hover:not(.property-type-option--active) {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Instructions in property form */
.customer-instruction-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.customer-instruction-row .form-input {
    flex: 1;
}

.customer-instruction-row__remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.customer-instruction-row__remove:hover {
    color: var(--color-error);
}

.customer-link-btn {
    display: inline-block;
    padding: 4px 0;
    margin-top: 4px;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: opacity 0.15s ease;
}

.customer-link-btn:hover {
    opacity: 0.7;
}

/* ── Preview Modal ── */
.customer-preview__image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
}

.customer-preview__pdf {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: var(--radius-md);
}

.customer-preview__unsupported {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ── Toast Notification ── */
.customer-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: white;
    z-index: 20000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.customer-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.customer-toast--success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.customer-toast--error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.customer-toast--info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

/* ── Loading indicator ── */
.customer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ── Confirm Dialog ── */
.confirm-dialog__body {
    text-align: center;
    padding: 20px 0;
}

.confirm-dialog__message {
    font-size: 16px;
    color: var(--color-text);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-dialog__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-danger {
    padding: 10px 24px;
    background: var(--color-error);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .customer-toolbar {
        flex-direction: column;
    }

    .customer-source-filter {
        width: 100%;
        min-width: auto;
    }

    .customer-grid {
        grid-template-columns: 1fr;
    }

    .customer-properties-grid {
        grid-template-columns: 1fr;
    }

    .customer-attachments-grid {
        grid-template-columns: 1fr;
    }

    .customer-fab {
        bottom: 20px;
        right: 20px;
    }

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

    .customer-panel {
        width: 100%;
        right: -100%;
    }

    .customer-phone-row__label,
    .customer-email-row__label {
        width: 60px;
    }

    .customer-detail__name {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .property-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Light Mode Overrides ── */
body.light-mode .customer-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
}

body.light-mode .customer-card:hover {
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(13, 148, 136, 0.15);
}

body.light-mode .customer-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
}

body.light-mode .customer-section__header {
    background: rgba(241, 245, 249, 0.6);
}

body.light-mode .customer-detail__phone {
    background: rgba(241, 245, 249, 0.8);
}

body.light-mode .customer-detail__phone--primary {
    background: rgba(13, 148, 136, 0.08);
}

body.light-mode .customer-property-card {
    background: rgba(59, 130, 246, 0.03);
    border: 1px solid rgba(59, 130, 246, 0.12);
}

body.light-mode .customer-attachment-card {
    background: rgba(34, 197, 94, 0.03);
    border: 1px solid rgba(34, 197, 94, 0.12);
}

body.light-mode .customer-dropzone {
    background: rgba(34, 197, 94, 0.02);
    border-color: rgba(34, 197, 94, 0.2);
}

body.light-mode .customer-search__input,
body.light-mode .customer-source-filter {
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
}

body.light-mode .customer-search__input:focus,
body.light-mode .customer-source-filter:focus {
    border-color: var(--color-primary);
}

body.light-mode .customer-property-card__instructions {
    background: rgba(245, 158, 11, 0.04);
    border-color: rgba(245, 158, 11, 0.12);
}

body.light-mode .customer-panel {
    background: var(--color-bg-card);
    border-left: 1px solid var(--color-border);
}

body.light-mode .customer-filter-pill {
    background: rgba(241, 245, 249, 0.8);
    color: var(--color-text-muted);
}

/* ── Filter Pills ── */
.customer-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    align-items: center;
}

.customer-filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.customer-filter-pill:hover {
    border-color: rgba(13, 148, 136, 0.4);
    color: var(--color-primary);
}

.customer-filter-pill--active {
    background: rgba(13, 148, 136, 0.15);
    border-color: rgba(13, 148, 136, 0.4);
    color: var(--color-primary);
    font-weight: 600;
}

/* ── Slide Panel ── */
.customer-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
}

.customer-panel-overlay--visible {
    display: block;
}

.customer-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
    z-index: 200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.customer-panel--open {
    right: 0;
}

.customer-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-card);
    flex-shrink: 0;
}

.customer-panel__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.customer-panel__title svg {
    width: 22px;
    height: 22px;
    stroke: var(--color-primary);
}

.customer-panel__close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.customer-panel__close:hover {
    background: var(--color-bg-input);
    color: var(--color-text);
}

.customer-panel__close svg {
    width: 18px;
    height: 18px;
}

.customer-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.customer-panel__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--color-border);
}

/* ── Email Row (matches phone row) ── */
.customer-email-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.customer-email-row__input {
    flex: 1;
    min-width: 0;
}

.customer-email-row__label {
    width: 72px;
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    background: transparent;
    border-color: transparent;
    text-align: right;
}

.customer-email-row__label:focus {
    border-color: var(--color-border);
    background: var(--color-bg-input);
}

.customer-email-row__primary {
    color: #f59e0b;
    font-size: 18px;
    cursor: default;
    flex-shrink: 0;
}

.customer-email-row__set-primary {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.customer-email-row__set-primary:hover {
    color: #f59e0b;
}

.customer-email-row__remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.customer-email-row__remove:hover {
    color: #ef4444;
}

/* ── Progressive Shake Animations (duplicate phone validation) ── */
@keyframes shake-mild {
    0%,
    100% {
        transform: translateX(0);
    }
    20%,
    60% {
        transform: translateX(-4px);
    }
    40%,
    80% {
        transform: translateX(4px);
    }
}

@keyframes shake-medium {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    50%,
    90% {
        transform: translateX(-6px);
    }
    30%,
    70% {
        transform: translateX(6px);
    }
}

@keyframes shake-hard {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

.shake-mild {
    animation: shake-mild 0.4s ease;
}

.shake-medium {
    animation: shake-medium 0.5s ease;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

.shake-hard {
    animation: shake-hard 0.6s ease;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5) !important;
}

.input-error {
    border-color: #ef4444 !important;
}

/* duplicate customer warning card */
.customer-dup-card {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: customer-fade-in 0.25s ease;
}

.customer-dup-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-dup-card__header svg {
    width: 20px;
    height: 20px;
    stroke: #f59e0b;
    flex-shrink: 0;
}

.customer-dup-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #f59e0b;
}

.customer-dup-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.customer-dup-card__match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.customer-dup-card__match--strong {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
}

.customer-dup-card__match-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.customer-dup-card__match-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f59e0b;
}

.customer-dup-card__match-badge--strong {
    color: #ef4444;
}

.customer-dup-card__match-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-dup-card__match-detail {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-dup-card__view {
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(13, 148, 136, 0.3);
    background: transparent;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.customer-dup-card__view:hover {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.5);
}

.customer-dup-card__dismiss {
    align-self: flex-end;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.customer-dup-card__dismiss:hover {
    border-color: rgba(148, 163, 184, 0.4);
    color: var(--color-text);
}

@keyframes dup-pulse {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
    }
}

.customer-dup-warning--pulse .customer-dup-card {
    animation: dup-pulse 0.6s ease;
}
