@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap');

/* ─── CUSTOM PROPERTIES ─── */
:root {
    --gold: #c9a84c;
    --gold-light: #f0d080;
    --gold-dim: #8a6f2e;
    --gold-glow: rgba(201, 168, 76, 0.18);
    --gold-glow-s: rgba(201, 168, 76, 0.08);
    --bg: #09090b;
    --bg-card: #111114;
    --bg-raised: #18181c;
    --border: rgba(201, 168, 76, 0.14);
    --border-mid: rgba(201, 168, 76, 0.28);
    --border-hot: rgba(201, 168, 76, 0.55);
    --text: #f0ede8;
    --text-muted: #8a8880;
    --text-dim: #4a4845;
    --green: #22c55e;
    --red: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ─── RESET ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ─── BASE ─── */
body {
    font-family: 'Syne', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    animation: grainShift 0.8s steps(1) infinite;
}

@keyframes grainShift {
    0% {
        background-position: 0 0;
    }

    10% {
        background-position: -5% -10%;
    }

    20% {
        background-position: -15% 5%;
    }

    30% {
        background-position: 7% -25%;
    }

    40% {
        background-position: -5% 25%;
    }

    50% {
        background-position: -15% 10%;
    }

    60% {
        background-position: 15% 0%;
    }

    70% {
        background-position: 0 15%;
    }

    80% {
        background-position: 3% 35%;
    }

    90% {
        background-position: -10% 10%;
    }

    100% {
        background-position: 0 0;
    }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 99px;
}

/* ─── PAGE LOAD ANIMATIONS ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.header {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-grid {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.chart-section {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.transactions-section {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* ─── HEADER ─── */
.header {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}

.header h2::before {
    content: '◈ ';
    color: var(--gold);
    font-size: 0.85em;
}

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

/* ─── HEADER CONTROLS ─── */
.dropdown,
.data-picker {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.dropdown:hover,
.data-picker:hover {
    border-color: var(--border-mid);
    color: var(--gold-light);
    background: var(--bg-raised);
}

.export-btn {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: #09090b;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.04em;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 18px rgba(201, 168, 76, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.export-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 32px rgba(201, 168, 76, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.export-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ─── MAIN CONTENT ─── */
.main-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ─── DASHBOARD GRID ─── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 0;
}

/* ─── CARDS ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.35s ease;
}

/* Sweeping shimmer line on hover */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transition: left 0.55s ease;
}

.card:hover::before {
    left: 140%;
}

/* Mouse-tracking radial glow */
.card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--gold-glow) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
}

.card:hover::after {
    opacity: 1;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-mid);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 30px var(--gold-glow-s);
}

