/* Transactions summary cards + charts */

.txn-summary {
    margin-bottom: 1.5rem;
}

.txn-summary .card {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.txn-summary-card-body {
    padding: 0.9rem 1rem 0.75rem 1rem;
}

.txn-summary-label {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.txn-summary-value {
    font-size: 24px;
    font-weight: 600;
    line-height: 2rem;
}

.txn-summary-sub {
    font-size: 14px;
    color: #6b7280;
    margin-top: 0.15rem;
}

.txn-summary-sparkline {
    margin-top: 0.4rem;
    height: 40px;
}

.txn-summary-sparkline svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.txn-summary-sparkline-empty {
    border-radius: 999px;
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
}

/* Single-point mode: center a dot in the sparkline */
.txn-summary-sparkline.single-point {
    position: relative;
}

.txn-summary-sparkline.single-point::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2563eb;
    /* same blue as your line */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Single-point main chart: show a helpful message */
.txn-chart-card.txn-chart-single-point {
    position: relative;
}

.txn-chart-card.txn-chart-single-point .txn-main-chart::before {
    content: "Single day view – no trend line to show";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    color: #94a3b8;
    /* muted slate */
    pointer-events: none;
}

/* Main spending trend chart */

/* Transactions Activity Heatmap */
.txn-heatmap {
    font-size: 12px;
}

.txn-heatmap-month {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
}

.txn-heatmap-month-label {
    width: 80px;
    flex-shrink: 0;
    color: #6c757d;
    font-weight: 500;
}

.txn-heatmap-month-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.txn-heatmap-day {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #f8f9fa;
    cursor: pointer;
    transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
}

.txn-heatmap-day:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Intensity levels (0 = no spend, 4 = max spend in range) */
.txn-heatmap-day.lvl-0 {
    background: #f8f9fa;
}

.txn-heatmap-day.lvl-1 {
    background: #e3f2ff;
}

.txn-heatmap-day.lvl-2 {
    background: #bedcff;
}

.txn-heatmap-day.lvl-3 {
    background: #83b7ff;
}

.txn-heatmap-day.lvl-4 {
    background: #3878ff;
}

/* Transactions Activity Heatmap */

.txn-main-chart {
    height: 220px;
    margin-top: 0.5rem;
}

.txn-main-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* inline-edit */
.txn-editable {
    position: relative;
    padding: 4px;
    /* room for pencil */
    border-bottom: 1px dashed transparent;
    cursor: text;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.txn-editable:hover {
    background-color: #fffdf4;
    /* subtle warm highlight */
    border-bottom-color: rgba(0, 0, 0, 0.12);
}

.txn-editable:focus {
    outline: none;
    background-color: #fff7e1;
    border-bottom-color: #ffc107;
    /* amber-ish */
}

.txn-editable:hover::after,
.txn-editable:focus::after {
    content: "✏";
    position: absolute;
    right: 0.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0.55;
    pointer-events: none;
}

/* Keep numbers right-aligned but still editable */
td.text-end .txn-editable {
    display: inline-block;
    min-width: 4.5rem;
    text-align: right;
}
/* inline-edit */

/* Chart card padding */

.txn-chart-card .card-body {
    padding: 0.9rem 1rem 1rem 1rem;
}

/* Category breakdown horizontal bars */

.txn-category-bars {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.txn-category-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.txn-category-label {
    flex: 0 0 40%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4b5563;
}

.txn-category-bar-wrapper {
    flex: 1 1 auto;
    background: #f3f4f6;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.txn-category-bar-inner {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #0ea5e9);
    transform-origin: left center;
}

.txn-category-value {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    color: #6b7280;
}

/* Tiny helper text under cards/chart */

.txn-muted {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Tooltip for charts & sparklines */

.txn-tooltip {
    position: fixed;
    z-index: 9999;
    padding: 4px 8px;
    border-radius: 999px;
    background: #111827;
    color: #f9fafb;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -120%);
    transition: opacity 0.08s ease-out;
}

/* Show crosshair cursor on interactive charts */

.txn-summary-sparkline svg,
.txn-main-chart svg {
    cursor: crosshair;
}

/* Responsive tweaks */

@media (max-width: 768px) {
    .txn-summary .card {
        border-radius: 0.6rem;
    }

    .txn-main-chart {
        height: 180px;
    }
}