:root {
    --bg-color: #050505;
    --text-primary: #f0f0f0;
    --text-secondary: #999;
    --accent-yellow: #ffcc00;
    /* Raincoat Yellow */
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 12px;

    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Courier Prime', monospace;

    --header-height: 80px;
    --spacing-md: 2rem;
    --spacing-lg: 6rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.7;
    min-height: 100vh;
    font-size: 16px;
    cursor: none;
    /* Custom cursor */
}

/* Film Grain Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' participate='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 10;
    /* Lower than UI */
}

/* Vignette */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    /* Slightly lighter opacity */
    pointer-events: none;
    z-index: 9;
    /* Lower than UI */
}

/* ... (cursor remains at 9999) ... */

/* Cursor styles follow */

/* Custom Cursor */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px dashed var(--accent-yellow);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
    mix-blend-mode: difference;
    animation: cursorSpin 4s linear infinite;
}

#cursor.hovered {
    width: 40px;
    height: 40px;
    background: rgba(255, 204, 0, 0.1);
    border-style: solid;
}

@keyframes cursorSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-primary);
}

/* --- GLITCH / CHROMATIC ABERRATION --- */
.glitch-hover {
    position: relative;
    display: inline-block;
}

.glitch-hover:hover {
    animation: glitch-anim 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--accent-yellow);
}

.glitch-hover:hover::before,
.glitch-hover:hover::after {
    display: block;
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
    pointer-events: none;
}

.glitch-hover:hover::before {
    animation: glitch-anim-1 0.4s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #0ff;
    z-index: -1;
}

.glitch-hover:hover::after {
    animation: glitch-anim-2 0.4s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #f0f;
    z-index: -2;
}

@keyframes glitch-anim {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
        transform: translate(-2px, 0);
    }

    20% {
        clip-path: inset(60% 0 1% 0);
        transform: translate(2px, 0);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
        transform: translate(-2px, 0);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(2px, 0);
    }

    80% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(-1px, 0);
    }

    100% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(1px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(2px, 0);
    }

    20% {
        clip-path: inset(30% 0 20% 0);
        transform: translate(-2px, 0);
    }

    40% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(2px, 0);
    }

    60% {
        clip-path: inset(20% 0 50% 0);
        transform: translate(-2px, 0);
    }

    80% {
        clip-path: inset(60% 0 20% 0);
        transform: translate(1px, 0);
    }

    100% {
        clip-path: inset(40% 0 40% 0);
        transform: translate(-1px, 0);
    }
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(8, 8, 8, 0.95) 0%, rgba(15, 15, 15, 0.98) 100%);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-close {
        display: block;
    }
}

.sidebar.closed {
    transform: translateX(-100%);
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.mobile-toggle span {
    width: 30px;
    height: 2px;
    background: var(--accent-yellow);
    transition: 0.3s;
}

.sidebar-header h2 {
    color: var(--accent-yellow);
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    transition: text-shadow 0.3s ease;
}

.sidebar-header h2:hover {
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.6), 0 0 40px rgba(255, 204, 0, 0.2);
}

.sidebar-nav {
    flex: 1;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section h3 {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 2px;
    font-family: var(--font-body);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid transparent;
    /* Prevent layout shift */
    position: relative;
    /* overflow: hidden; Removed to show glow */
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.15), rgba(255, 204, 0, 0.02));
    color: var(--accent-yellow);
    border-left: 3px solid var(--accent-yellow);
    border-color: rgba(255, 204, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.1);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at left, rgba(255, 204, 0, 0.1), transparent 70%);
    pointer-events: none;
}

.nav-item svg {
    margin-right: 14px;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.nav-item:hover svg,
.nav-item.active svg {
    color: var(--accent-yellow);
    filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.4));
}

.nav-item[data-view="store"] {
    margin-top: 24px;
    border: 1px solid var(--accent-yellow);
    justify-content: center;
    background: rgba(255, 204, 0, 0.05);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.1);
}

.nav-item[data-view="store"]:hover {
    background: rgba(255, 204, 0, 0.15);
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.2);
    transform: translateY(-2px);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 24px;
    margin-top: auto;
    position: relative;
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.3), transparent);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.credits {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    position: relative;
    overflow: hidden;
    z-index: 50;
}

.top-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-secondary);
}

.user-profile {
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 100px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: calc(var(--header-height) + 40px) 40px 60px;
}

/* Dashboard View */
.welcome-section {
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Dashboard Cards */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.4s ease, background 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 30, 30, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-yellow);
    transform: scaleY(0);
    transition: transform 0.4s ease;
    transform-origin: bottom;
}

.tool-card:hover::before {
    transform: scaleY(1);
}

.card-icon {
    font-size: 24px;
    margin-bottom: 1.5rem;
    color: var(--accent-yellow);
}

.tool-card:hover .card-icon {
    color: var(--accent);
    background-color: rgba(234, 179, 8, 0.1);
}

.tool-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

/* Minimal Footer */
.main-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px 40px;
    margin-top: auto;
    /* Push to bottom */
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(0deg, rgba(10, 10, 10, 0.8) 0%, transparent 100%);
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.3), transparent);
}

.footer-left {
    display: flex;
    gap: 12px;
}

.divider {
    color: var(--border);
}

.cycle-text {
    font-family: monospace;
    opacity: 0.5;
    letter-spacing: 1px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tool View Specifics */
.tool-view {
    max-width: 800px;
    margin: 0 auto;
    animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-access-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-access-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 204, 0, 0.2);
}

.tool-access-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.5), transparent);
    opacity: 0.5;
}

.tool-icon-large {
    margin-bottom: 24px;
    color: var(--accent-yellow);
    filter: drop-shadow(0 0 15px rgba(255, 204, 0, 0.3));
}

.input-group {
    margin-bottom: 24px;
}

/* Inputs */
.input-label {
    display: block;
    font-size: 0.8rem;
    color: var(--accent-yellow);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.styled-input,
.styled-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    border-radius: 4px;
    /* More angular for technical feel */
    font-family: var(--font-body);
}

.styled-input:focus,
.styled-textarea:focus {
    outline: none;
    border-color: var(--accent-yellow);
    background: rgba(255, 204, 0, 0.05);
}

.primary-btn {
    background: transparent;
    color: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    background: rgba(255, 204, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
    transform: translateY(-2px);
    border-color: #ffd700;
}

.primary-btn:active {
    transform: translateY(0);
}

.output-area {
    margin-top: 32px;
    padding: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.output-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.result {
    font-family: monospace;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    /* Thinner */
    height: 6px;
    /* For horizontal */
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 204, 0, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-yellow);
}

/* Data / Expense Items */
.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-item:hover {
    background: rgba(255, 204, 0, 0.05);
}

.expense-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.expense-amount {
    font-family: var(--font-mono);
    /* Monospace for numbers */
    color: var(--accent-yellow);
    font-weight: 600;
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        /* Full screen menu on mobile */
        transform: translateX(-100%);
        background: rgba(0, 0, 0, 0.95);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: flex;
    }

    .main-content {
        width: 100%;
    }

    .top-header {
        padding: 0 20px;
        padding-left: 60px;
        /* Space for toggle */
    }

    .content-area {
        padding: 100px 20px 40px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }


    /* Mobile Footer */

    .main-footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 24px;
        font-size: 0.7rem;
    }

    .footer-left {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .divider {
        display: none;
    }

    /* Mobile Typography */
    .welcome-section h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    /* Mobile Sidebar Header */
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}