/* Add this to your script.js to enable mouse-tracking glow:
   document.querySelectorAll('.card').forEach(c => {
     c.addEventListener('mousemove', e => {
       const r = c.getBoundingClientRect();
       c.style.setProperty('--mx', ((e.clientX - r.left) / r.width * 100) + '%');
       c.style.setProperty('--my', ((e.clientY - r.top) / r.height * 100) + '%');
     });
   });
*/

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-menu {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.card-menu:hover {
    color: var(--gold);
    background: var(--gold-glow-s);
}

/* ─── AMOUNT ─── */
.amount {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'DM Mono', monospace;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.income-amount {
    background: linear-gradient(135deg, #86efac, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.expense-amount {
    background: linear-gradient(135deg, #fca5a5, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.change {
    font-size: 0.78rem;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'DM Mono', monospace;
}

/* ─── MY CARD (PREMIUM) ─── */
.my-card {
    background: linear-gradient(135deg, #18181c 0%, #1e1a0e 50%, #18181c 100%);
    border: 1px solid var(--border-mid);
}

/* Rotating conic shimmer */
.my-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%,
            transparent 0deg,
            rgba(201, 168, 76, 0.06) 60deg,
            transparent 120deg,
            rgba(201, 168, 76, 0.04) 180deg,
            transparent 240deg,
            rgba(201, 168, 76, 0.06) 300deg,
            transparent 360deg);
    animation: cardRotate 8s linear infinite;
    pointer-events: none;
    height: 1px;
    /* override the shimmer line from .card::before */
}

/* We need to reset .my-card::before from .card::before */
.my-card::before {
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%,
            transparent 0deg,
            rgba(201, 168, 76, 0.06) 60deg,
            transparent 120deg,
            rgba(201, 168, 76, 0.04) 180deg,
            transparent 240deg,
            rgba(201, 168, 76, 0.06) 300deg,
            transparent 360deg);
    animation: cardRotate 8s linear infinite;
    transition: none;
}

@keyframes cardRotate {
    to {
        transform: rotate(360deg);
    }
}

.my-card .card-title {
    color: rgba(240, 208, 128, 0.7);
}

.card-chip {
    width: 42px;
    height: 32px;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    border-radius: 6px;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}

.card-chip::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: var(--gold-dim);
    border-radius: 3px;
    opacity: 0.6;
}

.card-number {
    font-family: 'DM Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    color: rgba(240, 208, 128, 0.9);
    margin-bottom: 1.25rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-holder {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(240, 208, 128, 0.75);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card-logo {
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
}

.card-logo-red {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dc2626;
    opacity: 0.9;
}

.card-logo-orange {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f59e0b;
    margin-left: -10px;
    opacity: 0.9;
}

.spending-section {
    margin-top: 1.5rem;
}

.spending-limit {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: var(--gold-light);
}

.spending-used {
    font-size: 0.75rem;
    color: rgba(240, 208, 128, 0.5);
    margin-bottom: 0.6rem;
    font-family: 'DM Mono', monospace;
}

.progress-bar {
    height: 4px;
    background: rgba(201, 168, 76, 0.12);
    border-radius: 99px;
    overflow: visible;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-light));
    border-radius: 99px;
    position: relative;
    animation: progressGrow 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
    transform-origin: left;
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.5);
}

@keyframes progressGrow {
    from {
        width: 0%;
    }

    to {
        width: 37%;
    }
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 8px var(--gold);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.6);
    }
}

/* ─── CHART SECTION ─── */
.chart-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
}

.chart-container {
    height: 280px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.015);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.chart-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.chart-column span {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-family: 'DM Mono', monospace;
}

