/* ═══════════════════════════════════════════════════════════════
   CRM Feed — Smart Client Digest Styles
   ═══════════════════════════════════════════════════════════════ */

:root {
    --crm-danger: #c95c5c;
    --crm-danger-glow: rgba(201, 92, 92, 0.15);
    --crm-opportunity: #c8a156;
    --crm-opportunity-glow: rgba(200, 161, 86, 0.15);
    --crm-info: #8ca3a3;
    --crm-info-glow: rgba(140, 163, 163, 0.15);
}

/* ── Feed header ─────────────────────────────────────────────── */

.crm-feed-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.crm-feed-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.crm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--crm-danger);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    animation: crm-badge-pulse 2s ease-in-out infinite;
}

@keyframes crm-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ── Feed list ───────────────────────────────────────────────── */

.crm-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ── Card base ───────────────────────────────────────────────── */

.crm-card {
    background: var(--card-gradient, rgba(255,255,255,0.03));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--card-border, var(--border));
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.25s ease;
    overflow: hidden;
}

.crm-card:hover {
    border-left-width: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* ── Card header ─────────────────────────────────────────────── */

.crm-card__header {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.crm-card__icon {
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.crm-card__title {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.crm-card__dismiss {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.crm-card__dismiss:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* ── Card body ───────────────────────────────────────────────── */

.crm-card__body {
    padding-left: 1.35rem;
}

.crm-card__body p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Card footer ─────────────────────────────────────────────── */

.crm-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.35rem;
    padding-left: 1.35rem;
}

.crm-card__type {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ── Priority variants ───────────────────────────────────────── */

.crm-card--danger {
    border-left-color: var(--crm-danger);
}
.crm-card--danger .crm-card__icon {
    animation: crm-pulse-icon 2s ease-in-out infinite;
}
@keyframes crm-pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.crm-card--opportunity {
    border-left-color: var(--crm-opportunity);
}
.crm-card--opportunity .crm-card__icon {
    animation: crm-sparkle 1.5s ease-in-out infinite;
}
@keyframes crm-sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.crm-card--info {
    border-left-color: var(--crm-info);
}

/* ── Empty state ─────────────────────────────────────────────── */

.crm-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.crm-empty__icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    animation: crm-float 3s ease-in-out infinite;
}

@keyframes crm-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.crm-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
    .crm-card {
        padding: 0.75rem;
    }
    .crm-card__body {
        padding-left: 0;
    }
    .crm-card__footer {
        padding-left: 0;
    }
    .crm-card__title {
        font-size: 0.85rem;
    }
}
/* ── CRM Phase 1 (Client Bank) ─────────────────────────────────────── */
.client-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.client-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.client-card__name {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.client-card__date {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.client-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.client-card__tag {
    background: rgba(245, 189, 65, 0.15); /* Gold tint */
    color: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid rgba(245, 189, 65, 0.3);
}

.client-card__notes {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 2px solid var(--primary);
    white-space: pre-wrap;
    margin-top: 0.25rem;
}

.client-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ── Astrologer's Notepad ────────────────────────────────────── */

.astro-notepad {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 340px;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: var(--bg-card, #1e1e24);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.astro-notepad__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.astro-notepad__header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.astro-notepad__icon {
    font-size: 1rem;
}

.astro-notepad__title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.astro-notepad__status {
    font-size: 0.75rem;
    transition: color 0.3s;
}

.astro-notepad__chevron {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.astro-notepad__body {
    padding: 0 1rem 0.75rem;
}

.astro-notepad__textarea {
    width: 100%;
    min-height: 100px;
    max-height: 300px;
    resize: vertical;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    line-height: 1.6;
    outline: none;
    transition: border-color 0.2s;
}

.astro-notepad__textarea:focus {
    border-color: var(--accent);
}

.astro-notepad__textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}
