* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --accent: #3b82f6;
    --border: #334155;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-container h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-container p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.google-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s;
}

.google-btn:active {
    transform: scale(0.97);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

.header-left h2 {
    font-size: 1.25rem;
}

.header-left span {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#user-name {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.btn-small {
    padding: 0.35rem 0.75rem;
    background: var(--border);
    color: var(--text-dim);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 0.75rem 1rem;
}

/* Pacing */
.pacing-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.pacing-label {
    font-weight: 600;
}

#pacing-day {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.pacing-bar-container {
    position: relative;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.pacing-bar-expected {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: width 0.3s;
}

.pacing-bar-actual {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 12px;
    transition: width 0.3s, background 0.3s;
}

.pacing-numbers {
    display: flex;
    justify-content: space-between;
}

.pacing-numbers > div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.amount {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.pacing-message {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 8px;
}

.pacing-message.on-track {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.pacing-message.warning {
    background: rgba(234, 179, 8, 0.15);
    color: var(--yellow);
}

.pacing-message.over {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem;
    margin: 0.75rem 0;
}

.stat-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    margin: 0;
}

.stat-amount {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Form */
.form-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

input, select {
    flex: 1;
    padding: 0.65rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}

input::placeholder {
    color: var(--text-dim);
}

select {
    cursor: pointer;
}

.btn-primary {
    padding: 0.65rem 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-danger {
    padding: 0.4rem 0.9rem;
    background: var(--red, #e74c3c);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-danger:active {
    transform: scale(0.97);
}

/* Card Recommendation */
#card-rec-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.card-rec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.9rem;
}

.card-rec-name {
    font-weight: 500;
}

.card-rec-detail {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.card-rec-progress {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 0.35rem 0;
    overflow: hidden;
}

.card-rec-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

/* Transactions */
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.transaction-item:last-child {
    border-bottom: none;
}

.txn-left {
    display: flex;
    flex-direction: column;
}

.txn-desc {
    font-weight: 500;
    font-size: 0.9rem;
}

.txn-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

.txn-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.txn-amount {
    font-weight: 600;
    color: var(--red);
}

.txn-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
}

.txn-delete:hover, .txn-delete:active {
    opacity: 1;
    color: var(--red);
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

/* Collapsible (legacy, kept for any remaining usage) */
.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapse-icon {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.collapse-icon.open {
    transform: rotate(180deg);
}

/* ===== Pulse Header ===== */
.pulse-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}
.pulse-header.pulse-collapsed .pulse-text p {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pulse-header.pulse-collapsed .pulse-text small { display: none; }
.pulse-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.pulse-text {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex;
    position: sticky;
    top: 49px; /* below header */
    z-index: 9;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    flex: 1;
    padding: 0.6rem 0;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .tab-btn .tab-label { display: none; }
    .tab-btn { font-size: 1.1rem; }
}
.tab-btn.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.tab-btn:active {
    background: rgba(255,255,255,0.04);
}

/* ===== Tab Content ===== */
.tab-content {
    display: none;
    padding-bottom: 2rem;
}
.tab-content.active {
    display: block;
}

/* Tighter card spacing inside tabs */
.tab-card {
    margin: 0.5rem 0.75rem !important;
}

/* Stats row inside tab */
.tab-content .stats-row {
    padding: 0 0.75rem;
    margin: 0.5rem 0;
}

/* Fixed Expenses */
.fixed-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.fixed-item:last-child {
    border-bottom: none;
}

.fixed-item .name {
    color: var(--text-dim);
}

/* Bills Calendar */
.bills-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.bills-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.bill-item:last-child {
    border-bottom: none;
}

.bill-item.bill-paid {
    opacity: 0.6;
}

.bill-item.bill-total {
    font-weight: 600;
    border-top: 2px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.bill-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bill-status {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.bill-info {
    display: flex;
    flex-direction: column;
}

.bill-name {
    font-weight: 500;
}

.bill-detail {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.1rem;
}

.bill-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.bill-amount {
    font-weight: 600;
}

.bill-due {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Projections */
.projection-line {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.projection-line strong {
    color: var(--text);
}

/* Import */
.import-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.import-row select {
    flex: 1;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap;
}

.import-status {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.import-status.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.import-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.import-status.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

#import-preview {
    margin-top: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

#import-preview-list {
    font-size: 0.8rem;
}

.import-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.import-preview-item .ip-desc {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.import-preview-item .ip-cat {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.import-preview-item .ip-amount {
    font-weight: 600;
    color: var(--red);
    white-space: nowrap;
}

.import-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 480px) {
    .card {
        margin: 0.5rem 0.75rem;
    }
    
    .stats-row {
        padding: 0 0.75rem;
    }
    
    .stat-amount {
        font-size: 0.85rem;
    }
}

/* Venue Modal */
.venue-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.venue-modal-overlay.hidden { display: none !important; }
.venue-modal {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 440px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.venue-modal-close {
    position: absolute;
    top: 0.75rem; right: 1rem;
    background: none; border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
}
.venue-modal h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.venue-modal .vm-category { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 1rem; }
.vm-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.vm-stat {
    background: var(--bg);
    border-radius: 8px;
    padding: 0.6rem;
    text-align: center;
}
.vm-stat .label { font-size: 0.7rem; }
.vm-stat .value { font-size: 1.1rem; font-weight: 700; display: block; margin-top: 0.2rem; }
.vm-section-title {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
}
.vm-day-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    margin-bottom: 0.5rem;
}
.vm-day-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.vm-day-bar {
    width: 100%;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}
.vm-day-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 2px;
}
.vm-day-count {
    font-size: 0.6rem;
    color: var(--text);
    margin-bottom: 2px;
}
.vm-visit-item {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.vm-visit-item:last-child { border-bottom: none; }
.vm-fun-stat {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(59,130,246,0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    color: var(--accent);
}

/* Net Worth */
.nw-big-number {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 0.5rem 0;
}
.nw-progress-wrap {
    margin: 1rem 0;
}
.nw-progress-bar-bg {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.nw-progress-bar {
    height: 100%;
    background: var(--green);
    border-radius: 5px;
    transition: width 0.3s;
}
.nw-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}
.nw-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.nw-detail-row:last-child { border-bottom: none; }

@keyframes flashGreen {
    0% { background: rgba(34,197,94,0.5); color: #fff; }
    100% { background: transparent; color: var(--green); }
}
@keyframes flashRed {
    0% { background: rgba(239,68,68,0.5); color: #fff; }
    100% { background: transparent; color: var(--green); }
}
.nw-asset-value { font-weight: 600; color: var(--green); border-radius: 4px; padding: 0 4px; }
.price-flash-green { animation: flashGreen 1.5s ease-out !important; }
.price-flash-red { animation: flashRed 1.5s ease-out !important; }
.nw-monthly-change {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(34,197,94,0.1);
    color: var(--green);
}

/* Venue Recommendations */
.venue-rec-item {
    padding: 0.6rem 0.75rem;
    margin: 0.4rem 0;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}
.venue-rec-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.venue-rec-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.venue-rec-avg {
    font-weight: 700;
    font-size: 0.95rem;
}
.venue-rec-meta {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

/* Spending Heatmap Calendar */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.heatmap-header {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 0.25rem 0;
    font-weight: 600;
}
.heatmap-day {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
    position: relative;
}
.heatmap-day:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(255,255,255,0.2);
    z-index: 1;
}
.heatmap-day.empty { background: transparent; cursor: default; }
.heatmap-day.empty:hover { transform: none; box-shadow: none; }
.heatmap-day .hm-num { font-weight: 600; font-size: 0.8rem; }
.heatmap-day .hm-amt { font-size: 0.55rem; opacity: 0.8; margin-top: 1px; }
.heatmap-day.hm-none { background: var(--border); color: var(--text-dim); }
.heatmap-day.hm-low { background: rgba(34,197,94,0.3); color: var(--green); }
.heatmap-day.hm-med { background: rgba(234,179,8,0.3); color: var(--yellow); }
.heatmap-day.hm-high { background: rgba(239,68,68,0.3); color: var(--red); }
.heatmap-day.hm-today { box-shadow: inset 0 0 0 2px var(--accent); }

/* Subscriptions */
.sub-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.sub-item:last-child { border-bottom: none; }
.sub-left { display: flex; flex-direction: column; flex: 1; }
.sub-name { font-weight: 500; font-size: 0.9rem; }
.sub-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.1rem; }
.sub-right { text-align: right; }
.sub-amount { font-weight: 600; font-size: 0.95rem; }
.sub-flag { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px; margin-top: 0.25rem; display: inline-block; }
.sub-flag.active { background: rgba(34,197,94,0.15); color: var(--green); }
.sub-flag.stale { background: rgba(234,179,8,0.15); color: var(--yellow); }
.sub-flag.forgotten { background: rgba(239,68,68,0.15); color: var(--red); }
.sub-dismiss { background: none; border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; border-radius: 4px; font-size: 0.7rem; padding: 0.1rem 0.4rem; margin-top: 0.25rem; opacity: 0.5; transition: opacity 0.2s; }
.sub-dismiss:hover { opacity: 1; color: var(--red); border-color: var(--red); }

/* Savings Goals */
.goal-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.goal-item:last-child { border-bottom: none; }
.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.goal-name { font-weight: 600; font-size: 0.95rem; }
.goal-amounts { font-size: 0.85rem; color: var(--text-dim); }
.goal-bar-bg {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
    margin: 0.3rem 0;
}
.goal-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s;
    background: var(--accent);
}
.goal-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
}
.goal-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.5;
}
.goal-delete:hover { opacity: 1; color: var(--red); }

/* No-Spend Calendar */
.nospend-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.nospend-header {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 0.2rem 0;
    font-weight: 600;
}
.nospend-day {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
}
.nospend-day.empty { background: transparent; }
.nospend-day.no-spend { background: rgba(34,197,94,0.25); color: var(--green); }
.nospend-day.has-spend { background: var(--border); color: var(--text-dim); }
.nospend-day.future { background: transparent; color: var(--text-dim); opacity: 0.4; }
.nospend-day.today-ring { box-shadow: inset 0 0 0 2px var(--accent); }
.nospend-milestone { font-size: 0.55rem; position: absolute; bottom: 1px; }

/* Challenge Progress */
.challenge-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.challenge-item:last-child { border-bottom: none; }
.challenge-bar-bg {
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin: 0.4rem 0;
}
.challenge-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s;
}
.challenge-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Anomaly Detection */
.anomaly-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.anomaly-item:last-child { border-bottom: none; }
.anomaly-left { display: flex; flex-direction: column; flex: 1; }
.anomaly-desc { font-weight: 500; font-size: 0.9rem; }
.anomaly-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.1rem; }
.anomaly-right { display: flex; align-items: center; gap: 0.5rem; }
.anomaly-amount { font-weight: 700; color: var(--red); font-size: 1rem; }
.anomaly-dismiss {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.anomaly-dismiss:hover { opacity: 1; color: var(--red); border-color: var(--red); }
/* Split Tracking */
.split-balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.4rem;
}
.split-balance-name { font-weight: 600; font-size: 0.95rem; }
.split-balance-amount { font-weight: 700; font-size: 1rem; }
.split-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.split-item:last-child { border-bottom: none; }
.split-left { display: flex; flex-direction: column; flex: 1; }
.split-desc { font-weight: 500; }
.split-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.1rem; }
.split-right { display: flex; align-items: center; gap: 0.5rem; }
.split-amount { font-weight: 600; }
.split-settle {
    background: none;
    border: 1px solid var(--green);
    color: var(--green);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    transition: background 0.2s;
}
.split-settle:hover { background: rgba(34,197,94,0.15); }
.split-settled { opacity: 0.5; }
.split-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.split-modal-overlay.hidden { display: none !important; }
.split-modal {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 380px;
    width: 100%;
    position: relative;
}
.split-modal h3 { margin-bottom: 1rem; }
.split-modal .form-row { margin-bottom: 0.5rem; }

.anomaly-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(239,68,68,0.15);
    color: var(--red);
}

/* ============ Drag & Drop Card Reordering ============ */
.tab-card[draggable="true"] {
    cursor: grab;
    position: relative;
}
.tab-card[draggable="true"]:active {
    cursor: grabbing;
}
.tab-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: none;
}
.tab-card.drag-over-top {
    border-top: 3px solid var(--accent);
    margin-top: -1px;
}
.tab-card.drag-over-bottom {
    border-bottom: 3px solid var(--accent);
    margin-bottom: -1px;
}
.tab-card .drag-handle {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 1rem;
    color: var(--text-dim);
    opacity: 0.3;
    pointer-events: none;
    line-height: 1;
}
.tab-card[draggable="true"]:hover .drag-handle {
    opacity: 0.6;
}
/* Mobile reorder buttons */
.card-reorder-btns {
    display: flex;
    gap: 0.25rem;
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 10;
}
.card-reorder-btns button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-reorder-btns button:disabled {
    opacity: 0.3;
    cursor: default;
}
.tab-card.reorder-active {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
