/* ==========================================================================
   PREMIUM LAYER
   Depth, material and craft layered over the base system. The colour theme is
   unchanged — only surfaces, spacing and finish are elevated.
   ========================================================================== */

body {
    background:
        radial-gradient(1200px 600px at 78% -10%, rgba(245, 158, 11, .05), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    letter-spacing: -.005em;
}

/* --- Sidebar: layered graphite with an inner light edge --- */
.sidebar {
    background: linear-gradient(180deg, #221f1d 0%, var(--nav-bg) 42%, #171412 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .05), 4px 0 24px -12px rgba(0, 0, 0, .5);
}

.brand {
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent);
}

.brand-mark {
    border-radius: 12px;
    box-shadow: 0 4px 12px -2px rgba(245, 158, 11, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
}

/* Active nav row gets a soft amber wash rather than a flat block. */
.nav-list a.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, .19), rgba(245, 158, 11, .05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.nav-list a.active::before { box-shadow: 0 0 12px rgba(245, 158, 11, .7); }
.nav-count { box-shadow: 0 1px 3px rgba(185, 28, 28, .4); }

/* --- Topbar --- */
.topbar {
    background: rgba(250, 250, 249, .82);
    box-shadow: 0 1px 0 rgba(24, 24, 27, .05);
}
.topbar-search input:focus { box-shadow: var(--ring); }

.user-avatar {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 3px rgba(24, 24, 27, .2);
    font-weight: 700;
}

/* --- Page header --- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; letter-spacing: -.03em; }

/* --- Cards get a crisp finish, like real material --- */
.card {
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    background: linear-gradient(180deg, #fff, #fefefe);
}
.card-header { border-bottom: 1px solid var(--line-soft); letter-spacing: -.01em; }
.card-header .hint { font-weight: 500; }

/* ==========================================================================
   Hero panels — dark, weighty, unmistakably the most important thing
   ========================================================================== */
.hero-grid { gap: 18px; margin-bottom: 18px; }

.hero {
    border: 0;
    border-radius: 18px;
    padding: 24px 26px 22px;
    color: #fafaf9;
    background:
        radial-gradient(520px 200px at 100% 0%, rgba(255, 255, 255, .07), transparent 70%),
        linear-gradient(155deg, #2a2522 0%, var(--nav-bg) 55%, #141110 100%);
    box-shadow: var(--shadow-hero);
    isolation: isolate;
}
.hero::after { display: none; }

/* A soft coloured glow marks in vs out without shouting. */
.hero::before {
    content: '';
    position: absolute; inset: auto -30% -60% auto;
    width: 320px; height: 320px; border-radius: 50%;
    filter: blur(52px); opacity: .5; z-index: -1;
}
.hero.in::before { background: rgba(245, 158, 11, .34); }
.hero.out::before { background: rgba(168, 162, 158, .30); }

.hero-label { font-size: 11.5px; letter-spacing: .13em; }
.hero.in .hero-label { color: var(--amber); }
.hero.out .hero-label { color: #d6d3d1; }
.hero.in .hero-label i, .hero.out .hero-label i { color: inherit; }

.hero-value {
    color: #fff;
    font-size: 42px; font-weight: 800; letter-spacing: -.035em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.hero-value .cur {
    font-size: 17px; font-weight: 600;
    color: rgba(250, 250, 249, .55);
    letter-spacing: 0;
}
.hero-foot { color: rgba(250, 250, 249, .6); font-size: 13px; }
.hero-foot a { color: var(--amber); font-weight: 600; }
.hero-foot a:hover { color: #fbbf24; text-decoration: none; }

/* ==========================================================================
   Tiles
   ========================================================================== */
.tile { border-radius: 14px; padding: 17px 18px; background: linear-gradient(180deg, #fff, #fdfdfc); }
.tile-label { font-size: 11.5px; letter-spacing: .08em; color: var(--faint); }
.tile-value { font-size: 26px; letter-spacing: -.03em; }
.tile-icon { border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(24, 24, 27, .04); }
a.tile:hover { border-color: rgba(245, 158, 11, .5); }

/* ==========================================================================
   Trend chart
   ========================================================================== */
.trend-svg { width: 100%; height: 150px; display: block; overflow: visible; }
.trend-grid line { stroke: var(--line-soft); stroke-width: 1; }
.trend-line { fill: none; stroke: var(--amber-deep); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { fill: #fff; stroke: var(--amber-deep); stroke-width: 2.5; }
.trend-x { font-size: 10.5px; fill: var(--faint); font-weight: 600; }
.trend-hit { fill: transparent; }
.trend-bar-hi { fill: rgba(245, 158, 11, .12); opacity: 0; transition: opacity .1s; pointer-events: none; }
.trend-col:hover .trend-bar-hi { opacity: 1; }

.trend-legend {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding: 0 2px 14px;
}
.trend-legend .big { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.trend-legend .cap { font-size: 12.5px; color: var(--muted); }

/* ==========================================================================
   Flow bars (money in / money out)
   ========================================================================== */
.flow { display: flex; flex-direction: column; gap: 15px; }
.flow-row .flow-top {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; margin-bottom: 7px;
}
.flow-name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.flow-amt { font-size: 15px; font-weight: 700; }
.flow-track { height: 10px; background: #f1efec; border-radius: 999px; overflow: hidden; }
.flow-fill {
    height: 100%; border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.flow-fill.in { background: linear-gradient(90deg, #292524, #57534e); }
.flow-fill.out { background: linear-gradient(90deg, #d6d3d1, #e7e5e4); }

.flow-net {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 14px; margin-top: 3px;
    border-top: 1px dashed var(--line);
    font-size: 14px;
}
.flow-net strong { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }

/* ==========================================================================
   Buttons — subtle gradient + lift
   ========================================================================== */
.btn-primary {
    background: linear-gradient(180deg, #fbbf24, var(--amber) 55%, var(--amber-deep));
    border-color: var(--amber-deep);
    color: #1c1917;
    box-shadow: 0 1px 2px rgba(180, 83, 9, .3), inset 0 1px 0 rgba(255, 255, 255, .4);
    font-weight: 650;
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--amber), var(--amber-deep) 60%, #b45309);
    color: #1c1917;
    box-shadow: 0 3px 8px -1px rgba(180, 83, 9, .38), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-dark {
    background: linear-gradient(180deg, #292524, var(--nav-bg));
    box-shadow: 0 1px 2px rgba(24, 24, 27, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.btn-light { background: linear-gradient(180deg, #fff, #fafafa); box-shadow: var(--shadow-sm); }
.btn-light:hover { background: linear-gradient(180deg, #fafafa, #f4f4f5); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table > thead > tr > th {
    background: linear-gradient(180deg, #fafafa, var(--line-soft));
    font-size: 10.5px; letter-spacing: .09em; color: var(--faint);
}
.table > tbody > tr:hover { background: rgba(245, 158, 11, .035); }
.table tfoot td { background: linear-gradient(180deg, var(--line-soft), #f0f0ef); }

/* ==========================================================================
   Attention strip
   ========================================================================== */
.attention {
    border-radius: 14px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: var(--amber-line);
    box-shadow: 0 1px 3px rgba(180, 83, 9, .08);
}
.attention .att-icon {
    box-shadow: 0 2px 6px -1px rgba(217, 119, 6, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
}

/* ==========================================================================
   Report tiles
   ========================================================================== */
.report-tile { border-radius: 14px; background: linear-gradient(180deg, #fff, #fdfdfc); }
.report-tile .rt-icon {
    background: linear-gradient(145deg, #fef3c7, #fde68a);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.report-tile:hover .rt-icon {
    background: linear-gradient(145deg, var(--amber), var(--amber-deep));
    color: #1c1917;
}

/* ==========================================================================
   Totals box
   ========================================================================== */
.totals-box {
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #fbfbfa);
    box-shadow: var(--shadow);
}
.totals-box .line.grand strong { font-size: 26px; }

/* ==========================================================================
   Pills & forms
   ========================================================================== */
.pill { padding: 3px 10px 4px; }
.form-control:focus, .form-select:focus { box-shadow: var(--ring); }

/* ==========================================================================
   Section heading used above grouped content
   ========================================================================== */
.section-head { display: flex; align-items: center; gap: 10px; margin: 4px 2px 12px; }
.section-head h2 {
    font-size: 13px; font-weight: 700; margin: 0;
    text-transform: uppercase; letter-spacing: .1em; color: var(--faint);
    white-space: nowrap;
}
.section-head .rule { height: 1px; background: var(--line); flex: 1 1 auto; }

@media (max-width: 767.98px) {
    .hero-value { font-size: 33px; }
    .hero { padding: 20px; }
    .page-head h1 { font-size: 22px; }
}

@media print {
    .hero {
        background: #fff !important; color: #000 !important;
        border: 1px solid #d4d4d8 !important; box-shadow: none !important;
    }
    .hero-value, .hero-label, .hero-foot { color: #000 !important; }
    .hero::before { display: none; }
}