.chart-bar {
    width: 100%;
    background: rgba(201, 168, 76, 0.12);
    border-radius: 4px 4px 0 0;
    border: 1px solid rgba(201, 168, 76, 0.08);
    transition: background 0.3s, transform 0.3s;
    transform-origin: bottom;
    animation: barGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes barGrow {
    from {
        transform: scaleY(0);
        opacity: 0;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

.chart-column:nth-child(1) .chart-bar {
    animation-delay: 0.05s;
}

.chart-column:nth-child(2) .chart-bar {
    animation-delay: 0.1s;
}

.chart-column:nth-child(3) .chart-bar {
    animation-delay: 0.15s;
}

.chart-column:nth-child(4) .chart-bar {
    animation-delay: 0.2s;
}

.chart-column:nth-child(5) .chart-bar {
    animation-delay: 0.25s;
}

.chart-column:nth-child(6) .chart-bar {
    animation-delay: 0.3s;
}

.chart-column:nth-child(7) .chart-bar {
    animation-delay: 0.35s;
}

.chart-column:nth-child(8) .chart-bar {
    animation-delay: 0.4s;
}

.chart-column:nth-child(9) .chart-bar {
    animation-delay: 0.45s;
}

.chart-column:nth-child(10) .chart-bar {
    animation-delay: 0.5s;
}

.chart-column:nth-child(11) .chart-bar {
    animation-delay: 0.55s;
}

.chart-column:nth-child(12) .chart-bar {
    animation-delay: 0.6s;
}

.chart-bar:hover {
    background: rgba(201, 168, 76, 0.3) !important;
    transform: scaleY(1.04) !important;
    border-color: var(--border-mid);
    cursor: pointer;
}

.filter-btn {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-family: 'Syne', sans-serif;
    color: var(--text-muted);
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--border-mid);
    color: var(--gold);
    background: var(--gold-glow-s);
}

/* ─── EXPENSES BREAKDOWN ─── */
.expenses-breakdown {
    margin-top: 1rem;
}

.total-expenses {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'DM Mono', monospace;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.period-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
}

.period-tab {
    cursor: pointer;
    color: var(--text-dim);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex: 1;
    text-align: center;
}

.period-tab:hover {
    color: var(--text-muted);
}

.period-tab.active {
    background: var(--bg-raised);
    color: var(--gold-light);
    font-weight: 600;
    border: 1px solid var(--border-mid);
    box-shadow: 0 0 12px var(--gold-glow-s);
}

.color-bar {
    height: 4px;
    border-radius: 99px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, var(--gold), #22c55e);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.color-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.expense-categories {
    list-style: none;
}

.expense-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: padding-left 0.2s, color 0.2s;
    cursor: default;
}

.expense-category:hover {
    padding-left: 6px;
    color: var(--text);
}

.expense-category:last-child {
    border-bottom: none;
}

.category-info {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-food {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.dot-entertainment {
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold);
}

.dot-transport {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.dot-utilities {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

/* ─── TRANSACTIONS TABLE ─── */
.transactions-section {
    margin-top: 0;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.transactions-table th {
    text-align: left;
    padding: 0.6rem 1rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'DM Mono', monospace;
    border-bottom: 1px solid var(--border);
}

.transactions-table td {
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: color 0.2s;
}

.transactions-table tbody tr {
    transition: background 0.2s;
    position: relative;
}

.transactions-table tbody tr:hover {
    background: rgba(201, 168, 76, 0.04);
}

.transactions-table tbody tr:hover td {
    color: var(--text);
}

/* Gold indicator on row hover */
.transactions-table tbody tr::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gold);
    transform: scaleY(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

.transactions-table tbody tr:hover::after {
    transform: scaleY(1);
}

.status-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    border: 1px solid rgba(34, 197, 94, 0.2);
    letter-spacing: 0.03em;
    display: inline-block;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--gold);
    background: var(--gold-glow-s);
}

/* ─── FABs ─── */
.add-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 200;
}

.fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* Ping ring animation */
.fab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: fabPing 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes fabPing {
    0% {
        box-shadow: 0 0 0 0 currentColor;
        opacity: 0.5;
    }

    70% {
        box-shadow: 0 0 0 14px currentColor;
        opacity: 0;
    }

    100% {
        box-shadow: 0 0 0 0 currentColor;
        opacity: 0;
    }
}

.fab-income {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #052e16;
}

.fab-income::before {
    color: rgba(34, 197, 94, 0.25);
}

.fab-expense {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: #450a0a;
}

.fab-expense::before {
    color: rgba(239, 68, 68, 0.25);
}

.fab:hover {
    transform: scale(1.12) translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.fab:active {
    transform: scale(0.94);
    transition: transform 0.1s;
}

/* ─── MODALS ─── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease both;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-xl);
    width: 420px;
    max-width: 92vw;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 60px var(--gold-glow-s);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    overflow: hidden;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.01em;
}

.close-btn {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.close-btn:hover {
    color: var(--gold);
    border-color: var(--border-mid);
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: 'DM Mono', monospace;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;

}

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

.form-input:focus,
.form-select:focus {
    border-color: var(--gold-dim);
    background: rgba(201, 168, 76, 0.04);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.form-select option {
    background: var(--bg-card);
    color: var(--text);
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ─── BUTTONS ─── */
.btn {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    border: none;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: #09090b;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 32px rgba(201, 168, 76, 0.4);
}

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

.btn-secondary {
    background: var(--bg-raised);
    border: 1px solid var(--border-mid);
    color: var(--text-muted);
}

.btn-secondary:hover {
    border-color: var(--border-hot);
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
    .chart-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
    }

    .header {
        padding: 1rem;
    }

    .header h2 {
        font-size: 0.95rem;
    }

    .header-controls .data-picker {
        display: none;
    }
}