:root {
    --bg-primary: #1a0b14; /* Dark pinkish black */
    --bg-secondary: #2d1324;
    --bg-tertiary: #4a1f3c;
    --bg-card: rgba(45, 19, 36, 0.7);
    --bg-card-solid: #2d1324;
    --bg-hover: rgba(74, 31, 60, 0.5);
    --text-primary: #fce7f3;
    --text-secondary: #fbcfe8;
    --text-muted: #f472b6;
    
    /* Primary Pink Accent */
    --accent: #ec4899; 
    --accent-light: #f472b6;
    --accent-glow: rgba(236, 72, 153, 0.35);
    
    --success: #10B981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --warning: #F59E0B;
    --info: #0ea5e9;
    
    --border: rgba(244, 114, 182, 0.15);
    --border-light: rgba(244, 114, 182, 0.08);
}

/* Enhancing hovers and glows */
.btn-primary {
    background: linear-gradient(135deg, #db2777, #ec4899);
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(236, 72, 153, 0.6);
}

.stat-card:hover, .entity-card:hover, .tx-card:hover, .budget-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.15);
    transform: translateY(-4px);
}

.sidebar-logo {
    background: linear-gradient(135deg, #db2777, #ec4899);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(236,72,153,0.2), rgba(219,39,119,0.2));
    color: var(--accent-light);
    border-left: 3px solid var(--accent);
    box-shadow: inset 4px 0 10px rgba(236,72,153,0.1);
}

/* AI Analysis Section Styles */
.ai-card {
    background: linear-gradient(145deg, rgba(45, 19, 36, 0.8), rgba(26, 11, 20, 0.9));
    border: 1px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.ai-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(236,72,153,0.1) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

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

.ai-icon {
    font-size: 24px;
    background: linear-gradient(135deg, #fbcfe8, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); text-shadow: 0 0 10px var(--accent-glow); }
    100% { transform: scale(1); }
}

.ai-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-light);
}

.ai-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.ai-content p {
    margin-bottom: 12px;
}

.ai-content h3 {
    color: var(--accent-light);
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 15px;
}

.ai-content ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.ai-content li {
    margin-bottom: 6px;
}

.ai-content strong {
    color: #fff;
}

.btn-ai-refresh {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent-light);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-ai-refresh:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 10px var(--accent-glow);
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-light);
    font-style: italic;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

/* Dynamic Transactions Grid */
.tx-dynamic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 20px;
    align-items: start;
}

.tx-dynamic-grid .tx-date-header {
    grid-column: 1 / -1;
    margin-top: 16px;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-light);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-dynamic-grid .tx-date-header::before {
    content: '??';
    font-size: 14px;
}

/* Adjust card in dynamic grid to look better */
.tx-dynamic-grid .tx-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.tx-dynamic-grid .tx-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
    transform: translateY(-2px);
    background: var(--bg-card-solid);
}

.tx-dynamic-grid .tx-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(236, 72, 153, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    color: var(--accent);
}

.tx-dynamic-grid .tx-info {
    flex: 1;
    min-width: 0; /* allows truncation */
}

.tx-dynamic-grid .tx-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.tx-dynamic-grid .tx-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-dynamic-grid .tx-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.tx-dynamic-grid .tx-amount {
    font-weight: 700;
    font-size: 15px;
}

.tx-dynamic-grid .tx-amount.positive { color: var(--success); }
.tx-dynamic-grid .tx-amount.negative { color: var(--danger); }

.tx-dynamic-grid .tx-actions {
    display: flex;
    gap: 4px;
}

.tx-dynamic-grid .btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tx-dynamic-grid .btn-icon:hover {
    background: var(--accent);
    color: white;
}
