@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.15s;
    animation-timing-function: ease-in-out;
}

:root {
    color-scheme: dark;
    background-color: #0A0A0C;
    --obsidian: #0A0A0C;
    --slate-vellum: #15161A;
    --copper: #D97757;
    --alabaster: #EAEAEA;
    --glass-bg: rgba(21, 22, 26, 0.65);
    --glass-border: rgba(217, 119, 87, 0.2); 
    --font-serif: 'Playfair Display', serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    background-color: #0A0A0C;
    scrollbar-gutter: stable;
}

body, html {
    width: 100%;
    min-height: 100vh; 
    background-color: var(--obsidian);
    color: var(--alabaster);
    font-family: var(--font-mono); 
}

.app-frame {
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
    width: 100%;
}

.glassmorphic {
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.serif-heading {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--alabaster);
}

.mono-data {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--alabaster);
    opacity: 0.8;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    height: 60px;
    flex-shrink: 0; 
    border-top: none;
    border-left: none;
    border-right: none;
    position: relative;
    z-index: 100;
}

.brand {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--copper);
    letter-spacing: 1px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 60px; 
}

.nav-link {
    text-decoration: none;
    color: var(--alabaster);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--copper);
}

.dropdown-menu {
    position: absolute;
    top: 60px; 
    left: -1rem; 
    list-style: none;
    min-width: 150px;
    padding: 0.5rem 0;
    border-top: 2px solid var(--copper);
    background-color: rgba(21, 22, 26, 0.98); 
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--alabaster);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-link:hover {
    background-color: rgba(217, 119, 87, 0.1);
    color: var(--copper);
}

.workspace {
    flex-grow: 1;
    display: flex;
    padding: 1.5rem;
    
}

.ledger-module {
    flex-grow: 1;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .top-bar {
        height: auto;
        min-height: 0; 
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        width: 100%;
        box-sizing: border-box;
        overflow: visible; 
        position: relative; 
    }
    
    .nav-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
        width: 100%;
    }
    
    .nav-item {
        height: auto; 
        width: auto; 
        min-width: max-content;
        justify-content: center; 
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        display: block; 
        text-align: center;
        white-space: nowrap;
    }
    
    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0; 
        transform: none;
        background-color: #0A0A0C; 
        border: 1px solid var(--glass-border); 
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        width: 100%;
        box-sizing: border-box;
        z-index: 9999;
    }
    
    .nav-item:hover .dropdown-menu,
    .nav-item.active .dropdown-menu {
        display: block;
    }
    
    .module-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .module-header .mono-data {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .workspace {
        padding-left: 0;
        padding-right: 0;
    }
    
    .ledger-module {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}