:root {
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger:  #e74c3c;
}

/* ── Base ─────────────────────────────────────────────────── */
body { background: #f0f2f5; }
html { overflow-y: scroll; }

/* ── Navbar ───────────────────────────────────────────────── */
.bg-slate { background-color: #2563eb; }
.navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.navbar .nav-link.active {
    background: rgba(255,255,255,.15);
    border-radius: 6px;
    font-weight: 600;
}
.navbar .nav-link:not(.active):hover {
    background: rgba(255,255,255,.08);
    border-radius: 6px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ── Stat cards ───────────────────────────────────────────── */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.06);
    height: 100%;
    transition: box-shadow .2s;
}
.stat-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.stat-card .label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6c757d;
    font-weight: 600;
}
.stat-card .value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-top: .25rem; }
.stat-card .sub   { font-size: .85rem; color: #6c757d; margin-top: .2rem; }

/* Accent top border variants */
.stat-card.accent-primary { border-top: 3px solid #0d6efd; }
.stat-card.accent-danger  { border-top: 3px solid #e74c3c; }
.stat-card.accent-success { border-top: 3px solid #27ae60; }
.stat-card.accent-warning { border-top: 3px solid #f39c12; }

/* Edit button inside stat card label row */
.stat-edit-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: .72rem;
    color: #6c757d;
    padding: 2px 8px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.stat-edit-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

/* ── Status colors ────────────────────────────────────────── */
.status-green  { color: var(--color-success); }
.status-yellow { color: var(--color-warning); }
.status-red    { color: var(--color-danger);  }

/* ── Tables ───────────────────────────────────────────────── */
.expense-row td { vertical-align: middle; }
.expense-row { cursor: pointer; }
.expense-row.is-paid { opacity: 0.55; transition: opacity .2s ease; }
.expense-row td { transition: background-color .2s ease; }
.expense-row:hover td { background-color: #f0f4ff; }
.expense-row.is-paid td { background-color: rgba(39, 174, 96, 0.05); }
.expense-row.is-paid:hover td { background-color: rgba(39, 174, 96, 0.12); }
.expense-row.is-paid .expense-name {
    text-decoration: line-through;
    text-decoration-color: rgba(0, 0, 0, 0.3);
}

.table-sm td, .table-sm th {
    padding-top: .45rem;
    padding-bottom: .45rem;
}

/* ── Category dot ─────────────────────────────────────────── */
.category-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

/* ── Section headings inside cards ───────────────────────── */
.card h6.fw-bold {
    color: #343a40;
    padding-bottom: .6rem;
    border-bottom: 2px solid #f0f0f0;
}

/* ── Progress bars ────────────────────────────────────────── */
.progress { height: 8px; border-radius: 4px; }
.progress-bar { transition: width .6s ease; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    letter-spacing: .03em;
}

/* ── Skeleton loading ─────────────────────────────────────── */
.skeleton-block {
    background: linear-gradient(90deg, #ebebeb 25%, #d8d8d8 50%, #ebebeb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 12px;
    border: none !important;
    box-shadow: none !important;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Misc ─────────────────────────────────────────────────── */
.page-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

/* ── Mobile (xs ≤575px) ───────────────────────────────── */
@media (max-width: 575px) {
    .stat-card        { padding: .9rem 1rem; }
    .stat-card .value { font-size: 1.2rem; }
    .stat-card .sub   { font-size: .75rem; }
    .toolbar-row      { flex-wrap: wrap; row-gap: .5rem; }
    .toolbar-row .btn { min-height: 44px; padding: .4rem .75rem; }
    .card             { border-radius: 8px; }
    .card.p-3         { padding: .75rem !important; }
    .card.p-4         { padding: 1rem !important; }
}
